Putting object on directional vector from world origin to sun/sky bloom at distance from origin

What I currently have is a sun/sky directional light that changes direction to make a nice day/night cycle. I pass the directional vector into a material parameter vector and do neat things with it. I understand that the directional light is light coming from that direction BUT what I’d love to be able to find is a point at some large distance I set along the vector between the world origin and the light bloom that looks like the sun. I want to use a depth from world position offset, that needs a position, I want to have my moon sphere object orbit opposite the sun (I know that’s not what the real world moon does, but mine needs to), etc and a growing list of other things that require an object that is where that bloom is. How do I put an object on that line?

Direction lights have no origin so the speak of. Their rays are all parallel.

You could just get the orientation of the direct light and get it’s forward vector then multiply that with a float to get a distance along the sun’s axis. Add this to a vector that is the location (can be origin) to get an offset towards the sun from an x,y,z point.

1 Like

That worked really nicely.

You also have to invert all values, or it will point to the shadow of the object: