Game Development Community

Grass

by patrickluff · in General Discussion · 03/20/2009 (9:51 pm) · 6 replies

I have been looking around to try and find out how 3D grass is made and how you place it in your worlds or maps. I do not mean the average 2D grass textures. Do you have to model the blades individualy and put them in 1 by 1? Please inform me how this actually works.

About the author

Recent Threads


#1
03/21/2009 (6:22 am)
You wouldn't want to model grass. The hit of performance would kill your game.
Grass is made in 2 ways. 1: an extrememly realistic looking top down view of real grass painted on the terrain to give that "realisic" looking cover grass, and 2: where you need taller grass and weeds, use foliage replicators. It's 1, 2D image of a weed or clump of grass that's replicated across the area of the replicator. You set the density and number of clumps in the inspector.

#2
03/21/2009 (7:47 am)
I think he's talking about how grass is done in games like WoW and with the HeroEngine. I personally wouldn't use the replicator because it looks like absolute ass. Who wants grass that turns with your character. On Nvidia's website they have a great tutorial about how to do grass without using replicators, and it doesn't take a performance hit.
#3
03/21/2009 (7:55 pm)
thx
#4
03/23/2010 (12:20 pm)
@Jeramy79
Are you referring to this:
http://http.developer.nvidia.com/GPUGems/gpugems_ch07.html

I'm not that knowledgeable with shaders. Would this require any engine mod or can it be done postFX style?

Would you happen to have any references or tutorials to getting this working in game?
#5
03/23/2010 (12:46 pm)
@J what you are seeing in that tutorial is essentially what is done in T3D and very easy to replicate. Typically in torque ground cover is done with a single plane with a grass or bush texture on it and bill boarded so that it always looks at the player. In that tutorial what they are suggesting is to instead use 3 polygon planes with grass a grass texture on it then replicate through the area, which is very easy to do via the forest editor. Almost all games use a similar method for ground cover and WOW and the hero engine are no exception
#6
03/23/2010 (2:04 pm)
@Ken,

Quote:very easy to replicate

Sorry, I've dug on that since the first TGEA's ground cover; (tried a grass shader back then too) tried a hundred different ways with T3D's ground cover and forest kit and I've never accomplished results like what I see in the tutorial without terrible preformance hits. 7fps and it still not looking as good as some of the games you see. Plus you still get the popping in and out of meshes/billboards/grids when you move.

Would you happen to have an example of the settings needed to make a scene like what we are referring to? Please don't take me the wrong way; I'm not arguing, I'm just frustrated and don't believe it can be done with the current ground cover or forest kit. I've tried and tried.

I think an alternative shader is the answer; like the way SpeedTree does as mentioned in the tutorial. If we can use the shader off of the tutorial and target a texture to render the grass on, then we can put the grass wherever we need it. Would be great for leaves and other foliage as well. Super plush terrains, supper fast... I might be dreaming.

Does it work that way? I don't have a clue; but just maybe:

Quote:

Quote:If I were to access a PostFX's render target as a texture, it would go in the texture fields, no?

Yes that works.

Using #prepass, or #lightinfo, or #thenameofyourpostfxtarget as a texture input will automatically bind the texture when the material is rendered. -Tom Spilman



My knowledge of shaders is little to none as I said so my questions are:

How do I convert the tutorial's shader to T3D?
Can I pull this off in a postFX or is an engine shader/mod required?
How do I enable this to render to a texture?
Will that texture relate to a terrain texture just as it would any other normal texture? (Can we just call to render on any texture we want and it works?)

btw, in my game, the ground cover does not render all the billboards facing the player. setup a groundcover object with any material and then turn the material's "double-sided" option off and on. Ground cover really needs improvements. IMHO