Hi i am experimenting a bit with the Surface Shaders. I try to write a Transparent Reflective one, But i have a problem,
It works perfectly in things that they are close, but against the skybox and far objects it dissapears. Doesn't render.
am trying to tweek LOD with no success , ZWrite On and Off Cull Off ... it seems that I am missing something . It is my first time trying to write a shader so I think that I make a basic mistake. Any help ?
Shader "Myshaders/TransparentReflective" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_Cube ("Cubemap", CUBE) = "" {}
}
SubShader {
Tags {"RenderQueue"="transparent" "RenderType"="transparent" }
LOD 4000
ZWrite On
Cull Off
CGPROGRAM
#pragma surface surf Lambert alpha
struct Input {
float3 worldRefl;
float4 _Color;
};
samplerCUBE _Cube;
float4 _Color;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = _Color.rgb;
o.Emission = texCUBE (_Cube, IN.worldRefl).rgb*_Color.rgb;
o.Alpha = _Color.a;
}
ENDCG
}
FallBack "Transparent/Diffuse"
}