Search Unity

GlobalFog overwrites Toony/BasicOutline outline shader -- outlines become white

Discussion in 'Shaders' started by Charles-Van-Norman, Oct 7, 2015.

  1. Charles-Van-Norman

    Charles-Van-Norman

    Joined:
    Aug 10, 2010
    Posts:
    86
    Hello,

    GlobalFog causes my outlines to turn white, even though fog is "behind" the outline (img: http://imgur.com/crPaYsy)

    I found solutions to global fog transparency issues as follows, but none solve my issue:

    --Setting the depth of the outline shader above the fog shader using {"Queue"="Background" or "Queue"="Overlay"}

    --Adding "#pragma multi_compile_fog to the shader which was recommended by Unity5's shader upgrade manual

    --Adding "@ImageEffectOpaque" to the OnRender function in GlobalFog.js

    --ZWrite is on in the outline shader (Toony/BasicOutline")

    Nothing works! It seems the fog from GlobalFog is always drawn over the outline, no matter how far away the outline is.

    How can I force the fog to respect the z-distance of the outline?
     
    Last edited: Oct 7, 2015