Where do you optimize toon shaders for mobile performance without fps drops?
#1
So I’ve been trying to get better at writing shaders, and I finally got a simple toon shader working in my project. The problem is, it completely tanks my frame rate on mobile, even though it looks fine on my PC. I’m not sure if it’s my shader code that’s inefficient, or if I’m just asking too much from the hardware. I’m wondering if anyone else has hit this specific wall when trying to make stylized graphics run smoothly on less powerful devices.
Reply
#2
Oof mobile hardware and toon shaders can be brutal. It looks great on PC but the frame rate drops fast on phones. I get the frustration when a look you like costs you performance.
Reply
#3
From a shader math view the issue often hides in branches and texture fetches. Mobile GPUs hate unpredictable branches and many phones prefer simple math. The toon look can be built with a fixed threshold using step and clamp instead of dynamic branching.
Reply
#4
Maybe you are over thinking the toon effect. It could be that the engine passes overdraw or post processing on mobile more than the shader itself. A clean forward pass with minimal post effects might help.
Reply
#5
Maybe the framing itself is off. You may not need a water tight mobile friendly toon shader. Some devices love bold flat shading while others want a softer look. You could frame the task as designing hardware aware stylization rather than a single shader.
Reply
#6
I am not sure this is a wall you can just fix with one tweak. The mobile pipeline is full of gotchas. The shader could be fine and the issue may be texture sizes or how you sample textures.
Reply
#7
Looking at it as a craft problem I would pick a style that survives the lowest frame rate. The shader is a character with a budget not a weapon. The style belongs to the device pace not just the art direction.
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: