Jump to content

Tree bilboarding for more clutter nodes


photo

Recommended Posts

We are using more nodes (trees) in each worldclutter node. How to set grass billboarding in this case? In example there is only one item in worldclutter. I ve noticed, that all nodes inside clutter are billboarded by the same billboard. It is possible to set billboarding for all nodes inside clutter with individual billboards (merge bilboard textures into one and somehow configure)?

How to setup proper rotation spread for billboards? Z rotation is covered automatically, but it seems that not x and y. We are using rotations for all 3 axises (small ones for x and y), to achieve more natural look.

Link to comment
  • 2 weeks later...

So should we use always 1 worldclutter node for 1 billboarded item? Isnt this against filosophy of world clutter? Arent there any performance disadvanatages (number of world clutters will increase in our case 6-7x)?

Link to comment

So should we use always 1 worldclutter node for 1 billboarded item?

 

 Yes, it's one clutter and one grass node for a far LOD per each tree. Here is an example from Valley:

 

post-13-0-69962500-1357811683_thumb.png

 

Arent there any performance disadvanatages (number of world clutters will increase in our case 6-7x)?

 

Having one node or several World Clutter nodes should not incur a performance penalty, as they only render nodes within a specified radius.

 

How to setup proper rotation spread for billboards? Z rotation is covered automatically, but it seems that not x and y. We are using rotations for all 3 axises (small ones for x and y), to achieve more natural look.

 

 Grass impostors have only Z-axis rotation, there's no rotation for X and Y.

Link to comment

 Yes, it's one clutter and one grass node for a far LOD per each tree.

 

Ok, so you are not planning possibility to merge for example 8 billboards into one texture and use it for clutter with 8 kind of trees? Coud be there some performance boost in this case?

Link to comment
  • 2 weeks later...

Having one node or several World Clutter nodes should not incur a performance penalty, as they only render nodes within a specified radius.

 

 

 Grass impostors have only Z-axis rotation, there's no rotation for X and Y.

 

I modified my scene, so instead of having 3 trees in one world clutter and 1 grass impostor for all (sure, not well working impostor, because of 3 kinds of trees) I made 3 world clutters each with 1 tree and 3 grass impostors. Framerate loss is 30-40 percent (!!!). Instead of having 85-110FPS in previous setup I have 50 -70 now. But it makes sense, instead of rendering 1 grass impostor (one texture), it renders 3 textures. Also having 3x more clutters could(?) make diffrence, because my 3 trees are sharing same textures.

 

Also having no XY rotation for impostors means effectivly not using this feature.

Link to comment

Also having no XY rotation for impostors means effectivly not using this feature.

Can you describe a use case for that?

 

1 grass impostor for all

You can combine atlases manually to add only 1 grass object (texture transformations are available in the grass_impostor_base material, in case you need them).

 

Also having 3x more clutters could(?) make diffrence, because my 3 trees are sharing same textures.

Splitting one World Clutter into three would not be a bottleneck: trees are rendered only in the specified radius, so their number did not change.

 

I made 3 world clutters each with 1 tree and 3 grass impostors. Framerate loss is 30-40 percent (!!!). Instead of having 85-110FPS in previous setup I have 50 -70 now.

Sorry, I cannot reproduce such FPS loss. Even if i enable 14(!) grass impostors, I only loose about 14 FPS (40 vs 54).

post-13-0-42395800-1359192152_thumb.png

post-13-0-54764400-1359192178_thumb.png

Link to comment

Can you describe a use case for that?

 

If you put trees into forest, you put indeed Z random rotation, but it makes sense to even put some small y and y, bacuse trees in forest are in reality never 100% perpendicular.

 

 

Regarding FPS drop, In your use case is FPS drops absulutelly OK, because in one picture there are no billboards, in second there is plenty of them. So this is not proper reproducing. In my case I had billboards in both cases and overall number of billboards is same. In first case I had one clutter with 3 trees with one billboard for all 3 kind of trees (tree density 0.009), in second case I made 3 clutters with separate billboard for each of them (each with tree density 0.003, so the overall density should be same - 3*0.003 = 0.009). You can see this on attached picture, In upperscreen I have 3 billboards, in lower there is one billboard for all trees (which is indeed visually wrong). Density is same, but performance drop is very big and I made screen in case, where it wasnt that bad...

 

