Answers for "What kind of values come out of _WorldSpaceLightPos0?"http://answers.unity.com/questions/1311530/what-kind-of-values-come-out-of-worldspacelightpos.html
The latest answers for the question "What kind of values come out of _WorldSpaceLightPos0?"Answer by tcz8http://answers.unity.com/answers/1312498/view.html
Here is my own answer:
Since _WorldSpaceLightPos0 is a value being fed by Unity to the shader, you can inspect it's values by using the frame debugger.
Here is how:
1. Go to Window > Frame Debugger
2. Click ENABLE on the top left
3. Expand the Camera.Render all the way down to the "Draw Dynamic" entries
4. Select them one by one until you identify (by looking at the game view) the draw pass were you are using _WorldSpaceLightPos0
5. Once you found the right entry, click on "shader properties" in the right pane
That's it, _WorldSpaceLightPos0 and its values will be listed right there under "Vectors". You can dynamicly move and rotate your directional light and see the X,Y,Z values change in realtime.
In my case I realized I was using X where I should have been using the Z value... With that figured out, it was easy to fix my code. Damn you worldspace!
Please note that on a few occations, the values being shown in the frame debugger either stopped refreshing or showed values that stopped making sense. Closing and reopening (also maybe disabling/re enabling) the debugger fixes the problem.
Good luck and thanks for stopping by!Mon, 13 Feb 2017 04:18:44 GMTtcz8