27 lines
No EOL
647 B
Text
27 lines
No EOL
647 B
Text
include "pipelines/common.glsl"
|
|
|
|
vertex_shader [[
|
|
layout (location = 0) out vec2 v_uv;
|
|
void main() {
|
|
gl_Position = fullscreenQuad(gl_VertexID, v_uv);
|
|
}
|
|
]]
|
|
|
|
fragment_shader [[
|
|
layout (binding=0) uniform sampler2D u_hdrbuffer;
|
|
layout (binding=5, std430) readonly buffer LuminanceData {
|
|
uint b_histogram[256];
|
|
float b_accum;
|
|
};
|
|
layout (location = 0) in vec2 v_uv;
|
|
layout (location = 0) out vec4 o_color;
|
|
layout(std140, binding = 4) uniform Data {
|
|
float u_exposure;
|
|
};
|
|
void main() {
|
|
const float exposure = u_exposure;
|
|
|
|
o_color.rgb = ACESFilm(texture(u_hdrbuffer, v_uv, 0).rgb * exposure / (10 * b_accum));
|
|
o_color.w = 1;
|
|
}
|
|
]] |