iOS rendering bug? Calculated normals "degrade" over time.

I found this bug deploying to an Air or 4.1 running iOS 8.3. I was running version 4.9.2 of the binary editor release from the Launcher. It also occurred in Engine 4.8.

Steps to reproduce:
Create a default map in a new project (No content is needed)

Re-Create this sine wave material:

Apply the new material to the floor of the default map like this.

Build/Package and deploy the project to the ios device, I used an Air (Called the 4.1 in the iPhonePackager program). If you are running the default game mode you should be able to fly around and look at the sine wave.
The calculated normals seem to degrade in quality over time.
They start off smooth enough.

But after about 30 seconds…

Until this happens…

The same material does not do this in the mobile previewer or running in editor on the P.C.
Any ideas?
TeamKingdom

This is probably due to the fact that the floating point depth on mobile is can be less than on desktop. As the ‘time’ variable increases over time, it starts losing precision the further away from 0.0 it gets (floating point becomes less precise the further from 0.0 you get, broadly speaking). So your calculations based on the ‘time’ number become more and more quantized. UE4 resets the ‘time’ node’s value automatically every once in a while, but I suppose it isn’t enough in this case for the type of calculation you are doing.

You can get around this yourself by writing code or Blueprint that uses a manually updated material parameter instead of the automatic ‘time’ one that UE4’s material editor comes with. Just make a new float material parameter, and update its value from a Blueprint Tick event by adding the delta time to it. When the accumulated value gets above pi, just subtract pi from it again so that it wraps back around (assuming you are only interested in making the animation wrap correctly with sin/cos based calculations). You could also instead use fmod to wrap it, if you know how that works.

Great answer thank you.
I tried the material parameter/delta time reset but the reset was too twitchy to control. I went with Fmod because it was easier to tune and didn’t require the blueprint update.
Thanks again.

Thanks!
I had the same problem, using the “time” node to “flicker” some light textures.
They would flicker fine for about a minute and then start to quantize and eventually stop flickering.

Another potential solution would be to put all of your calculations into custom UV Channels. Currently your calculations are going through the pixel shader which is less accurate on mobile and will “degrade” over time. The custom UV channels on the other hand use the vertex shader which is much more precise and efficient on mobile devices.

Here’s is a related post concerning calculation accuracy and pixelization when using the pixel shader for UV manipulation:

And here’s the official documentation on Customized UVs and why they are useful: