Home Technical Talk

suggestions for good grass planes?

polycounter lvl 18
Offline / Send Message
Cthogua polycounter lvl 18
Hey everybody,
I was wondering if any of you far more experienced environment artists out there had any suggestions, or tips on making good grass planes/ground level plants. Most of my attempts so far have come off too harsh seeming, especially at angles where the plane starts to shade. I've tweaked the normals of the plane, and that seems to help, but I'm not sure what the optimal configuration is is there more I could be doing?

any help would be enormously appreciated
James Ball

Replies

  • Mark Dygert
    Hair/Fur baked to planes, set at zig-zag criss-cross angles. /\/\/\/\/\/\/\
    Hair/Fur even comes with a grass preset hair style. When people draw grass by hand they normally forget depth, this works as a good place to start.

    Not really sure what you mean about the plane shading? Do you mean you get block-ish shadows? It really depends on the 3D app, or the engine as to how it handles transparencies.
    Typically you'll either turn off shadows, or render with transparencies turned on, its normally an advanced setting in the shadow parameters.
  • kio
    Online / Send Message
    kio polycounter lvl 16
    setting the material to some self illumination also helps a big deal.

    have a look at the whole crysis vegetation stuff - they also have some models for max in their mod sdk as far as i know.
  • Cthogua
    Offline / Send Message
    Cthogua polycounter lvl 18
    Vig and Kio thanks for the replys, after playing around a bit I think I'm gonna go with the hair/fur solution. I do have a question though...Is there a better way (in Max 9) to project the grass onto a plane than simply rendering out a front view and photoshopping that into a texture?
  • Mark Dygert
    That's what I've done in the past and it works pretty well. I guess you could try using Render to Texture but something tells me that'll be messy? Never really tried it that way before.

    It will probably pay off to render with some simple lights or close to 70% self illum, default viewport lighting will probably look wonky.

    One thing to keep in mind, Hair/Fur won't render in Orthographic views (front, left, top user ect). It will only render in Perspective view or from a camera. Because you might be coming back to this and re-rendering it a few times, wrangle your pers viewport into position, and go "Views > Create Camera From Viewport" This way you can have your pers viewport back and can always go back to the same angle =)

    Also when you crack open Hair/Fur theres a S-Load of options, find the Multi Strand Parameters to generate more grass and use Splay Root/Tip to push it away from the source hair.

    If you really want to get into it, you can add a very slight Wind Space Warp and render out a few frames, and play that on the plane. To make it loop you can copy the animation and reverse it, or use video post to render the second half backwards. Crazy shit I know, but when you see it move slightly it adds a ton of depth. But it really depends on what you're using this for and where its going...
  • Cthogua
    Offline / Send Message
    Cthogua polycounter lvl 18
    Hey man thanks for all the info! I delved into the hair/fur thing for grass about 2 and half years ago when I was doing hi-rez stuff and pre-rendered animations at a military training software company in FL (which I don't recommend ever doing BTW :-P ). Once I actually remembered where the hair/fur modifier was and that all you had to do was slap it on some geo, all I had learned before slowly started trickling back. Good call on the wind space warp, I need to check what our support for animated textures is though. That's part of the problem I'm running into, some of the functionality like self-illum and being able to turn off shadowing and whatnot is not currently exposed in our materials here at work, so I'm gonna have to go bend an engineer's ear.....goodie gumdrops
  • Rob Galanakis
    Set the normals to directly up, so they will be lit correctly. And then just use a number of planes for clumps.
  • mikebart
    Hey Cthogua,
    Ive been experimenting with grass recently too, I've rendered 1024x512 diffuse, spec and normal textures from highpoly models, and mapped them to quads and tri's.

    vegetation01dcopypv1.th.jpg

    the doom3 ingame shots are'nt using level of detail models but the uv space has been designed especially to be used for lod, the top half of the texture will also tile horozontaly if needed. You can see in the wireframe image that I've arranged them into 4 different lod models ranging from about 500 tri's down to just 6 tri's.

    grasswirepq8.th.jpg

    Its not a very hi res image in terms of pixel density to scale, but there is a lot of texture variation and alot of opportunity to add more different types of plants, like weeds and flowers, also having the tilable grass ground texture rendered from the same highpoly models as the alpha'd planes helps keep consistency aswell

    Honestly, im pretty happy with the overal composition but I dont think i've really nailed the lighting as Im getting a few black blades here in there, at the moment im just using a one directional and one ambient for my lights, and in that 5th shot you can see how it reacts to dynamic light with a fire effect.
    it might be more suitable for a controlled lightmapped environment like with "Beast" but any advice in regard to lighting would be great.

    Hope this is helpful.

    Professor420; when you say "Set the normals to directly up, so they will be lit correctly", are you talking about editing the normal map, or the polygon normals?



    grass01lz8.th.jpg grass03kv7.th.jpg grass05ui1.th.jpg grass02ci3.th.jpg grass04oj9.th.jpg
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    the best results we got here was letting the engine set the normals to match the underground. Which is sorta equivalent to Prof's suggestion of modifying the mesh's normals to face up directly, and then orient the grass perpendicular to ground.
    I did it a bit different for lux, as using the non-normalized interpolated vertex normal of ground gives best matches for per-vertex lighting

    20060930224107_00001.jpg

    although with "normalmaps" this might be harder to achieve, then again I am not sure if normalmaps are really needed for grass.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    For ETQW, we used a distribution system where the grass was 100% self-illuminated, and each model's vertex-colour was tinted with the terrain texture's pixel below, so it always matched up with the ground pretty well. Then the grass was vertex-deformed for "wind" effects (using each model's vertex alpha to control the strength of the sway).

    The models were usually 6-12 triangles, just a clump of planes at arbitrary rotations so they tended to look good from most viewing angles.
  • mikebart
    Crazybutcher; Thanks for the info, Ill test my grass with normals facing up and without the normal map. I think the normalmap, although possibly quite expensive, does help the grass render nicely with dynamic lights but still might not be worth it.

    MoP; oh man, I really have to catch up with all this new idtech4 stuff, ill definitly look into the stuff system, cheers.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yeah, our grass in ETQW is not dynamically lit except for some simple sunlighting, it was too expensive to render that much stuff with normalmaps and correct lighting - the visual result of using a much cheaper shader isn't that different in the end, anyway.
  • Rob Galanakis
    Yeah, there is really no need for grass normal mapping.
  • mikebart
    Well, I'd have to disagree with you there Professor, I think the normal map helps to disguise the flat planey look you get in a lot of ingame grass, it might only be suitable for a closed in corridor type of a level, I can understand why you wouldnt use a shader like this on a massive terrain with alot of other stuff happening for performance reasons these days, but with the way things are moving forward I cant see things like grass being simple shaders for much longer.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    the simplified point of normalmaps is varying shading depending on light angle. When you have grass you basically have "flat" blades, with varying colors themselves. Due to them being bent, waving... their shading changes always a bit anyway, also subsurface makes them less "solid". Which means up close with so much "bending" going on the varity of shading is high, ie some blades face light, some dont. You might as well get the same effect by simply varying sahdes in the diffuse map.

    If you approximate such "light" organic material with "simple normalmaps", it will look worse in my opinion. Simply as its not the type of "solid" object, like a crate, metal pipe whatever. So to get it look "good" again, you either have to come up with a really complex shader taking all sorts of effects into account. Or, the more sane way to this fill-intensive effect, use simplified version.

    grass2.jpg
    http://blogs.move.com/do-it-green/wp-content/blogs.dir/24/files/2007/09/grass2.jpg

    the further you move away from the grass, the more it really is just like a "extended ground", hence nearly all games will simply apply ground's shading for best "blend" look.

    in the shot one can see up close, the "noise" is really high, if you use normalmaps, or would simply add some "noise" manually would make no visual difference.

    its not like people walk up to a single grass blade ;)

    the main issue compared to reality so, is that in games you still see the ground "poygons" ;) so its much more important to get the objects to blend with the ground well, than this "individual lighting".
  • mikebart
    grass08wn9.th.jpg grass09pa9.th.jpg

    ok I'd have to agree that in these 2 images the right image (without normalmap) is a bit easier on the eye, although its slightly more visible where the grass planes hit the ground without the normalmap, but maybe vertex shading to match the terrain could resolve that.

    I see what you're saying about subsurface, maybe if I toned down the normalmap, possibly added some self illumination it could help that.

    in the shots below I've added another ambient light with a colour in the centre of this patch of grass, so there is a bit of bullshit in there, its not by any means a practical lighting solution for doom3, but i think something like that could be replicated on a larger scale in a more advanced engine.

    grass06rs1.th.jpg grass07pt9.th.jpg

    In the right image you almost cant see where the grass planes hit the ground, also I could never get that amount of depth out of the diffusemap alone, as you can see in the right image, but then again, maybe I wouldnt want it.

    The grass is actually on a 2048x2048 textureatlas with some other plants and tree foliage, so thats what urged me to use a normalmap in the first place.
  • Mark Dygert
    I see harsh shadows on the grass turning blades of grass into tubes of grass. The harsh light/shadows also do not exists in the rest of the world, which makes for a much more fake world.

    You're using a normal map to create tonal changes in the grass diffuse, which can easily be done when painting the texture. Once again, normal maps are being used to bail out the artist who isn't painting a proper diffuse. Artists need to imitate life and not imitate what they know about life.

    "Grass is not always green and the sky is not always blue and normal maps are not the Spackle that make up the difference.
    "

    I could kind of see normal mapping grass come into play in a LOD/Distance kind of scenario but really I don't think its necessary. There is so much more you could spend the resources on, why waste it on grass for only marginal gains, when the impact could be much more elsewhere? In the same footprint you might even be able to create smaller grass planes that sit at the bottom of the bigger, helping to blend everything together. Tube of realtime fake looking grass, or things that properly blend...

    There's a few reasons why Normal mapped LOD grass wouldn't work, a lot of LOD's hit their highest when they get close to the camera/player. Normal Mapped LOD grass could cause more chugging at key moments. Who is going to be paying attention to grass when an enemy jumps on screen? Why pays attention to grass at all? I guess when your system chugs hard, you have time to stop and smell the normal mapping on the grass...

    I guess focus testing would determine the fate of normal mapped grass, but really I see that as a waste of company resources, someone would have to put up a hell of fight to get the green light on that idea... but maybe not at a place with near unlimited resources?
  • mikebart
    Yeah, this is going a bit off topic now, its probably not a exactly "suggestions for good grass planes" anymore, more what not to do ;)

    I wouldn't do something like this at work in a production environment unless I new for certain it was going to work properly, make a visual impact and not hinder performance, this is more 'spare time at home work'.

    "I see harsh shadows on the grass turning blades of grass into tubes of grass."

    the tubular parts are intentional, although I'd have to agree they are quite harshly lit, none of the actual 'blades' of grass have been turned into tubes of grass.

    I understand where you're all coming from and am actually learning a lot from the comments and advice so i"m glad I posted it up here but I'm still not convinced that a normalmap has no place on a grass shader even for the marginal gain.
  • Ben Cloward
    Offline / Send Message
    Ben Cloward polycounter lvl 18
    Here's my contribution to the grass topic:

    http://www.bencloward.com/fxShadersFolliage.zip

    This zip file has a Max scene set up with lots of grass in it that's using an FX shader that I wrote for grass. The shader makes all of the grass normals point up for better lighting and moves the top verts of the grass planes around with a sine wave to make it look like it's blowing in the wind. It's not perfect - and you'll probably see some draw-order issues with sorting, but I think it turned out ok.
  • EarthQuake
    What really makes the grass with normals look bad is just that its rendered in doom3 with pointlights or whatever. If you had a nice outdoor lighting system (maybe hdr image based? =P) i think it would look a lot more natural.
    Once again, normal maps are being used to bail out the artist who isn't painting a proper diffuse.

    "Grass is not always green and the sky is not always blue and normal maps are not the Spackle that make up the difference."

    These are some pretty ignorant viewpoints, and more often than not lead to shity diffuse maps that dont work well at all with normals. You definitely SHOULD let the normals be the spackle, thats what its for, the normals should never be an afterthought. Not saying that i even think you need normals on grass or that its going to give you better results, just that in general i would never agree with those statements.
  • Mark Dygert
    Taken out of the context of this thread, I might agree.

    I think you misunderstood what I was saying. I guess we can get farther off track by widening this discussion to things other then grass?

    I was saying that the normal map was being used as a patch to prop up the diffuse. When in most cases the diffuse is strong enough to stand on its own, for grass.

    Of course if we start talking about weapons or other assets (which we aren't) the conversation would be different. Of course you don't want lighting info fighting your normal map.

    If I was to analogize the normal maps role when it is properly being used, I would say its more like mortar, not spackle. Unlike spackle mortar is not used to cover up undesirable details, its used to functionally enhance the visual quality of a surface.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    kio wrote: »
    setting the material to some self illumination also helps a big deal.

    have a look at the whole crysis vegetation stuff - they also have some models for max in their mod sdk as far as i know.

    Does anyone have access to these (trees and grass/plants) crysis max files that they can pass on? Not sure outside EULA? Don't have the game, so I cant even install the SDK without to just look at the max files. Yes, I tried to extract the files from the exe without success.
  • mikebart
    EQ; Yeah, either that or something like 'beast' http://www.illuminatelabs.com/products/beast/features
    I mentioned this before, its been used in some pretty major titles for precalculating lightmaps with Global Illumination.

    Vig; Ill paint/bake a bit more colour into the diffuse and try and get it looking closer to the normalmapped version (hopefully without the harsh shadows) and post it up, I cant see it giving the same amount of depth or blending with itself quite as well as it does with the normal map though.

    "If I was to analogize the normal maps role when it is properly being used, I would say its more like mortar, not spackle. Unlike spackle mortar is not used to cover up undesirable details, its used to functionally enhance the visual quality of a surface."

    A normal map can also be used to define curve and depth of a surface and help to control the separation of different elements in a texture under multiple lighting situations.
    For this particular type of grass, I'm also using a normal map combined with the diffuse to define different parts of the grass, if you look closely at the normal map you can see the tall reedy parts have a cylindrical shape while the actual blades which are quite flat, face different angles, also an important thing that a lot of artist seem to forget when making realistic vegetation; decay, you can see 'squiggly' bits of dead grass in the mix aswell, the normal map helps to separate all these elements from each other.

    I think the biggest argument here is probably whether or not its worth putting this amount of effort and attention to detail into something like grass, but sometimes grass could fill up to 50% of a scene so why should it not get the attention it deserves?

    grasssheet01nmow2.jpg
    Shot at 2008-08-12
  • Murr
    Offline / Send Message
    Murr polycounter lvl 8
    Hi guys!

    im new here!
    nice forum :thumbup:

    Im creating grass aswell lol,
    And now i need to get the normals up.

    but i have no idea how to do this in 3dsmax :poly141:

    Any help??
  • Murr
    Offline / Send Message
    Murr polycounter lvl 8
    how can you put the normals up in 3Dmax?
Sign In or Register to comment.