I’ve been working on a shader for a real-time rendering project, but I’m struggling with performance optimization. The shader looks great, but it causes a noticeable drop in FPS, especially on lower-end GPUs.
I’m mainly using HLSL and working within Unreal Engine. Are there any best practices for reducing shader complexity while maintaining visual quality? Any tips on debugging performance bottlenecks?
(admin edit: removing stealth-edit spam, and banning OP)
Replies
I seem to recall some Unreal docu about shader perf, have you searched? It might be specifically for mobile.
https://www.linkedin.com/posts/wojciech-sterna-193a7b44_here-is-how-in-unreal-engine-5-i-profile-activity-7307698546730786816-Z9oA
Many materials just need a monochromatic albedo, tinted a color, so you can compress to the red channel, and pack other maps in with it.
It's better to pack materials into less textures, rather than a bunch of single channel textures ect. Some things don't need to be very high resolution to work, and you can use techniques to make things appear sharper.
there is also the potential for branching to cause the gpu to stall while doing on demand shader compilation - not sure how bad the issue is on current unreal versions though.
A single fragment shader on a surface would have to try pretty hard to cause a noticeable drop in frames though. how bad is it ?