Search Unity

Shader's Queue=Geometry-100 not working

Discussion in 'Shaders' started by brc51, Oct 14, 2017.

  1. brc51

    brc51

    Joined:
    Feb 14, 2015
    Posts:
    4
    I have trying to set a RenderQueue of a background object (used in stenciliing operation). In the shader tags, I have:
    Tags
    {
    "RenderType"="Opaque"
    "Queue"="Geometry-100"
    "ForceNoShadowCasting"="True"
    }

    But the object, in play mode, is 2003. Whenever I set the objects/material/shader settings (in the editor) to "From Shader", the RenderQueue correctly resets to the Shader's Queue setting (2000-100=1900). I have saved the object with the "From Shader" setting in the editor, but the object seems to lose that setting and reverts back to "Geometry" upon playmode.

    I have attempted to set the renderqueue in code-behind as well. The code properly runs (no exceptions) but the object's renderqueue still goes to 2003. Code:
    renderer.material.renderQueue = 1900;

    What am I doing wrong??? (and thanks in advance!)