Skip to main content
GameDev.net gamedev.net
🔒 Locked

grass techniques

Started by shadow_bobble Jan 2, 2004 at 9:56 PM 13 replies 9.5k views
Original Post
shadow_bobble
shadow_bobble
Hi everyone. I saw the previous post on grass effects, but that handles quite a specific question. My question is more general. I have heard of 2 main techniques for drawing grass. The first involves many textured quads standing up off the ground a small distance. Each quad has a grass texture. The second, more complex method, involves drawing many quads _parallel_ to the ground, each offset vertically by a small amount. Each of these quads uses a different segment of an alpha texture that can be used to create volumetric grass. If you fly over this stuff, it should actually look like blades of grass. Something like this is described on Nvidia''s site. My questions are, has anyone implemented either technique, and how did it look? Does anyone know of other techniques? I''m trying to create very short grass (like on a soccer field).
MrP
MrP
I''ve not tried either technique yet, however the first can look very good as you can see on this screenshot, from Era.
shadow_bobble
shadow_bobble
Thanks for the replies MrP and AP!

I''m going to try the parallel technique, as I think it will work better for short grass. I''ll post some screenshots once I get it working.

shadow
DJSnow
DJSnow
btw: does anyone know how the grass in battlefield is done on the screen ? i think, for myself, that this looks damn good.
any ideas ?


DJSnow
---
this post is manually created and therefore legally valid without a signature
DJSnow---this post is manually created and therefore legally valid without a signature
shadow_bobble
shadow_bobble
Hi guys. I got the parallel planes technique working quite well (10 planes). Here is a screenshot:

http://gallery.cybertarp.com/displayimage.php?pos=-24658

It looks much better in motion. If you fly over it, the grass appears to be made of millions of blades that are standing a few inches off the ground.

shadow



[edited by - shadow_bobble on January 6, 2004 9:38:16 PM]

[edited by - shadow_bobble on January 6, 2004 9:38:32 PM]
Qatal
Qatal
quote:
Original post by DJSnow
btw: does anyone know how the grass in battlefield is done on the screen ? i think, for myself, that this looks damn good.
any ideas ?


DJSnow
---
this post is manually created and therefore legally valid without a signature


excuse me? battlefield doesnt have standing-up grass, it simply uses some blended textures...

or have i missed something in my frantic rush to kill the 8 nazis who always seem to be converging on my position....

Chris
die or be died...i think
izzo
izzo
shadow_bobble, where is the grass on Nvidia''s site that you''re talking about? The only grass that I could find there is this:

http://www.nvidia.com/object/demo_grass.html

which isn''t a quads-parallel-to-the-ground thing.

Your screenshot looks interesting. Could you give a brief rundown on how you did it? I don''t quite get it, it sort of sounds like some sort of displacement mapping technique but I''m not sure.

sam
Shadowdancer
Shadowdancer
izzo, the technique has some resemblance to computer tomography. You take several slices of the object to be displayed, stack them up and you get the object again.

The downside (at least as I see it) is that you can''t do interactive grass very well unless you''re generating the textures dynamically and you need rather many layers for close-ups. The forest in Sturmovik has about 4 layers and loses in appeal when you''re getting close to it.
shadow_bobble
shadow_bobble
Hi Izzo.

The Nvidia grass I was talking about is located here:

http://developer.nvidia.com/object/Grass.html

Other than that, Shadowdancer explained quite well how it works, but i''ll just add a little bit.

I have basically a depth/alpha map for the grass. Darker colors are closer to the ground.

I draw 10 quads all parallel to each other using this texture, and each successive quad is slightly higher off the ground than the previous one. I use glColor4f() to increase alpha as you get higher up the stack. This is sort of a kludge, but it works ok. Ideally you should select a band of greyscale values out of the texture for each quad.

Shadowdancer is also right that it doesn''t look good if you get very close to the ground (the screenshot I posted is about .5 meters off the ground. If you go to say... .1 meters, it looks bad). I never need to be that close so it looks ok for me. :-)


shadow
treething
treething
You can do interactive grass with the concentric shells methods. You just have to alter the texture coordinates. I''ve never seen this done, but in theory its possible. For example to make all the grass bend over in 1 direction you''d add an offset to the tex coords proportional to the height of that layer.

I think someone (Hughe Hoppe maybe?) did some similar work with interactive fur. If you go here to his site ( http://research.microsoft.com/~hoppe/ ) and look for the paper called Real-time fur over arbitrary surfaces it might contain useful info.



sBibi
sBibi
something logical would be to use grass LODs, 3D grass blades near the camera, then shells, or even other intermediate methods, and also, decrease the number of shells rendered when the geometry is further away...

I have no idea how to make a smooth and unoticeable transition between the LODs though... could be something interesting to think about and it''s probably what Yann used... at least Y can''t see how to obtain this screenshot with shells :D
WarAmp
WarAmp
http://www.cs.unc.edu/~lin/COMP259-S03/PAPERS/grass.pdf

Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.
WarAmp
WarAmp
http://members.shaw.ca/brookbakay/grass/grass.html
http://www.cs.ubc.ca/grads/resources/thesis/May03/Brook_Bakay.pdf

[edited by - waramp on January 7, 2004 7:00:14 PM]
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.