Download

Why does this Mobile Material disregard half of the nodes?

I can’t wrap my head around this. This only occurs when I deploy to a device.

I’ve been trying to figure out why the Sun Disc doesn’t draw on any mobile device when deployed, starting by building a super-simplified sky material. Ultimately, this is what my sky material will actually look like in the end anyway. This is the entire setup of the material.

dbeb8e59ceeebab90d72d7d43e815f7ac77b98b7.jpeg

Now, on PC, Mobile preview and everything else the sun ‘disc’ draws absolutely fine. However as soon as I deploy to an actual device, it disappears. It’s like the nodes aren’t even there or it compiles differently. I’ve tried every compression type my device supports.

This works, the sun disc actually draws so long as I have no texture plugged in:
34e980a2927e1bfc4b546219804f19487348197c.jpeg

And this works:
thisworks.JPG

But together they don’t. No compile errors, material is fully rough and unlit. I also have mobile HDR and bloom enabled in project settings.

All I can think of doing right now is having two sky-domes, one with just the sun on it, the other with the texture. But that seems like a ridiculous workaround… no documentation on this!

Okay so, I’ve literally tried splitting the texture and the sun up into different meshes and materials now. It STILL doesn’t draw the sun! If there is a texture in the scene at all, the sun doesn’t draw. How does this make any sense whatsoever?

Okay so it seems this could be related to the tiny value I’m using for the sphere mask. Perhaps the value is too small and Android is clamping it to zero? (value is 0.0003). Is there anyway I can force full-precision on mobile shaders?

EDIT: Yep definitely a precision problem. Any value too small will just get zeroed it seems, which also explains why some of my other shaders render badly on mobile. Is there any ability to force full-precision regardless of device?

EDIT #2: This should really be in the documentation somewhere! It’s the only reason the sun disc doesn’t draw in the default engine sky materials.