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 samplerCube environmentMap;
uniform bool vflipped;
uniform bool doGamma;
// Output fragment color
out vec4 finalColor;
void main()
{
// Fetch color from texture map
vec3 color = vec3(0.0);
if (vflipped) color = texture(environmentMap, vec3(fragPosition.x, -fragPosition.y, fragPosition.z)).rgb;
else color = texture(environmentMap, fragPosition).rgb;
if (doGamma)// Apply gamma correction
{
color = color/(color + vec3(1.0));
color = pow(color, vec3(1.0/2.2));
}
// Calculate final fragment color
finalColor = vec4(color, 1.0);
}