Files
oak-editor/app/shaders/rgbwaveform.vert
T
Troy James Sobotka 80badaa5a8 Waveform Fixes and Modifications
Fixes:
 * Values exceeding the encoded range.
   Future may account for a certain range
   above and below current values.
 * Minor calculation problem that prevented
   the above fix from working properly.
 * Streamlined the shader code.
 * Add a vertex shader to handle the scaling.
 * Use the viewport resolution as the scaled
   version to save performance.
2020-05-19 00:13:13 -07:00

29 lines
566 B
GLSL

#version 150
uniform float waveform_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(waveform_scale, waveform_scale, 1.0));
gl_Position = transform * a_position;
ove_texcoord = a_texcoord;
}