I try to create a atmosphere around a sphere. The reason why i want to master this challenge is because it affects several points that i want to learn in three.js. here is the link to my github repository:
I created my own post-processing shader and included a raymarcher (viewDir). the raymarcher runs through all pixels in uv coordinates and when the raymarcher beam touches or penetrates the sphere inside the shader, the raySphere function returns how long the path from the viewOrigin (shader camera) to the surface of the sphere is and how long the path through the sphere is.
the goal is that the sphere in the postprocessing shader always overlaps exactly with the sphere of the scene.