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

Unity 5 - Shader( matrix [_Projector] ) SOLVED

Discussion in 'Shaders' started by PCmaniak, Apr 21, 2015.

  1. PCmaniak

    PCmaniak

    Joined:
    Mar 26, 2014
    Posts:
    6
    Hello to the projection texture I used this shader that I found on the internet ...
    It worked well.. but with the advent Unity5 is the function matrix [_projector] does not work = (

    Can anyone help me fix this shader? Thanks ;)

    Shader "Projector/Texture"
    {
    Properties
    {
    _Color ("Main Color", Color) = (1,1,1,1)
    _ShadowTex ("Cookie", 2D) = "gray" {}
    }

    Subshader
    {
    Tags { "RenderType" = "Transparent" "Queue" = "Transparent-1" }
    Pass
    {

    ZWrite Off
    Lighting Off
    Fog { Color (0, 0, 0, 0) }
    ColorMask RGB
    Blend SrcAlpha OneMinusSrcAlpha
    Offset -1, -1
    Color [_Color]

    SetTexture [_ShadowTex]
    {
    combine texture * primary
    Matrix [_Projector]
    }
    }
    }
    }
     

    Attached Files:

  2. PCmaniak

    PCmaniak

    Joined:
    Mar 26, 2014
    Posts:
    6
    nobody ? :-/
     
  3. mholub

    mholub

    Joined:
    Oct 3, 2012
    Posts:
    123
    I don't have Unity4 to test how it should work.
    Is it what you need?
     

    Attached Files:

    PCmaniak likes this.
  4. PCmaniak

    PCmaniak

    Joined:
    Mar 26, 2014
    Posts:
    6
    aaa THANKS YOU! works perfectly! =)
     
  5. xuanyuan

    xuanyuan

    Joined:
    Jul 14, 2015
    Posts:
    1
    Shader "Hidden/PreviewT4M"
    {
    Properties
    {
    _Transp ("Transparency", Range(0,1)) = 1
    _MainTex ("Texture", 2D) = "" { }
    _MaskTex ("Mask (RGB) Trans (A)", 2D) = "" { TexGen ObjectLinear }
    }
    SubShader
    {
    Pass
    {
    Blend SrcAlpha OneMinusSrcAlpha
    SetTexture [_MainTex]
    SetTexture [_MaskTex]
    {
    constantColor (1,1,1,[_Transp])
    combine previous ,
    texture* constant
    Matrix [_Projector]
    }
    }
    }
    }

    The shader does not work!Could you help me to modify it?