I am using Babylon.js to build a space scene, and have been successful so far in using a pre-rendered skybox texture full of stars, nebulae, etc. I am interested in generating this dynamically using a shader, if possible.
As an experiment in Create Your Own Shader (CYOS), I have rendered a basic shader onto a cube mesh. However, I am using what appear to be the global coordinates of gl_FragCoord, which means that no matter how I turn the cube (or rotate the camera, not sure which is happening), the shader remains static to the perspective of the camera and does not transform with the cube, if that makes sense.
With my ultimate goal in mind, what coordinates should I be using to transform the shader as the perspective changes? Happy to provide the CYOS zip file or share via another means if you’d like.
Thanks for your help!