Search Unity

BUGGY, unintentional flickering light on material when hit with spotlight

Discussion in 'Shaders' started by GooGooDaddy, May 1, 2017.

  1. GooGooDaddy

    GooGooDaddy

    Joined:
    Nov 30, 2013
    Posts:
    2
    BUGGY, unintentional flickering light on material when hit with spotlight.

    I am using the "Transparent/Diffuse ZWrite" shader pulled verbatim from the current Unity docs which worked perfectly for fading out objects between the player and the camera until I upgraded to Unity 5.6.

    Ever since I upgraded to v5.6, I get constant light flickering on my object's once GI is baked (with AO), when fully opaque - it is an constant flicker. I have tried everything I can think of to eliminate this with zero resolution - any ideas?

    Shader code:
    (pulled from https://docs.unity3d.com/Manual/SL-CullAndDepth.html)

    Shader "Transparent/Diffuse ZWrite" {
    Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    }
    SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 200

    // extra pass that renders to depth buffer only
    Pass {
    ZWrite On
    ColorMask 0
    }

    // paste in forward rendering passes from Transparent/Diffuse
    UsePass "Transparent/Diffuse/FORWARD"
    }
    Fallback "Transparent/VertexLit"
    }