Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Jan 10, 2021
1 parent 92b0953 commit 8d14b66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manimlib/shader_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def get_colormap_code(colormap="viridis"):
for n in np.linspace(0, len(rgbs) - 1, 9)
]
data = ",".join(
"vec3({}, {}, {}),".format(*color)
"vec3({}, {}, {})".format(*color)
for color in sparse_rgbs
)
return f"vec3[9]({data})"
2 changes: 1 addition & 1 deletion manimlib/shaders/inserts/finalize_color.glsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vec3 float_to_color(float value, float min_val, float max_val, vec3[9] colormap_data){
float alpha = smoothstep(min_val, max_val, value);
float alpha = clamp((value - min_val) / (max_val - min_val), 0.0, 1.0);
int disc_alpha = min(int(alpha * 8), 7);
return mix(
colormap_data[disc_alpha],
Expand Down

0 comments on commit 8d14b66

Please sign in to comment.