Commit 0f272389 authored by Margaux Mouchene's avatar Margaux Mouchene
Browse files

first commit

parent 7c66167f
......@@ -96,6 +96,7 @@ class AbstractMapView(QOpenGLWidget):
set_uniform(self.program, b'palette', PALETTE_UNIT)
set_uniform(self.program, 'v_0', 0.)
set_uniform(self.program, 'v_1', 1.)
set_uniform(self.program, 'v_ref', 5.)
self.set_colormap()
def update_vs(self):
......
......@@ -15,11 +15,12 @@ PALETTE_SHADER = r"""
uniform float v_i; // min and
uniform float v_a; // max data value to denormalize data
uniform float v_ref;
vec2 v() {
// compute original value, keep alpha for nans
vec4 t = texture2D(values, gl_TexCoord[0].st);
return vec2(t.x*(v_a-v_i)+v_i, t.a);
return vec2(t.x*(v_a-v_i)+v_i-v_ref, t.a);
}
// handling palette
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment