Front Warrior's Instanced Grass 100k-384k polygons per frame

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply

Would you like me to write a tutorial about this

I'd like to use it in my game
24
51%
I'd like to make it on my own and toy with it
6
13%
I'd look at it and nothing else
11
23%
I wouldn't bother reading
6
13%
 
Total votes: 47

devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Front Warrior's Instanced Grass 100k-384k polygons per frame

Post by devsh »

yes you read it right, 384 000 polygons rendered EACH frame, for the grass.
here is a comparison

the instancing level runs at 25-50% of the original FPS

No instancing
Image

Instancing
Image


I am considering making a full in-depth tutorial on how to achieve this., but I doubt how many people would benefit from it. Let me know, cause I really dont have much time to write a tut.

I do not claim that I have built that grass node... I have just optimised it. My input is getting from the second screenshot to the first one. It was eigen who came up with the grass positioning and generation system.
Josie
Posts: 44
Joined: Sat Jul 25, 2009 4:08 am
Location: Griffin, Georgia, US
Contact:

Post by Josie »

Well, it's technically impressive, but the pictures don't look very pleasing. Also, I don't want my grass pushing that many polygons, I'd rather use those polygons else where.

Good work, but I don't think it's done yet.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

True.. with some lightning and shadowing it could proove to be very nice.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Are you using a shader approach for this? It looks quite good,maybe you could share some insight.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

That was my question. What instancing method are you using?
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I use geometry shaders combined with batching and some parts of pseudo instancing, I also use geometry shaders to perform per-primitive frustum culling (that is a huge difference).

I think the biggest killer here is the fill rate. I am currently adding the per-primitive+per-node frustum culling and I expect the fps to go up a lot. I will also report back any changes I make.

Here is a screenie that shows the grass in the worst way, if you ever pay attention to grass when playing a game you will notice that it looks ugly when looked at perpendicularily because it dissappears. this is to proove how thick mine is (FPS is low because its a screenie from an old version)
Image

EDIT: my grass works at 30 fps in worst case scenario
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

Now after the culling which is still WIP, the stable fps is 30 to 40 as opposed to previous 25-30, the non instancing version runs at 60 so i don't see much fps difference I just see lush grass. I added some colour variation in the shader, so different batches of grass have different colours. And in the first screenshot scene where I first presented the technique get 38fps instanced vs 58fps non-instanced, I get the same FPS as non-instanced.
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

is there a way to make less instancing like say 50% of what you are currently doing? IMO 30-40 fps is not good for grass and terrain when you still have the rest of the level to add in. So if it were possible to limit the amount of instancing to increase the fps that would be a very useful thing to have. Maybe just instance grass that is within a distance of X so it look lush close but doesn't kill the fps.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

I have already done that.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Maybe you could "leak" some more details on Front Warrior. I'm all eyes and ears. :D 8)
And a tip, try not to emphasize the grass in the game too much, or it will attract the players attention too much.
You want the player to play, not criticise how the grass is affecting their fps.
I mean how much time of your life do you spend looking at grass. :lol:
Here's two samples from cod4
above (very thinly spread)
Image
from the side(gives appearance of lots of grass)
Image
Anyways I'm just saying.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Although you could also go mad with the grass and try for something like this. Just saying. 8)
Examples from arma 2
Image
Image
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

personally, I like the cod4 grass more ^^
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

All are true, basically the grass looked so ugly non instanced because it didnt blend with the terrain, now it does and it just looks OK, but with instancing you think its soo thick. And the CoD grass looks OK when you are looking down because of the good ground texture which creates an Illusion.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Lighting, Shadowing can also change allot of how the grass blends with the ground, adding shadowing to the grass or just darkening the terrain below the grass can greatly help blend the grass and terrain. Another thing is to not give the grass poly texture a solid kind of base, have grass blades on a texture spaced apart from another this prevents the player from seeing individual patches of grass. Another thing to consider would be not to continuosly cover the terrain with grass, but try to use a noise texture to do placement of grass patches from this provides a random and more natural feel to the scene, it also prevents tiling issues.
Another tip would be to have grass blades sufficiently spaced and high enough so that from the players height he can not see the base of the blade of the next grass. As my awesome paint skills demonstrate. :D Image
Last edited by ACE247 on Wed Jun 09, 2010 8:15 pm, edited 1 time in total.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

how are you going to use that noise texture then clever man?
Post Reply