add shaders for bars, remove waterfall
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#version 330 core
|
||||
|
||||
in float vVal;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler1D heatmap;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 col = texture(heatmap, vVal).rgb;
|
||||
fragColor = vec4(col, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#version 330 core
|
||||
|
||||
uniform float barHeights[96];
|
||||
uniform int barCount;
|
||||
uniform float barWidth;
|
||||
uniform float gap;
|
||||
uniform float bottomY;
|
||||
uniform float topClip;
|
||||
|
||||
out float vVal;
|
||||
|
||||
void main()
|
||||
{
|
||||
int bar = gl_InstanceID;
|
||||
int vertex = gl_VertexID;
|
||||
|
||||
float h = barHeights[bar];
|
||||
|
||||
float xLeft = -1.0 + float(bar) * (barWidth + gap);
|
||||
float xRight = xLeft + barWidth;
|
||||
|
||||
float regionH = topClip - bottomY;
|
||||
float yTop = bottomY + h * regionH;
|
||||
|
||||
vec2 corners[6];
|
||||
corners[0] = vec2(xLeft, bottomY);
|
||||
corners[1] = vec2(xRight, bottomY);
|
||||
corners[2] = vec2(xRight, yTop);
|
||||
corners[3] = vec2(xLeft, bottomY);
|
||||
corners[4] = vec2(xRight, yTop);
|
||||
corners[5] = vec2(xLeft, yTop);
|
||||
|
||||
vec2 pos = corners[vertex];
|
||||
|
||||
vVal = (pos.y - bottomY) / regionH;
|
||||
|
||||
gl_Position = vec4(pos, 0.0, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user