diff options
| author | Ray <[email protected]> | 2019-05-17 20:03:04 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-17 20:03:04 +0200 |
| commit | 245cf2400e3f215b998d4e1f2ae1f9afefa0eb08 (patch) | |
| tree | 15552dd041dab47c9ca23efbb4b8925c384beab2 /examples/models/resources/shaders/glsl330/skybox.fs | |
| parent | 0ec46e8976f48617fe39bc10a44ff7313d6b27ea (diff) | |
| download | raylib-245cf2400e3f215b998d4e1f2ae1f9afefa0eb08.tar.gz raylib-245cf2400e3f215b998d4e1f2ae1f9afefa0eb08.zip | |
Review shader examples
Diffstat (limited to 'examples/models/resources/shaders/glsl330/skybox.fs')
| -rw-r--r-- | examples/models/resources/shaders/glsl330/skybox.fs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/models/resources/shaders/glsl330/skybox.fs b/examples/models/resources/shaders/glsl330/skybox.fs new file mode 100644 index 00000000..053a2517 --- /dev/null +++ b/examples/models/resources/shaders/glsl330/skybox.fs @@ -0,0 +1,31 @@ +/******************************************************************************************* +* +* rPBR [shader] - Background skybox fragment shader +* +* Copyright (c) 2017 Victor Fisac +* +**********************************************************************************************/ + +#version 330 + +// Input vertex attributes (from vertex shader) +in vec3 fragPosition; + +// Input uniform values +uniform samplerCube environmentMap; + +// Output fragment color +out vec4 finalColor; + +void main() +{ + // Fetch color from texture map + vec3 color = texture(environmentMap, fragPosition).rgb; + + // 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); +} |
