mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-05 21:59:18 -05:00
REVIEWED: Shaders formating to follow raylib code conventions
This commit is contained in:
@ -14,22 +14,22 @@ const float PI = 3.1415926535;
|
||||
void main()
|
||||
{
|
||||
float aperture = 178.0;
|
||||
float apertureHalf = 0.5 * aperture * (PI / 180.0);
|
||||
float apertureHalf = 0.5*aperture*(PI/180.0);
|
||||
float maxFactor = sin(apertureHalf);
|
||||
|
||||
vec2 uv = vec2(0);
|
||||
vec2 xy = 2.0 * fragTexCoord.xy - 1.0;
|
||||
vec2 xy = 2.0*fragTexCoord.xy - 1.0;
|
||||
float d = length(xy);
|
||||
|
||||
if (d < (2.0 - maxFactor))
|
||||
{
|
||||
d = length(xy * maxFactor);
|
||||
float z = sqrt(1.0 - d * d);
|
||||
float r = atan(d, z) / PI;
|
||||
d = length(xy*maxFactor);
|
||||
float z = sqrt(1.0 - d*d);
|
||||
float r = atan(d, z)/PI;
|
||||
float phi = atan(xy.y, xy.x);
|
||||
|
||||
uv.x = r * cos(phi) + 0.5;
|
||||
uv.y = r * sin(phi) + 0.5;
|
||||
uv.x = r*cos(phi) + 0.5;
|
||||
uv.y = r*sin(phi) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user