Watch
2
0
Fork
You've already forked raylib-cs
0

Update/merge examples back into main repo (#192)

This commit is contained in:
Rgebee 2023-08-25 08:08:32 +01:00 committed by GitHub
commit bcdf8cec5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
320 changed files with 57965 additions and 1 deletions

View file

@ -0,0 +1,30 @@
#version 330
// Input vertex attributes (from vertex shader)
in 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));
uv *= vec2(0.1591, 0.3183);
uv += 0.5;
return uv;
}
void main()
{
// Normalize local position
vec2 uv = SampleSphericalMap(normalize(fragPosition));
// Fetch color from texture map
vec3 color = texture(equirectangularMap, uv).rgb;
// Calculate final fragment color
finalColor = vec4(color, 1.0);
}