Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ivyn

Discussion: Realistic Grass (and fur)

This topic is 5878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

One thing I really yearn to see in games is realistic grass. What I mean by ''realistic grass'' is grass that actually protrudes from the ground and sways softly in the wind even encumbering the character''s feet. Currently all 3D games have just flat polygon surfaces colored green. I''m wondering if it''s resonable to take on the challenge of representing realistic grass in my game and I want all your opinions on how this could be accomplished and still run at a resonable speed for a realtime game. I recall seeing in a behind the scenes look at the movie ''Shrek'' they said they used a fur system for their grass because it worked so fine. This got me to thinking. Has anyone ever tried to add realistic fur into a realtime game? And/or realistic grass? I''m open to all suggestions, post on!! -- Ivyn --

Share this post


Link to post
Share on other sites
Advertisement
the wolfman demo by nvidia that had good looking fur had layers of textures, all slightly bigger than the ones below. maybe that would work? or theres that codecreatures engine that is incredibly slow and high poly with real grass.

Share this post


Link to post
Share on other sites
I actually did a fair bit of testing with this. Probably the best method at the moment is some variation of the "Shell and Fin" approach. If you do a search for that you''ll most likely find some Siggraph papers on the evolution of this technique.

The short version of it is that you have a bunch of planes that are evenly spaced apart. The planes each have a texture applied to them such that if you look at it the collection of planes it looks like the blades/hairs/etc are continuous from one layer to the next. In other words, imagine actually having the geometry of all of the blades of grass and then imagin cutting that into a bunch of layers. That''s the shells part of it.

The fins are another set of planes that are perpendicular to the other set of planes and lie inside of them. These are used so that as you get down to the horizon you don''t notice that you have a bunch of layered planes. These "fins" help fill in the detail. Hmmm, that may be hard to picture. But, like I say, just do a search for it and you should be able to find papers on it with pictures of what I''m describing.

Further work on this approach has involved creating and applying other textures, such as normal maps, to allow additional effects, like using a pixel shader to actually shade the grass somewhat correctly. You can also use tightly tiled maps for the grass blades themselves and then modulate the color over larger distances with another map. This allows you to get variations in the overall grass color, for areas that have been trampled through, or have gotten less water, etc. Another thing you can do is to use a vertex shader to swim the uv''s around a bit. This will give you an approximation of the blowing in the wind effect that you were askin'' about.

BUT......one thing you should be aware of is that to get really good looking stuff, you''ll need to use a decent number of layers. This is NOT cheap....especially since you''ll want to use variable alpha for the planes, which will cause a lot of overdraw. But, OTOH, it does look a helluva lot better than that badly mapped ground plane we''ll all grown to know and hate All in all, I''d say it''s certainly do-able on a decently high-end system, but just so you know, it''ll probably take you awhile to get it working efficiently and work out all the quirks involved with the process.

Well, I hope that helps!

-John

Share this post


Link to post
Share on other sites
go to the ati developer page, they show you the currently most advanced way to draw fur, wich you can use for grass as well..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
quote:

Has anyone ever tried to add realistic fur into a realtime game? And/or realistic grass?


Yep. I implemented a modified version of this system for our game (I added bumpmapping and various perpixel lighting effects). It looks nice, but I wouldn't call it totally photorealistic yet. It is pretty efficient though.

Screenshot:

Runs at about 45fps on a GF4 Ti4600. But it isn't optimized yet.

/ Yann


[edited by - Yann L on August 18, 2002 4:14:22 PM]

Share this post


Link to post
Share on other sites
Yann L: Christ, that''s the most amazing thing I''ve ever seen! OMG! Are you sure that''s in game!! (Well of course since you made it ) But WOW!

Thanks for the link to the paper, I will download and read. Tho the screens on that page don''t look nearly as good as yours do.

Teknofreek thank you for your excellent post as well!

-- Ivyn --

Share this post


Link to post
Share on other sites
there is a way to apply an effect that makes it look like grass is swaying lightly in the wind that we are now using for our game. (actually 2, i''ll post the second one tommorow)

What we did was have some wind directions that didnt really affect gameplay that much so dont go on about that. Now, we had our 3d guy (who we sealed in carbonite to keep safe) to do a little trick with shadows and blur effects. First, we had a shadow cast on the ground with grass on it. Simple enough, we just made certain areas of the map have a "grass" tag put onto them.

Next we added in the math which calculated the angle of the wind, wind intensity, and grass variations, which was done by our math chick (if you are offended by the word chick, thats a name she came up with, so deal with it.) The angle of wind and wind intesity are pretty self explanatory, however, i should get into grass variations. Basically what this does is determine the shadow intesity based on the grass length (another simple thing based on the grasses length in inches) So the taller the grass is, and the higher variance amount (ya know, 3 inches give or take about half an inch).

Then, after all of this is put in next comes the shadow movement and blur effect. Wel, we just take the wind intensity and angle to determine the speed and direction the shadow on the grass is headed. That was simple. Then we apply a blur effect that has an intensity that changes depending on the length of the grass. Since we limit the amount of shadows, we get a nice and fast grass shadow system. I''ll post how we did large amounts of high grass tommorrow.

Share this post


Link to post
Share on other sites
Damn Yann! You sure that''s a real-time render there? The blades look really high-quality. I don''t suppose you can post a little viewer app of that scene, could you? I''d LOVE to look see how it holds up when looking/moving around in it

-John

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!