- Home /
Question by
user-12247 (google) · May 01, 2011 at 09:18 AM ·
shadertransparentreflective
Transparent Reflective
I found similar questions answered already, however what I like to implement is a little bit different.I want to create a transparent reflective shader where I can control the transparency + reflection with a texture (instead of a color value) Here's my shader,
Shader "myshader" { Properties { _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} _Cube ("Cubemap", CUBE) = "" {} } SubShader { Tags {"Queue"="transparent" "RenderType"="transparent" }
Cull Off
CGPROGRAM
#pragma surface surf Lambert alpha
struct Input
{
float3 worldRefl;
float4 _MainTex;
};
samplerCUBE _Cube;
float4 _MainTex;
void surf (Input IN, inout SurfaceOutput o) {
o.Albedo = _MainTex.rgb;
o.Emission = texCUBE (_Cube, IN.worldRefl).rgb*_MainTex.a;
o.Alpha = _MainTex.a;
}
ENDCG
} FallBack "Transparent/Diffuse"
}
which isn't working, no error messages though
ANY help greatly appreciated, Thank You!
Comment