I’m having problems getting projectors to work in 5. All of the projector shaders I have, now come back with errors along the lines of:-
Shader warning in ‘Projector/Basic’: Fixed function texture matrix ‘_ProjectorClip’ used; they don’t do anything now at line 22
Needless to say, they also don’t work. Has something changed in the way we are supposed to use projectors, or are there any examples of using projectors with 5?
Same issue here. There’s no projector shaders that come with Unity 5 (at least from what I’ve checked) and projectors are completely useless without them. Sadly unity 5 is still a long ways away from being issue free.
That’s cool, as long as I’ve not missed something obvious (wouldn’t be the first time XD) Seems that projectors are not ready in 5 yet.
Have you guy’s submitted a bug report for this?
I’m having the same problem with projector shaders, nothing but “Shader warning” messages (example shader included below - give me a shader warning for the “Matrix [_Projector]” line). Any updates on that? I’m unable to find any bug reported with the id number quoted above…
Shader "Anamorph" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "" { TexGen ObjectLinear }
}
Subshader {
ZWrite on
Fog { Color (0, 0, 0) }
Cull off
Color [_Color]
ColorMask RGB
Blend OneMinusSrcAlpha SrcAlpha
Offset -1, -1
Pass {
SetTexture [_MainTex] {
combine texture * primary, ONE - texture
Matrix [_Projector]
}
}
}
}
Now that I finally got a Unity 5 license for free to upgrade my Asset Store products (how awesome from the Unity guys!), I have encountered the same problem. I really hope that it is a bug in Shader Lab and will be supported again, simply because now you need the double amount of code to create the same. Here is the code of my shader you still see the old code commented out in the bottom. According to my testing “_Projector” works only inside a CGPROGRAM in Unity 5.
Shader "Hidden/LE_Brush"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Brush", 2D) = "white" {}
}
Subshader
{
// UNITY 4 & 5
Tags {"Queue"="Transparent"}
Pass
{
ZWrite Off
Fog { Color (0, 0, 0) }
ColorMask RGB
Blend SrcAlpha One
Offset -1, -1
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct v2f
{
float4 uv : TEXCOORD0;
float4 pos : SV_POSITION;
};
float4x4 _Projector;
fixed4 _Color;
v2f vert (float4 vertex : POSITION)
{
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, vertex);
o.uv = mul (_Projector, vertex);
return o;
}
sampler2D _MainTex;
fixed4 frag (v2f i) : SV_Target
{
fixed4 texS = tex2Dproj (_MainTex, UNITY_PROJ_COORD(i.uv));
return texS * _Color;
}
ENDCG
}
// UNITY 4
// Pass
// {
// ZWrite off
// Fog { Color (0, 0, 0) }
// Color [_Color]
// ColorMask RGB
// Blend SrcAlpha One
// Offset -1, -1
// SetTexture [_MainTex]
// {
// combine texture * primary, texture * primary
// Matrix [_Projector]
// }
// }
}
}
@StevanJay : your shader looks very similar you might use my code and change it a little