I am developing a point painting extension module for GLIM which adds RGB colors to GLIM maps. To display the result, I could use the vert_color shader attribute, but unfortunately that attribute is already used to show map intensity. Thus, it is necessary to overwrite the vertex data whenever I want to change color from intensity-based to point color.
Currently, GLIM maps intensity to RGB colors using fixed table, and use that data for vert_color input. Maybe it could make sense to have the following approach instead:
- use
in vec4 vert_color for raw RGB colors
- use
in u8 vert_colormap_index and uniform vec3 colormap[256] for intensity base coloring
To render intensity, the host would only convert the value to a u8 index and pass the colormap as uniform parameter. The advantage of this appraoch is that colormaps could be changed on the fly without the need to re-upload the points data.
I am developing a point painting extension module for GLIM which adds RGB colors to GLIM maps. To display the result, I could use the
vert_colorshader attribute, but unfortunately that attribute is already used to show map intensity. Thus, it is necessary to overwrite the vertex data whenever I want to change color from intensity-based to point color.Currently, GLIM maps intensity to RGB colors using fixed table, and use that data for
vert_colorinput. Maybe it could make sense to have the following approach instead:in vec4 vert_colorfor raw RGB colorsin u8 vert_colormap_indexanduniform vec3 colormap[256]for intensity base coloringTo render intensity, the host would only convert the value to a u8 index and pass the colormap as uniform parameter. The advantage of this appraoch is that colormaps could be changed on the fly without the need to re-upload the points data.