Grass Node v0.3.x

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Grass Node v0.3.x

Post by bitplane »

update: Updated to work with Irrlicht 1.5

Image

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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Other
Posts: 85
Joined: Fri Dec 03, 2004 5:41 pm
Contact:

Re: Grass Node v0.1

Post by Other »

That is really cool! Wow! nice work!!! :D
My Irrlicht&ODE-Project: http://www.lofing.de/myworld/
krama757
Posts: 451
Joined: Sun Nov 06, 2005 12:07 am

Post by krama757 »

Most definately, the bomb :)
Guest

Post by Guest »

maybe you can add a rand() so that each gras "particle" is at a slight other size (or just other height) because it does not look very realistic when they all have the same size&orientation :)

but cool work !!

see you!
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

yup! excellent work! :D also making it render a bit further away would make it look cooler. (I'm sure it's possible with the code you provide)


I would also like to have this node for my bald head, heheheheheh :wink:
sRc
Posts: 431
Joined: Thu Jul 28, 2005 1:44 am
Location: Salt Lake City, Utah
Contact:

Post by sRc »

afecelis wrote:I would also like to have this node for my bald head, heheheheheh :wink:
:lol: :lol:

i dont think Niko has added "Human Body" support to Irrlicht yet acefelis ;) :D
The Bard sRc

Blog | Twitter
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

thanks for the feedback guys :D
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 :lol:

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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
genesisrage
Posts: 93
Joined: Tue Feb 08, 2005 12:19 pm

Post by genesisrage »

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.
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

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
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

Procedural Grass: Good point. Serious Sam only allowed the "grass type" effects on the "terrain" so I am assuming that this is what they did (i.e. height from height map image).

--EK
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Awesome work bitplane! :shock:
Now Irrlicht scenes will get more realistic view. Keep your good work. I will include your node with your permission in VisualEditor. Also if you have any idea for creating of any tool especially for this node will try to help.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Xaron
Posts: 310
Joined: Sun Oct 16, 2005 7:39 am
Location: Germany
Contact:

Post by Xaron »

bitplane wrote:1) a new render mode/shader that does transparrent alpha channel and vertex alpha together
Thank you bitplane! :) This looks really great!

I'll try to create such a material as I already did some investigation in that direction. ;)

Regards - Xaron
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

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.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

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 :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply