Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Replacement Shaders and Tags

Discussion in 'Shaders' started by MaT227, Dec 6, 2014.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hey everyone,

    I have some difficulties about understanding how the SubShader Tags system works with Replacement Shaders.
    How can I limit the application of my Replacement Shaders to some objects with specific shaders.

    Thanks a lot.
     
  2. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369
    When you use RenderWithShader(blueShader, "SomeRenderType")

    and if your shader has this line
    .....
    { "RenderType"="SomeRenderType" ..... }
    ....


    Then all the objects that use RenderType=SomeRenderType get rendered (replaced) with blueShader when calling RenderWithShader.
     
  3. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Thanks a lot for your explanations.