EDIT: Solved! The “alpha” of the pragma surface statement does some preset blendind for alpha shaders in the compiled shader…
I have modified a transparent shader to include some reflection (it’s a special shader for a special purpose, under developement) but the blending property within the shaderLab section has NO effect what so ever. No matter what I write there (even some outragous stuff (but correct syntax)), the shader looks exactly the same. I have not really gotten totally friendly with the new surface shaders, even though I’m getting there. But this is just strange. What could the problem be?
I have ofcourse tried to comment out the fallback shader (even though I would notice the lack of reflection, if it really fell back to that)
Shader "Transparent/Reflective" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
_Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Blend OneMinusSrcAlpha OneMinusDstAlpha
Lighting Off
LOD 200
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
samplerCUBE _Cube;
float4 _Color;
float4 _ReflectColor;
struct Input {
float2 uv_MainTex;
float3 worldRefl;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
half4 reflcol = texCUBE (_Cube, IN.worldRefl);
reflcol*=_ReflectColor;
o.Albedo = c*_Color;
o.Emission = o.Albedo*(reflcol.rgb);
o.Alpha = _Color.a;
}
ENDCG
}
Fallback "Transparent/VertexLit"
}