This repository has been archived on 2025-06-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
raylib-python-cffi/examples/models/resources/shaders/skybox.fs
Richard Smith a703659c9d initial
2019-05-21 10:56:31 +01:00

31 lines
751 B
GLSL

/*******************************************************************************************
*
* rPBR [shader] - Background skybox fragment shader
*
* Copyright (c) 2017 Victor Fisac
*
**********************************************************************************************/
#version 330
# Input vertex attributes (from vertex shader)
in vec3 fragPos
# Input uniform values
uniform samplerCube environmentMap
# Output fragment color
out vec4 finalColor
void main()
[
# Fetch color from texture map
vec3 color = texture(environmentMap, fragPos).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)
]