Files
oak-editor/app/shaders/rgbhistogram.vert
T
Troy James Sobotka 6ebe0084a3 Implement Histogram
Basic pass at histogram. Uses a power based
scale compared against the total pixel count.
Probably needs a UI toggle to flip lines on
and off as the text and lines in OpenGL are
a large cycles sucker. Could be likely much
faster when migrated to a geometry shader
approach. Uses the scaled viewport resolution
to increase performance as much as possible.
2020-05-19 00:07:34 -07:00

29 lines
569 B
GLSL

#version 150
uniform float histogram_scale;
uniform vec2 ove_resolution;
in vec4 a_position;
in vec2 a_texcoord;
out vec2 ove_texcoord;
mat4 scale_mat4(vec3 scale) {
return mat4(
scale.x, 0.0, 0.0, 0.0,
0.0, scale.y, 0.0, 0.0,
0.0, 0.0, scale.z, 0.0,
0.0, 0.0, 0.0, 1.0
);
}
void main() {
// Create identity matrix
mat4 transform = mat4(1.0);
// Scale the scope
transform *= scale_mat4(vec3(histogram_scale, histogram_scale, 1.0));
gl_Position = transform * a_position;
ove_texcoord = a_texcoord;
}