|
|
@ -203,9 +203,9 @@ uniform float colorPalette[16 * 3]; |
|
|
|
void main() |
|
|
|
{ |
|
|
|
// TODO: Why do I need this cast? |
|
|
|
vec3 paletteColor = vec3(colorPalette[int((float(colorPaletteIndex) * 3) + 0)] / 255.f, |
|
|
|
colorPalette[int((float(colorPaletteIndex) * 3) + 1)] / 255.f, |
|
|
|
colorPalette[int((float(colorPaletteIndex) * 3) + 2)] / 255.f); |
|
|
|
vec3 paletteColor = vec3(colorPalette[int((float(colorPaletteIndex) * 3) + 0)], |
|
|
|
colorPalette[int((float(colorPaletteIndex) * 3) + 1)], |
|
|
|
colorPalette[int((float(colorPaletteIndex) * 3) + 2)]); |
|
|
|
const float minBrightness = 0.05f; |
|
|
|
float thisColorMaxBrightness = max(paletteColor.x, max(paletteColor.y, paletteColor.z)); |
|
|
|
if (thisColorMaxBrightness < minBrightness) |
|
|
@ -281,6 +281,8 @@ void main() |
|
|
|
treemap-width int treemap-height int |
|
|
|
transform mat4 picked-rectangle-index int |
|
|
|
is-treemap-valid bool |
|
|
|
;; Size should equal g-max-num-classification-colors |
|
|
|
color-palette (* float) |
|
|
|
&return int) ;; Returns texture ID |
|
|
|
(scope-timed "Render visible" ;; Render visible treemap to frame buffer |
|
|
|
(glViewport 0 0 treemap-width treemap-height) |
|
|
@ -305,8 +307,7 @@ void main() |
|
|
|
|
|
|
|
(var color-palette-uniform int |
|
|
|
(glGetUniformLocation (field g-treemap-opengl shader-program) "colorPalette")) |
|
|
|
(glUniform1fv color-palette-uniform (* 16 3) ;; TODO don't hard-code |
|
|
|
(type-cast current-interpolate-base16-colors (* float))) |
|
|
|
(glUniform1fv color-palette-uniform (* g-max-num-classification-colors 3) color-palette) |
|
|
|
|
|
|
|
(glBindVertexArray (field g-treemap-opengl mesh-array-object)) |
|
|
|
(glDrawElements GL_TRIANGLES (field g-treemap-opengl num-indices) GL_UNSIGNED_INT |
|
|
|