Home Unreal Engine

Shader Performance... overdraw?

polycounter lvl 10
Offline / Send Message
GlowingPotato polycounter lvl 10
Hi,

I'm doing a very simple test inside Unreal with some vegetation that I created for another engine, when pressing F5, Unreal shows the shader complexity for that given pixel, when I set the camera in a way that multiple leaves cover each other, the pixel shader complexity goes all the way to the left, almost to extremely bad. 

I believe that is because overdraw, am I right ? If yes, is there any optimization for this kind of "problem" ?



Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    This is normal and actually not THAT horrible on modern hardware. One way to optimize this a little bit, is to cut some edges around the opaque area, so in your case around the leaves, and then delete the unnecessary faces, so the alpha tested area is minimized. Also you could just use cylinders for the stems.
  • GlowingPotato
    Options
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    Obscura said:
    This is normal and actually not THAT horrible on modern hardware. One way to optimize this a little bit, is to cut some edges around the opaque area, so in your case around the leaves, and then delete the unnecessary faces, so the alpha tested area is minimized. Also you could just use cylinders for the stems.
    Hi Osbcura, thanks for your reply.

    I thought about adding more geo to minimize alpha test, but then, I also thought  about a big forest environment... what you think would be better, having more geo (way more geo per plant in this case) or let the shader do more alpha testing. 
    If we put geometry and alpha testing on a balance, which one would be heavier ?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Well. You can always do some stress tests, put it in the foliage painter, apply high density, and paint some. This was you can see how far does it go and how it would affect the performance in an intense scene. You can apply culling distance, and maybe an LOD material with 2 sided rendering disabled? You can also cheat some, with somehow making the player view distance relatively short, by putting mountains, elevations, turns, stuff like that. Also The trees trunks can cover some of the plants, so I'd imagine it being, again, not so horrible. About the polycount thing: depending on the size of the scene or the target platform/purpose of it, you can go pretty much crazy with the polygons nowadays. A few million triangles (actually more, depending on some things) should not have a visible affect on your performance. Then after some tests with framerate measurements, and some play with the foliage painter and its density, maybe LOD mesh too, you can figure out whats ideal for you. Adding those extra edges to the plant planes would only help in my opinion, and heavy shader complexity/overdraw is worse than polygons. 

    But... Huge dense fields with no culling, no trees etc would be problematic, there is no good and cheap solution for that.
  • GlowingPotato
    Options
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    Well, I'll consider doing this stress test like you said and post the results here.
    Thanks again.
Sign In or Register to comment.