Discussion: Realistic Grass (and fur)

Started by
17 comments, last by Ivyn 21 years, 8 months ago
Ivyn: thanks, glad you liked it. And this is a realtime in-game shot of a small test level (a testbed for all kind of natural effects).

quote:
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.

Well, the paper doesn't really address the issue of rendering. They focus more on the animation of the individual grass blades and on the LOD system.

The parts I took from the paper is their LOD idea (slightly adapted): 3D blades in the near field, 2.5D further away and 2D far away from the camera. The LOD scheme is an important part, esp. on huge grass fields. Since the whole grass field is procedurally defined, you can easily get several hundred billions of blades. No 3D card can handle that

I also used parts of their animation idea. I liked their way to represent 'wind primitves'. That way, you can easily have a procedural weather system, that creates different controlled wind effects (from simple direction wind blows, to vortex/tornado like movement). However, I replaced the wind evaluation equations with a 2D fluid dynamic system (a 2D Navier Stokes solver). That way, the movement of the grass is physically more or less accurate.

About the rendering itself, it's actually not very complicated. Basically pixelshader magic Good colours and alpha antialising to render the individual blades. Shadows onto the grass are done via projective shadowmapping. The 2.5D and 2D representations are bumpmapped using an animated normalmap. From a distance it looks like 3D blades, at only a fraction of the cost of a real 3D blade.

The only real performance bottleneck are the true 3D blades near the camera. But the geometry is fully in VRAM, and all deformation is done on the GPU using vertex shaders. That way, you can render quite a bunch of blades on a GF4. It also automatically adapts to framerate: if the fps drops below a certain limit, it will reduce the number of 3D blades and replace them with faked bumpmapped 2.5D representations.

Teknofreek: yep, that's realtime (45fps on a GF4-Ti4600, Athlon XP 2100. It could faster, if I wasn't so lazy to optimize it a bit more ) About the viewer: hmm, game company, hmm, NDA, hmm, lawyers, hmm, nope, sorry. But we will have a public playable demo of our game for around november, it will have the grass and a lot more nice stuff (note the shameless plug )

/ Yann

[edited by - Yann L on August 18, 2002 10:33:29 PM]
Advertisement
>>Teknofreek: yep, that''s realtime (45fps on a GF4-Ti4600, Athlon XP 2100. It could faster, if I wasn''t so lazy to optimize it a bit more )<<

Heh, sounds good enough to me Real nice work man!

>>About the viewer: hmm, game company, hmm, NDA, hmm, lawyers, hmm, nope, sorry.<<

Totally understood...I know how that stuff goes. I was just hopin'' you might be able to since you were able to post a screen shot

>>But we will have a public playable demo of our game for around november, it will have the grass and a lot more nice stuff (note the shameless plug )<<

Sweet! What type of game is it? Anyway, be sure to post another shameless plug up here when the demo is out so I''ll know to go check it out

-John
- John
Crap on a crutch YannL!

You''ve got that running at 54fps, and it ISNT optimized yet? You''ve got some crazy ass coding going on there. I cant even fake a grass effet that good.
"Luck is for people without skill."- Robert (I Want My Island)"Real men eat food that felt pain before it died."- Me
ya but he''s also got a crazy-ass system to run it on. Athlon XP 2100 + GF4 4600? Heh..
---DirectX gives me a headache.
realistic grass would be a really cool thing to add to my 2d game later on. i'm certainly going to look into that. and YannL, that screenshot is truly breath-taking!

edit: YannL, you really should move this to the Graphics Programming and Theory forum.

---
shurcool
wwdev


[edited by - shurcool on August 19, 2002 2:26:41 PM]
Yann: please don't post here ever again. You make me feel worthless

Seriously man, your work is amazing. Could you post a little about yourself? What kind of education you have, how long you've been working with graphics, how long you've been programming, stuff like that. I'm just interested because I've been heavily working with graphics for about 4 years (although I started out with 2d, that took a bit of time) and I'm not nearly close to being as good as you are. I'm just interested what it took for you to get that good.

I can't wait for the public demo of your game. I don't generally buy a lot of games, but you can be sure I'll buy yours when it's published.

EDIT: Yann, how do you deal with z-buffer precision? You have such little details as grass blades and apples on the grass that you can get very close to, how do you manage to keep your z-buffer usable over large areas?

[edited by - kill on August 19, 2002 5:06:04 PM]
Yann, Are all the shots under http://membres.lycos.fr/ylmb/images/ from something running in real time?
quote:
Yann: please don''t post here ever again. You make me feel worthless

Please don''t, it''s really not my intention to make people feel like that I''m just posting this stuff to show people what can be done on todays hardware, and give them ideas for their own projects. There are so many theoretical papers about advanced graphics out there, but finding pratical information about actually implementing them is incredibly hard. I think that information about those advanced effects needs to be shared. And if people see a cool screenshot and think "Oh man, that looks cool, I also want to code that !", and they actually try it (and learn a lot by doing so), then that goal is reached.

quote:
Seriously man, your work is amazing. Could you post a little about yourself? What kind of education you have, how long you''ve been working with graphics, how long you''ve been programming, stuff like that. I''m just interested because I''ve been heavily working with graphics for about 4 years (although I started out with 2d, that took a bit of time) and I''m not nearly close to being as good as you are. I''m just interested what it took for you to get that good.

Oh well, I don''t know if I''m really that good. You never stop learning, that''s part of the experience. I''m just incredibly passionate (read: addicted ) about computer graphics (esp. realtime). OK, if you insist, ''Yann in a nutshell'': I''m 25, I''m programming since the age of 12 or so (starting on a C-64). I really started with graphics in the early 90''s, I''ve been quite active in the demoscene at that time. And I knew I wanted to do 3D when I first saw Wolfenstein-3D About the education: I''ve done totally non-computer related studies (quantum physics). But I had to drop it, because I wasn''t able to finance it anymore. So I started to work in the computer graphics domain, which turned out to be quite a cool thing

quote:
EDIT: Yann, how do you deal with z-buffer precision? You have such little details as grass blades and apples on the grass that you can get very close to, how do you manage to keep your z-buffer usable over large areas?

It''s just a standard 24bit zbuffer. However, the near clipping plane is pretty far away (approx. 8 units), which gives me a lot of dynamic precision near the camera. When you go further away, then the grass blades will z-fight. But that''s no problem, since they get replaced by 2.5D patches long before that happens.

quote:
Sweet! What type of game is it?

Singleplayer medieval fantasy RPG with very strong adventure elements.

quote:
Yann, Are all the shots under http://membres.lycos.fr/ylmb/images/ from something running in real time?

Yep. They are mostly linked by that sky rendering thread some time ago. Except that poor looking photograph of a solar eclipse. I posted it on an eclipse thread in the lounge, in an attempt to show off my incredible photographic talents (*cough*)... Which failed miserably, because bishop_pass posted a link to his professional photo-gallery just a little later...

/ Yann
quote:
Please don''t, it''s really not my intention to make people feel like that.

I know, I meant it as a joke. Your work definetly inspires me to do something new and to learn new things in order to do it.

Keep up the good work so we can all enjoy beautiful screenshots

This topic is closed to new replies.

Advertisement