PDA

View Full Version : Coding Grass/Vegetation



01-13-2003, 08:12 AM
Hello everyone!

Ive been seraching for tuturial on how to make grass in an OGL app/game, but until now i havent find nothing.. maybe the keywords im using arent the more correct but, can anyone point me to some grass/vegetation tuturial.
Thx in advance!

nexusone
01-13-2003, 08:31 AM
Just a few weeks back seen a post on a grass demo....

Was posted here on the openGL website or at
nehe.gamedev.net



Originally posted by Grass dwd:
Hello everyone!

Ive been seraching for tuturial on how to make grass in an OGL app/game, but until now i havent find nothing.. maybe the keywords im using arent the more correct but, can anyone point me to some grass/vegetation tuturial.
Thx in advance!

01-13-2003, 08:51 AM
Are u sure?
I couldnt c anything to do with grass or/and vegetation. Could u give me the link plz http://www.opengl.org/discussion_boards/ubb/smile.gif
Thx

nexusone
01-13-2003, 10:19 AM
Here is the link from the nehe.gamedev.net site the demo was posted like two months ago.

Real time grass demo
http://chaos89.emuvibes.com/Demo3D/index.html



Originally posted by Grass dwd:
Are u sure?
I couldnt c anything to do with grass or/and vegetation. Could u give me the link plz http://www.opengl.org/discussion_boards/ubb/smile.gif
Thx



[This message has been edited by nexusone (edited 01-13-2003).]

JustHanging
01-14-2003, 08:09 AM
Look at that, the base code for that demo was made by some finnish guy! I'm not sure if the demo works correctly on my computer though, is it supposed to look very dithered? Might have something to do with my TNT, I'm surprised the demo worked at all.

Anyway, I also experimented with grass a while ago, here's what mine looks like: http://www.hut.fi/~ikuusela/images/grass.jpg . The technique is kinda complicated, but in short the grass is drawn by 3-sided cylinders with a view-dependent texture on them. The texture contains pictures of a patch of grass, approximately the same shape as the cylinder, taken from lots of diffent directions.

-Ilkka

MickeyMouse
01-14-2003, 08:15 AM
Looks cool!
Did you release any demo?

01-15-2003, 01:52 AM
Thx to u all!

Well, the demo donsnt run on my pc..
My graph card doesnt support those extensions :|, but Ill try to c how it is done. Anyway, if u know of other tuturials on grass/vegetation/fur, tell me plz

01-15-2003, 02:02 AM
Very nice screen. Could u share with us how have done it?

Cheers

01-15-2003, 02:37 AM
Ive been thinking.
What about using lines based on a bone structure and maybe blured a litle?

This way, we could animate the grass according to the wind direction and others things.

What do u think?

cheers

JustHanging
01-15-2003, 04:45 AM
Originally posted by MickeyMouse:
Looks cool!
Did you release any demo?

Thanks! I didn't release it back then, but I guess I can as well do it now. Here goes: http://www.hut.fi/~ikuusela/demos/Grass_demo.zip

I hope it works, I wasn't going to release it when I did it. It's not very optimized either, but it's fill-limited anyways.

Grass Dwd:
I gave a short explanation in my previous post. There are lots of details, but most of them you can easily sort out yourself too. Can you tell me which part you didn't understand? If you get the demo work, you can dive underground, that should give you some hints too.

Your line thing sounds ok for small amounts of grass, but I think it gets too heavy if the ground is filled by grass. Or maybe you could replace the lines with triangle strips, that might look better.

-Ilkka

Edit: link didn't work

[This message has been edited by JustHanging (edited 01-15-2003).]

MickeyMouse
01-15-2003, 06:35 AM
kaksi comments http://www.opengl.org/discussion_boards/ubb/smile.gif:
Nice demo.
It could be even nicer if you made your grass move as the wind blows. This wouldn't make things faster, but everything has its cost.

I wouldn't build grass from single lines, grass like that would require huge amount of lines to look dense. This wouldn't look naturally too, since the grass' width would stay the same no matter you're far from or close to it.

01-15-2003, 07:22 AM
Unfortunatly ur program doesnt run :\ it starts and closes before anything.
Anyway, ur probably right about that line thingy.
I'll keep searching and trying until i find something that looks good enough and runs fast http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Cheers

Originally posted by JustHanging:
Thanks! I didn't release it back then, but I guess I can as well do it now. Here goes: http://www.hut.fi/~ikuusela/demos/Grass_demo.zip

I hope it works, I wasn't going to release it when I did it. It's not very optimized either, but it's fill-limited anyways.

Grass Dwd:
I gave a short explanation in my previous post. There are lots of details, but most of them you can easily sort out yourself too. Can you tell me which part you didn't understand? If you get the demo work, you can dive underground, that should give you some hints too.

Your line thing sounds ok for small amounts of grass, but I think it gets too heavy if the ground is filled by grass. Or maybe you could replace the lines with triangle strips, that might look better.

-Ilkka

Edit: link didn't work

[This message has been edited by JustHanging (edited 01-15-2003).]

JustHanging
01-15-2003, 12:32 PM
Originally posted by MickeyMouse:
kaksi comments.
I'm impressed.

Yeah, the wind would be cool, altough I'm not sure how well it works with my technique. Maybe I'l try that some day, but I have serious doubts.

Sorry Grass dvd, I guessed it wouldn't run on your system, since the other demo didn't run either. What kind of video card do you have? It's propably got to do with the extensions, I use multitexture, tex_env_combine and CVA. But the last one is only used for speed, and the two others for, well, the sun effect, so maybe I could wrap up an extension free version. But that's no promise.

-Ilkka