23 lines
599 B
GLSL
23 lines
599 B
GLSL
#version 460
|
|
|
|
in Varyings {
|
|
layout(location = 0) vec3 texCoord;
|
|
} var;
|
|
|
|
layout(set = 0, binding = 1) uniform sampler _Sampler;
|
|
layout(set = 0, binding = 2) uniform textureCube _Texture;
|
|
|
|
layout(location = 0) out vec4 fragColor;
|
|
|
|
#include "includes/tone_mapping.glsl"
|
|
|
|
void main() {
|
|
vec4 texel = texture(samplerCube(_Texture, _Sampler), var.texCoord);
|
|
vec3 outgoingRadiance = texel.rgb;
|
|
|
|
vec3 toneMappedLinearColor = toneMapAcesNarkowicz(outgoingRadiance);
|
|
vec3 toneMappedSrgbColor = pow(toneMappedLinearColor, vec3(1.0 / 2.2));
|
|
|
|
fragColor = vec4(toneMappedSrgbColor, 1.0);
|
|
}
|