Hi,
i have rewritten the MirrorReflection2 shader as a surface shader, but i can’t figure out how to add bumpmap distortion to the reflection…
Here’s my surface code so far:
void surf (Input IN, inout SurfaceOutput o) {
fixed2 screenUV = (IN.screenPos.xy) / (IN.screenPos.w);
fixed3 nor = UnpackNormal (tex2D(_BumpMap, IN.uv_BumpMap));
fixed4 tex = tex2D (_MainTex, IN.uv_MainTex);
fixed4 refl = tex2D (_ReflectionTex, screenUV);
o.Albedo = tex.rgb *_Color.rgb;
o.Normal = nor.rgb;
o.Emission = refl.rgb;
}
i think i should use something like WorldReflectionVector to get the normals and then apply reflections, but i hane no idea how to do this in a surface shader… any idea?