Grass Node v0.3.x
Grass Node v0.3.x
update: Updated to work with Irrlicht 1.5
The grass node creates grass for your terrain.. grass nodes should be created and destroyed by your seamless world, but the example uses a 10x10 grid of them.
demo here, or get the latest source from the irrExt svn repository (Irrlicht 1.5 compatible)
The grass node creates grass for your terrain.. grass nodes should be created and destroyed by your seamless world, but the example uses a 10x10 grid of them.
demo here, or get the latest source from the irrExt svn repository (Irrlicht 1.5 compatible)
Last edited by bitplane on Tue Dec 29, 2009 11:42 pm, edited 13 times in total.
Re: Grass Node v0.1
That is really cool! Wow! nice work!!!
My Irrlicht&ODE-Project: http://www.lofing.de/myworld/
thanks for the feedback guys
It needs 3 more things though to make it fully usable tho...
1) a new render mode/shader that does transparrent alpha channel and vertex alpha together
2) a daddy class that spawns and kills grass nodes as you walk around
3) an editor, or integration with an existing editor (hint hint, etcaptor )
I think the ultimate would be to join meshes together instead of using billboards, use irrSpintz hardware mesh buffers, and do wind and the fading with vertex shaders (hint hint, omar )
@gfx- they do have dimension2d for size, and it is randomized, but thats the problem. different plant types should be different sizes and stuff.. someone just needs to walk around with a lawnmower and a watering can (set grassnode->Partlicles[n].size and sprite) and make the place look nice, then call grassnode->Save().
@afecelis- i tried doubling the distance but the framerate drops a lot. next version will have user defined draw distance.. also if you gimme a heightmap and texture for your head, and a texture of one of your eyebrows I'll see what I can do
what kind of framerates are you guys getting?
It needs 3 more things though to make it fully usable tho...
1) a new render mode/shader that does transparrent alpha channel and vertex alpha together
2) a daddy class that spawns and kills grass nodes as you walk around
3) an editor, or integration with an existing editor (hint hint, etcaptor )
I think the ultimate would be to join meshes together instead of using billboards, use irrSpintz hardware mesh buffers, and do wind and the fading with vertex shaders (hint hint, omar )
@gfx- they do have dimension2d for size, and it is randomized, but thats the problem. different plant types should be different sizes and stuff.. someone just needs to walk around with a lawnmower and a watering can (set grassnode->Partlicles[n].size and sprite) and make the place look nice, then call grassnode->Save().
@afecelis- i tried doubling the distance but the framerate drops a lot. next version will have user defined draw distance.. also if you gimme a heightmap and texture for your head, and a texture of one of your eyebrows I'll see what I can do
what kind of framerates are you guys getting?
Last edited by bitplane on Mon Jan 09, 2006 8:30 am, edited 2 times in total.
-
- Posts: 93
- Joined: Tue Feb 08, 2005 12:19 pm
im getting 100-120 fps
p4 2.8, 2gb ram, ati 9800xt 256mb
have an idea about the drawing distance... instead of having it show or not show at a specific distance, make it tapered... something like 0-100 units 100% of nodes, 100-120 80%, 120-140 60%, and so on... this might give it a more natural feeling.
p4 2.8, 2gb ram, ati 9800xt 256mb
have an idea about the drawing distance... instead of having it show or not show at a specific distance, make it tapered... something like 0-100 units 100% of nodes, 100-120 80%, 120-140 60%, and so on... this might give it a more natural feeling.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
One of the best implmentations of this type of thing I ever saw was by Croteam in Serious Sam 2. If I recall correctly, there were three things they did two things to make it work & look good.
Firstly they trimmed the amount of grass shown depending on the distance to the camera. That is, the further away from the camera - the less "grass particles" there were (and this was a linear progression).
Secondly, the particles were semi-randomly scattered & slightly oriented. This gave the grass a moe natural "wild" look than the standard "grass soldiers" look.
Finally, there were generally two types of grass which were mixed together. There tended to be a "common type" and an "uncommon" type mixed together at about 3:2 ratio. Again adding to the "natural look".
The trick to these methods I guess is making sure that the "semi-randomness" is constant (so that moving does not cause the grass to shift locations, orientation, etc).
--EK
Firstly they trimmed the amount of grass shown depending on the distance to the camera. That is, the further away from the camera - the less "grass particles" there were (and this was a linear progression).
Secondly, the particles were semi-randomly scattered & slightly oriented. This gave the grass a moe natural "wild" look than the standard "grass soldiers" look.
Finally, there were generally two types of grass which were mixed together. There tended to be a "common type" and an "uncommon" type mixed together at about 3:2 ratio. Again adding to the "natural look".
The trick to these methods I guess is making sure that the "semi-randomness" is constant (so that moving does not cause the grass to shift locations, orientation, etc).
--EK
made a small update, use Z, X, C and V keys to adjust max distance and max density (you cant go past about 1300 per patch unless you regenerate)
the problem with creating them procedurally is getting the height from the terrain. if this was changed to read the heightmap instead of using a triangle selector, it might be feasable to generate patches on the fly in realtime. i might give this a try, but i really like the idea of lawnmowers and watering cans.
to get the same grass every time you just set the random seed the same: (pos.X * 1000 + pos.Z) or something
also i tried the falloff thing but didnt get it quite right yet.
the problem with creating them procedurally is getting the height from the terrain. if this was changed to read the heightmap instead of using a triangle selector, it might be feasable to generate patches on the fly in realtime. i might give this a try, but i really like the idea of lawnmowers and watering cans.
to get the same grass every time you just set the random seed the same: (pos.X * 1000 + pos.Z) or something
also i tried the falloff thing but didnt get it quite right yet.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
good work. Thank you bitplane.
there is something wrong with the Rotation,when moving mouse to the left or to
the right the grass will rotate which means the grass is not fixed in the land.
any way it is really nice and one step for Irrlicht to be more realistic just
like the OGRE demos.
there is something wrong with the Rotation,when moving mouse to the left or to
the right the grass will rotate which means the grass is not fixed in the land.
any way it is really nice and one step for Irrlicht to be more realistic just
like the OGRE demos.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
okay i changed it from billboards and added in a rotation. creation is now weighted between how far away and how important a blade is (how low its index is), and i added a camera frustrum bounding box check. i'm now getting the height for each blade using this code.. creation time is much faster - good enough for realtime, so loading is only an option now