(Demo) A Collection of Color Map Shaders

GeeXLab - Color map shader demo


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:

GLSL color maps

Launch the demo and drag and drop any color map shader in the demo:

GeeXLab - Color map shader demo

I added a checkbox to color the background with the colormap:

GeeXLab - Color map shader demo

Another color map (IDL_CB-PuBuGn):

GeeXLab - Color map shader demo

GeeXLab - Color map shader demo

Leave a Comment

Your email address will not be published. Required fields are marked *