Search Unity

iPhone 5 has missing vertices when setting Standard shader maximumLod below 150

Discussion in 'General Graphics' started by trooper, Sep 14, 2019.

  1. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    748
    Using an iPhone 5 (OpenGL 2.0) built from 2018.4.7f1 I am getting very strange results if I set the maximumLOD on the Standard shader below 300.

    I'm attempting to use the maximumLod to force Standard shader to use VertexLit fallback for older devices.

    This video demonstrates me switching back and forth between shader lods doing the following:



    Code (CSharp):
    1.  
    2. Shader.Find("Standard").maximumLOD = lod;
    3. Shader.Find("Standard (Specular setup)").maximumLOD = lod;
    4.  
    Wheels = Standard
    Rims = Standard (Specular setup)
    Body = Custom surface shader

    Best = 300
    High = 250
    Medium = 150
    Low = 125
    Lowest = 100


    Specific Issues:
    1. When I set the lod to 250 the wheels are no longer rendering but the rims continue to render.
    2. When I set the lod to 125 the screen flips and zooms in, it seems related to the projector I'm currently rendering to the ground which uses a rendertexture and camera to produce the shadow outline.
    3. Turning off the shadow (removes rendertexture, camera and projector), and switching to lod 125 or below (trying to get vertex lighting to take over) will cause some vertices to stop rendering and the performance will drop severely but the flip no longer happens.

    What we've found so far:
    • Creating a custom surface shader to replace standard seems to fix the issue for at least the vertices not rendering correctly