proggamer12
proggamer12

Reputation: 302

Opengl, three.js - how to draw circular sun

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?

Upvotes: 1

Views: 961

Answers (1)

game development germ
game development germ

Reputation: 1334

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

Upvotes: 2

Related Questions