I have been thinking about a skybox idea for a while and wanted to create a proof of concept in Unity but I sadly don't know where to start.
my idea is to have an array of points which are stars in the night sky. in this concept the stars are far enough to not need to be in the scene but close enough where parallax is something I want to think about instead of using a static texture.
to accomplish this, I would like to draw onto a cubemap where I can use the direction from the player to the pixel on the cubemap and the direction from the player to the star in a dot product. if the dot product falls within a certain margin it should draw the star on that pixel.
(ofc this would require optimization after the proof of concept but I first want to get this to work xD)
sadly I think this isn't possible in Shadergraph which is about the extend of my knowledge on shaders.
I was hoping if someone could point me in the right direction to get started on this shader.
mainly my questions are:
- what kind of shader do I use? compute shader, unlit shader, etc.
- how do I get the direction from the player to the cubemap pixel that is currently being calculated?
- how do I get my list of star positions into the shader?
any tips on optimizing are also welcome since in this idea, every pixel would check every single point. rn my only idea is to use positive and negative directions of the ray to narrow down to 1/8th of the sky
