0

I'm working on atmospheric shader based on glsl-atmosphere (https://github.com/wwwtyro/glsl-atmosphere) using three.js

First I just applied this shaders to a sphere and I got very good results :)

The original shaders didn't had sun drawing elements, so I just made it by using

float spot = smoothstep(0.0, 1000.0, pMie)*10.0;

and then added this part into the return statement:

return iSun * (spot*totalMie+pRlh * kRlh * totalRlh + pMie * kMie * totalMie);

enter image description here

It looks good from this angle, but when it it near the border of the screen: enter image description here

It becomes an ellipsoid...

What can I do to fix it?

BDL
  • 21,052
  • 22
  • 49
  • 55
proggamer12
  • 192
  • 10
  • 1
    to answer your question we would need to analyze the shader you linked which I doubt anyone would do... I am using different approach see [my GLSL Atmospheric scattering](https://stackoverflow.com/a/19659648/2521214). I basically test if camera ray is intersecting the Suns Disc (I support up to 3 local stars) And if yes I set the color and intensity before scattering integration to Sun. Search `_star_colide` in the code. That results in circular disc from any angle and also set the colors properly from red to yellow for our White Sun [like here](https://stackoverflow.com/a/28020934/2521214). – Spektre Oct 23 '17 at 07:18

1 Answers1

1

That's perspective distortion. All you need is to reduce field of view of your camera.