hi, im trying to create a reflective shader that won't be affected by the alpha channel, meaning, it would react the same on the whole model...im having some difficulties in mixing some of the basic unity shaders to create that effect... heres what i got so far: Code (csharp): Shader "Custom/ReflectiveTeam" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _BumpMap ("Bumpmap", 2D) = "bump" {} _Cube ("Cubemap", CUBE) = "" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM #pragma surface surf Lambert sampler2D _MainTex; sampler2D _BumpMap; samplerCUBE _Cube; struct Input { float2 uv_MainTex; float2 uv_BumpMap; float3 worldRefl; }; void surf (Input IN, inout SurfaceOutput o) { half4 c = tex2D (_MainTex, IN.uv_MainTex); o.Albedo = c.rgb; o.Alpha = c.a; o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap)); o.Emission = texCUBE (_Cube, IN.worldRefl).rgb; } ENDCG } FallBack "Diffuse" } i just get tons of errors about missing stuff and things that are compiled for directx11 and so on... can anyone help me a bit?
You're missing the following on line 21: Code (csharp): float3 worldRefl; INTERNAL_DATA The INTERNAL_DATA macro is required whenever you're adding these elements and writing to o.Normal.
that actually solved all the issues thanks but the model glows very brightly in some areas and in some less, is there a way to stabilize this? and the color sections also seems to have disappeared