I would like to simulate a moving sun on the sky. What I have managed to do so far is calculating the exact location of the sun, that is the 3D direction vector from the camera's position in the world to the sun. The sky is the cube with 6 faces textured with some cube map texture. The skybox positon is constantly being set to the position of the camera, so that the camera is always in the cube's center.
Now, I have a simple 2D texture of the sun that I would like to render onto the cube map texture using the aforementioned direction vector. Could you please describe how I can achieve this? My reasoning is that I need to bind the framebuffer of the cube map and then render the sun mesh with the correct sun texture. But how do I specify the position of the sun here so that it matches the direction vector I have calculated earlier? Another question is if there might be problem when it happens that part of the sun is supposed to be rendered on one face of the cube texture and the other part on some other face of the cube texture?
Thank you in advance.