
|
Downloads
Demo: geexlab-demopack-gl21/d58-color-map-shaders/
|
Color maps are very useful in computer graphics. They are used to improve the visualization of data (like the temperature or the air quality like on this site). A color map is simply a color array or color palette. This color palette can be stored in a 1D texture or can be generated by a piece of code. I discovered this morning this github repository with tons of color map functions (105!) coded in GLSL (there are color maps in Metal too).
Each color map is a single GLSL pixel shader file with the same main function:
vec4 colormap(float x)
{
....
}
To test the different color map files, I coded a small GeeXLab demo. The demo is available in the OpenGL 2.1 demopack (folder: geexlab-demopack-gl21/d58-color-map-shaders/).
All color maps are in the geexlab-demopack-gl21/d58-color-map-shaders/colormaps/ folder:
Launch the demo and drag and drop any color map shader in the demo:
I added a checkbox to color the background with the colormap:
Another color map (IDL_CB-PuBuGn):