Btw, could be possible to littble bit remake density option in clutter settings? I am mostly using values like 0,003 and I cant go lower (0,001 and 0,002 is same like 0), values like 0,01 already means too much of trees.

post-714-0-68477000-1359304489_thumb.jpg

Link to comment

You can combine atlases manually to add only 1 grass object (texture transformations are available in the grass_impostor_base material, in case you need them).

This is very interesting tip, in case I merge 3 atlases together, how should such transformation look?

 

I will prepare some test scene, but it will take some time to "clean" it from rest of the project.

Link to comment
  • 2 weeks later...

Jiri,

 

We've indeeded reproduced a framerate drop. But I'm afraid we cannot introduce any optimizations that drastically change that situation. So please stick the variant with fewer clutters since they work for you.

 

Thanks for your cooperation anyway.

Link to comment

Jiri,

 

We've indeeded reproduced a framerate drop. But I'm afraid we cannot introduce any optimizations that drastically change that situation. So please stick the variant with fewer clutters since they work for you.

 

Thanks for your cooperation anyway.

 

Sorry, but this is not an option. I cant have one billboard for 3, or even more kind of trees, it is too much visible (install and play Crysis 3, to check what is new vegetation standard). Only proper solution is to have one billboard for each tree, but this is performance overkill.

 

Unigine has really great speed of rendering standard objects (one of the best in compare to all other major engines), but vegetation is very slow  (grass, trees). 

This new billboarding system is in production like scene usable only on current  top HW and this is absolutelly not acceptable (game with framerate like valley demo cant go on market).

Primary aim of billboarding system is to significantly lower GPU and CPU usage, not to do opposite like now. I am able to achieve similar vegetation scene-quality as in for example Crysis 3, but in 3x lower framerate. If you cant introduce any optimization, it looks like the whole vegetation system have to be redesigned. Other example is grass, there is huge performance drop even with something like 80k polygons for grass, which is nothing, I would expect such drop in far, far bigger number like 500k.Performance of vegetation system is very critical part for majority of games. And performance and stability (so far great) are two most important aspects of any game engine, the more performance I have, the better visual quality I can achive.

Link to comment

demostenes,

 

Information about your issue was sent to our lead technical artist. I believe he would be able to provide you some feedback on monday.

 

Great, thanks.

Link to comment
demostenes,

 

First of all, for mesh objects it is more efficient to use ObjectMeshClutter instead of ObjectWorldClutter, especially now that it supports collisions.

 

Optimal step for ObjectMeshClutter and ObjectGrass can be calculated this way: Maximum Visible Distance / 3-4. That's what our lead tech artist advised for optimal performance based on his experience. If the Step value is too small and the visible distance is very large, cells will be rendered too long, not to mention significantly increased render calls (DIPs) for ObjectGrass. If the Step value is too large, it would be taxing on your performance as well (there will be performance spikes due to the increased number of objects per cell). 3-4 coefficient will help you find the right balance.

 

For coordinates of ObjectMeshClutter and ObjectGrass to match, make sure that the following parameters are matching as well:

  1. Random seed

  2. Size

  3. Step (for ObjectGrass: Step/Subdivision)

For example: 

ObjectMeshClutter has the maximum visible distance of 100 units

ObjectGrass has the maximum visible distance of 3200 units

 

If coefficient = 4, then

Step for ObjectMeshClutter is 100/4 = 25;

Step for ObjectGrass = 3200/4 = 800;

Grass subdivision = 800/25 = 32 (max);

 

In attached file you can find simple example of performed calculations.

grass_mesh_parameters.zip

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks for tips, I will do implemenation and provide some feeback.

 

So:

 

Difference between world and mesh clutter is zero (3 world clutters with 1 tree vs 3 mesh clutters). Actually world clutter peformed cca 2% better (but this is within statistic tolerance). Practical difference is, that into world clutter I can load node, into mesh clutter I need to set mesh manualy again.

 

