Hi Everyone,
I am writing a surface shader which is supposed to reflect the world around it using the built in Unity Reflection Probes. I have the following code:
float3 reflectedDir = reflect(IN.viewDir, normalize(o.Normal));
fixed4 unityReflTex = (UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, reflectedDir));
fixed4 reflcol = (smoothstep(1 - (_RimThick*4), 1.0, dotProduct)) * unityReflTex ;
What do I need to do to the reflectedDir float3 in order to make it position the unityReflTex correctly? At the moment, it seems like the reflection is affected by the UVs of the object.
I could just use the worldRefl from the input, but this doesn’t bend with the normals of the object.
Thanks in advance!