Review skybox shaders

This commit is contained in:
raysan5
2020-07-10 12:20:57 +02:00
parent 956f61cf14
commit b4ff6fdde3
4 changed files with 12 additions and 30 deletions

View File

@ -9,14 +9,11 @@
#version 330
// Input vertex attributes (from vertex shader)
in vec3 fragPosition;
varying vec3 fragPosition;
// Input uniform values
uniform sampler2D equirectangularMap;
// Output fragment color
out vec4 finalColor;
vec2 SampleSphericalMap(vec3 v)
{
vec2 uv = vec2(atan(v.z, v.x), asin(v.y));
@ -34,5 +31,5 @@ void main()
vec3 color = texture(equirectangularMap, uv).rgb;
// Calculate final fragment color
finalColor = vec4(color, 1.0);
gl_FragColor = vec4(color, 1.0);
}