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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Projector additive broken in unity 5.0

Discussion in 'Shaders' started by TheOtherMonarch, Mar 19, 2015.

  1. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    796
    Projector additive is broken in unity 5.0

    From searching the web others people also seem to be affected by this as well. I don’t think it has been posted on this forum yet.



    The first pic is projector additive. The second pic is replaced with project multiple and a red texture. The lighting is fog of war.

    Code (csharp):
    1.  
    2. Shader "Projector/Additive No Fall Off" {
    3.   Properties {
    4.   _ProjTex ("Texture To Project", 2D) = "gray" { TexGen ObjectLinear }
    5.   }
    6.   Subshader {
    7.   Pass {
    8.   ZWrite Off
    9.   Fog {Mode Off}
    10.   Offset -1, -1
    11.  
    12.   AlphaTest Less 1
    13.   ColorMask RGB
    14.   Blend OneMinusSrcAlpha SrcAlpha
    15.   SetTexture [_ProjTex] {
    16.   combine texture, ONE - texture
    17.   Matrix [_Projector]
    18.   }
    19.   }
    20.   }
    21. }
    22.  
     
  2. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    687
  3. EdwinFoe

    EdwinFoe

    Joined:
    Apr 14, 2015
    Posts:
    3