Jump to content

Performance from the foliage system


Andy90
 Share

Go to solution Solved by Josh,

Recommended Posts

Hello, according to the discord i post here also an bug report. I got the feeling that there is an issue with the foliage system at the moment. If you create an scene with just grass and tree's the frames drops arround 90 fps. I attached an map wich is using the nature dlc stuff so you can test it for yourself.

 

 

test.zip

Link to comment
Share on other sites

I think the primary bottleneck in this scene is shadow rendering. There are two ways to adjust this:

  1. Disable shadows on the grass mesh layer.
  2. Decrease the shadowmap resolution. There is currently no command to do this, but I plan to implement one.
  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

By disabling grass shadows, decreasing the grass range, and setting the shadowmap size to 512 I got the framerate up to 280 on an AMD 6600.

Something like this is probably what you would want to medium-low settings.

image.thumb.jpeg.e33c9a093cd80e845a53a966d6ba8954.jpeg

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Some maybe related links for further research:
https://forums.ogre3d.org/viewtopic.php?t=45389
https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=ef95d232b78146cc16e6212cc062fb622136f3f3

Quote

It is therefore recommended to render all alpha test, texkill or alpha to coverage primitives after opaque primitives in order to increase the chances of those being rejected by HiZ. This includes the rendering of a Pre-Z pass.

This is interesting, but in this scene I don't think it would make any difference.

Quote

If you’re using alpha test for foliage or similar and the shading is sufficiently advanced it may be beneficial to do a Pre-Z pass with the alpha test, then the main shading pass with depth writes disabled. On the X1xxx series the best method for the second pass would be to use a depth test of EQUAL, whereas on earlier hardware it would probably be better to repeat the alpha test in the second pass but stick to LESSEQUAL for the depth test.

This is exactly what Ultra already does, except I saw no difference when the alpha discard is eliminated in the second pass.

Quote

It easily happens that depth writes are left on for some rendering where this is not required, for instance in multi-pass rendering or after a Pre-Z pass. In many cases this has little impact on performance since the hardware optimizes away redundant depth writes anyway, but there are situations where this could still hurt performance, for instance updating the depth buffer when the resulting depths are never going to be read, like when rendering a transparent HUD at the end of the frame.

Might be worth testing, if I am not already doing this.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

6 hours ago, Josh said:

Something else I randomly came across from Epic:

image.thumb.jpeg.b9950578259e040075426d1ff0605a8e.jpeg

This is half the reason why I want to make grass that is pure geometry and does not discard pixels.  It seems counter intuitive but in some cases it seems that having more triangles is better than using billboards.

AnimatedGrass.gif.99a26b8f54b7a10300614523aa704683.gif

Link to comment
Share on other sites

One thing to consider when creating models in the future is that a leaf planes that uses more polygons in order to more closely conform to the bounds of the solid pixels in the texture will probably render faster than a simple rectangle. You are increasing the vertex count, which is fairly low-cost, and decreasing the pixel count, which is fairly expensive.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Solution

Default directional light shadow map resolution is changed to 1024x1024 per stage in the first build of 0.9.7. I believe this solves the major bottleneck.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...