Hi, this is my first post here, and I hope i am on the right place to ask this kind of question.
A short story:
How do I input (other) object’s world position into cycles node editor ? Or rotation, it can be heplful too.
A long story:
I am trying to render earth with 2 textures: one for day and one for night (city lights). I’ve tried to use shadow light paths and other stuff like that for blending factor, but without success. So I came with pretty basic mathematical idea: take the dot product of normalized light position relative to the object that is being lighted and normal of the surface, which gives me expected result. My problem is that I have to put manually light’s direction. But my Earth won’t be stationary, it will rotate and move along eclipse, so I can’t take the static position of lamp (in case in picture, sun’s position is 5,5,5, marked in red square). Does anybody have any idea how to do this ?
Or does someone have different approch for this problem then me ?
And for simplicity sake, in picture, let the blue shader represent daytime texture and green one nighttime texture.
Thanks.