2023-02-19 15:47:55 +00:00
|
|
|
#version 330 core
|
|
|
|
|
2023-04-07 06:17:37 +00:00
|
|
|
layout(location = 0) out vec4 fragColor;
|
2023-02-19 15:47:55 +00:00
|
|
|
|
2024-01-30 23:24:01 +00:00
|
|
|
in float flogz;
|
|
|
|
|
2023-05-02 23:57:20 +00:00
|
|
|
// 3dcloud_common.frag
|
|
|
|
vec4 cloud_common_frag();
|
2023-04-12 20:50:03 +00:00
|
|
|
// exposure.glsl
|
|
|
|
vec3 apply_exposure(vec3 color);
|
2024-01-30 23:24:01 +00:00
|
|
|
// logarithmic_depth.glsl
|
|
|
|
float logdepth_encode(float z);
|
2023-04-07 06:17:37 +00:00
|
|
|
|
2023-02-19 15:47:55 +00:00
|
|
|
void main()
|
|
|
|
{
|
2023-05-02 23:57:20 +00:00
|
|
|
vec4 color = cloud_common_frag();
|
2023-04-07 06:17:37 +00:00
|
|
|
|
2023-05-02 23:57:20 +00:00
|
|
|
// Only pre-expose when not rendering to the environment map.
|
|
|
|
// We want the non-exposed radiance values for IBL.
|
2023-04-12 20:50:03 +00:00
|
|
|
color.rgb = apply_exposure(color.rgb);
|
|
|
|
|
2023-02-19 15:47:55 +00:00
|
|
|
fragColor = color;
|
2024-01-30 23:24:01 +00:00
|
|
|
gl_FragDepth = logdepth_encode(flogz);
|
2023-02-19 15:47:55 +00:00
|
|
|
}
|