Blending property has no effect on my shader

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"
}

is there anything it can blend with at all? (transparent and behind the surface with this by its 0,0,0 point)?

also the blend factor set there doesn’t make sense commonly.

Hehe, it’s funny how you try and try stuff, and as soon as you write it in here, you read through the code again, and wonder if the “alpha” in the #pragma surface surf has some over writing effect to the blending option. As soon as I remove that, I get some effect on my choice of blending :slight_smile:
Need to read some more on the docs…

I know it doesn’t make sense, but as said, no matter what I wrote, it didn’t change anything. So this is just a version where I wrote something… :stuck_out_tongue: But read my newest post, I solved it.

hehe yeah yeah the curse of “getting nuts and yelling” … the solution to most problems :wink: