- Home /
How is IN.worldRefl calculated?
I want to know how the world reflection vector in shaders is calculated so that I can manipulate it, but there is no documentation on what it does or how Unity calculates it. How is the reflection vector calculated and exactly what does it do?
Answer by VLukianenko · Mar 27, 2018 at 08:53 AM
WorldReflectionVector(data,normal) reflect (data.worldRefl, half3(dot(data.internalSurfaceTtoW0,normal), dot(data.internalSurfaceTtoW1,normal), dot(data.internalSurfaceTtoW2,normal)))
That's a part that can be found in compiled shader code if you add #pragma debug
Sorry, that's not quite what' you've asked. Here's what can be found in Unity manual: https://docs.unity3d.com/$$anonymous$$anual/SL-VertexFragmentShaderExamples.html
half3 worldRefl = reflect(-worldViewDir, worldNormal);
Your answer
Follow this Question
Related Questions
How to I get a reflection on the floor and on other objects ? 0 Answers
Changing the reflection cubemap of all materials? 1 Answer
Shader.SetGlobal for properties that materials already have 0 Answers
Standard shader looks incorrect on mobile (weird colors) 1 Answer
Mirror reflecting another mirror ... 1 Answer