Panner materials become jumpy and pixelized on mobile

Hi guys.

When testing on a phone, I found that any material that involves a panner (like the default sky sphere) suffers a low frame rate within minutes of running. The material follows the correct panning speed but updates only few times a second. And its texture also gradually loses details and ends up pixelized. All other materials with stationary textures look just fine and the overall FPS of the game doesn’t drop at all.

I tried on two different android phones and the results are the same. Will this be fixed in future releases?

Thank you.

What you are seeing is high cost and low precision within the pixel shader on the mobile device. The solution is to use customUVs to calculate the panning. So click your base material node and find the field where it specifies number of customized UVs. Make it at least 2. Put your panner nodes into the UV2 input node.

Then place a regular texture coordinate node set to index 1. If there is something hooked up to CUV1, it will overwrite the UV1 node with the vertex shader calculation. The UV1 node should have tiling options at default. Vertex shader way faster (less verts than pixels usually) and has better precision too. Then just use that regular UV1 node for your panning texture.

Try doing a search for custom UVs the doc page on them is pretty thorough. I’d find it but I’m on ipad on vacation going from memory :slight_smile:

1 Like

Thank you Ryan It works. I think the indices should be sorted a bit to prevent confusion:

When you specify 2 custom UVs, you get the input nodes CUV0 and CUV1. Plug the panner nodes into CUV0 and a regular TexCoord into CUV1.

Right? :slight_smile:

I’m not sure I understand the question. CUV0 and CUV1 are named inputs, and they are already correct, no need to sort them.

If you only add 1 customUV input, that will be CUV0. If you add another, that one will be CUV1 and so on. CUV0 would be referenced in the pixelshader by using a texturecoordinate node that has index to 0. Get it? Index 0 grabs CUV0. Index 1 would grab CUV1 if there is one.

It doesn’t matter which one you use as long as you are consistent. I would normally put a panner in CUV1 so that CUV0 is blank, so there can still be non-panning alpha masks used. If everything in your material uses the same panner then by all means simply use CUV0 and then you will essentially be erasing your base UVs.