- Home /
What happens between Light transfrom rotation and _WorldSpaceLightPos0?
So I'm working on a procedural skybox shader which is basically a customization of the one I found here:
This one uses a custom vector for the sun direction, where I pass in the normalized worldspace rotation of my directional light (directionalLight.transform.rotation.eulerAngles.normalized). I'm on forward rendering here.
However if I use the built-in variable _WorldSpaceLightPos0 I get a different result. There seems to be an offset and sometimes axes appear to be flipped.
So what is it that Unity does internally with the rotation of my directional light to calculate the _WorldSpaceLightPos0? And how do I get my light direction vector and the _WorldSpaceLightPos0 to match.
Appreciate any help.
Your answer
Follow this Question
Related Questions
Reflective sphere for HDRI 0 Answers
Skybox reflections stopped working. 0 Answers
Help with making a water shader receive light 1 Answer
Shader-Calculate lighting every x pixels 0 Answers
Shining light for mobile? 1 Answer