Search Unity

Lightmap UV switched to half4 precision after Static Batch

Discussion in 'Shaders' started by sgoncharme, Aug 3, 2019.

  1. sgoncharme

    sgoncharme

    Joined:
    Apr 16, 2017
    Posts:
    2
    Hello everyone!
    Got an issue with lightmaps. It looks like there is a difference in precision between Standard Shader and Surface Shader lightmaps. I use Unity3D 2018.4.5 with only Metal iOS target.

    I've spent some time profiling shaders with Xcode and found that lightmap UVs are half4 for Standard Shader and float4 for Surface Shader in result Metal shaders. How can I influence that variable type?

    I see this difference because I change shaders on a mesh in my game and I see a little UV offset for lightmaps.

    I've tried to disable "Optimized Mesh" in Player Settings but I still get the same result.

    Thank you!
     
    Last edited: Aug 3, 2019