3x mesh clutter seems faster then 1x world clutter with 3 trees (hard to compare, trees are not on same positions, but seems faster)

 

In my real world scene step of 3 billboarded tree with constant 4 helped a lot (from step 40 and subdivison 2 to 200 and 10), there was huge performance gain.

 

In test case I provided you (based on my real world scene, same settings, only without textures, etc...) 3 billboared trees with constant 4 made no difference (from step 40 and subdivison 2 to 200 and 10), maybe it was even little bit slower (probably because of more visible grass triangles because of larger cell size). So conclusion is, that in my much heavier real world scene it helped to solve some bottleneck, but in light scene no difference.

Link to comment

Jiri,

 

The advice we gave you is specifically targeted for optimization of big scenes, when the project becomes CPU-bound.

 

Of course, if you have smaller/lighter scenes, that's a different workload (that's why we often mention that there is no universal approach, and all depends on the scene). Usually small scenes are not limited by CPU, while GPU takes some time to render all that's fed to it. What you can do when GPU-bound:

  • Decrease the fillrate by making leaves take the most of the billboard quad they are rendered on (the should be as few empty space on it, as possible). Plus making leaves smaller in size also helps.
  • The same goes for ObjectGrass texture. The lesser empty space is, the better.
  • Lessen the density of objects. For grass, you can try out the following approach: create 2 ObjectGrass instead of one (it's good both performance-wise and visually). The one that is closer to the camera is dense; the further one is sparse.
  • Decrease the number of rendered effects, disable AA, and so on. All of that allows for lesser load on the GPU = faster rendering.

Profiler is of much help when optimizing a scene, our artists extensively use it for monitoring what's the current bottleneck in a scene.

Link to comment

Thanks, I indeed know these basic tricks. Btw, for grass we are using visibility 4, with fade to 75, so it should be same as using two objects grass with different density?

 

Anyway problem is that it is not that good idea to optimize for the cost of visual quality (disabled AA in 2013 would be joke....). So far we are not limited by performance, but we will see when our scenes are closer to production quality with players and NPCs. Generally there is still space for improvement for speed of vegetation rendering (especially grass).

Link to comment

Thanks, I indeed know these basic tricks. Btw, for grass we are using visibility 4, with fade to 75, so it should be same as using two objects grass with different density?

Not quite. It's a bit different visual effect that our artists like better. Basically, more control over the density.

 

Anyway problem is that it is not that good idea to optimize for the cost of visual quality (disabled AA in 2013 would be joke....). So far we are not limited by performance, but we will see when our scenes are closer to production quality with players and NPCs. Generally there is still space for improvement for speed of vegetation rendering (especially grass).

Real-time rendering is always a compromise. Plus all depends on graphics cards you target. Valley, big as it is, with a lot of vegetation, runs even on integrated cards (not on the maximum quality, of course). So right now we do not plan to improve it; sometime in the future - surely will.
Link to comment
  • 3 weeks later...

Now it is possible to have up to 4 types of impostors rendered fast and efficiently (in one DIP) via a single ObjectGrass with grass_impostor_base assigned.

 

 

I am trying to set this up so one world clutter with 4 objects will be billboarded by one object grass with 4 merged bilboard textures, but without any success. Sample (samples/materials/impostor_03) is covering only setup of object grass (which is simple). How is this supposed to be done? I suppose that for 4x mesh clutter node it cant work, because of possible individual seeds, so world clutter is only solution? Is this supposed to work at all? Thanks.

 

PS: probablity for each channel in object grass does not seems to work. No diffrence in number of generated triangels no matter what number I put there (0.01-1).

Link to comment
  • 2 weeks later...

PS: probablity for each channel in object grass does not seems to work. No diffrence in number of generated triangels no matter what number I put there (0.01-1).

 

Probability does not change the number of rendered polygons (minor variations are possible, but it's more or less the same value). Other than that, it works.

post-13-0-85801600-1365147235_thumb.jpg

post-13-0-70622900-1365147245_thumb.jpg

Link to comment
×
×
  • Create New...