- Home /
How to remove TexGen from this shader?
I'm trying to migrate my project to Unity 5 but since dev team removed some shader syntax my old projector shader does not work anymore. I'm using this plugin from asset store for unit selection
https://www.assetstore.unity3d.com/en/#!/content/11689
However the shader no longer works in Unity 5. I have zero knowledge about shaders and I don't feel like learning it at this moment, I just want to migrate the project. Can someone help me to "translate" this shader so it works in Unity 5? Here's the source
Shader "Projector/Additive" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
_FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear }
}
Subshader {
Tags { "RenderType"="Transparent-1" }
Pass {
ZWrite Off
AlphaTest Greater 0
Offset -1, -1
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
Color [_Color]
SetTexture [_ShadowTex] {
constantColor [_Color]
combine texture * constant
Matrix [_Projector]
}
SetTexture [_FalloffTex] {
constantColor (0,0,0,0)
combine previous lerp (texture) constant
Matrix [_ProjectorClip]
}
}
}
}
Unity editor gives me these warnings:
Fixed function TexGen used; it doesn't do anything now
Fixed function TexGen used; it doesn't do anything now
Fixed function texture matrix '_Projector' used; they don't do anything now
Fixed function texture matrix '_ProjectorClip' used; they don't do anything now
Your answer
Follow this Question
Related Questions
How to force the compilation of a shader in Unity? 5 Answers
Shader not working correctly on android 1 Answer
LineRenderer not showing in certain angles 1 Answer
How can I ToonLitOutline shader transparent? 0 Answers
Material Animation from -1 to 1 0 Answers