Open alexanderbock opened 7 years ago
The basic infrastructure of having transfer functions for layers is there. The functionality would be possible using LayerAdjustment
. Adding properties can be done the same way as is done for the chroma key layer adjustment.
When it comes to the color lookup I am not entirely sure how that will be done since there are no lookup tables in GLSL (which are not textures). Alternatives would be to either use a 256256256 texture or to loop through an array to check if the sampled color match any of the values in the lookup table which could be a one dimensional texture of size 256. Neither alternative seems reasonable to be done in shader code though..
This kind of multi dimensional lookup I feel should be done out of core as tiles are loaded like worldview does. What I think makes most sense if we would like to support the same feature using their datasets with their lookup tables would be to transform the tiles to single channel grayscale tiles using the loop-lookup as tiles are created and then having our own dynamic transfer function as the tiles are rendered.
Standard transfer functions with one dimensional lookups however makes much more sense and could be implemented using a LayerAdjustment
mode.
We could have a new layer type with a different tile provider that takes in a lookup table used to transform the values to single channel which we then can use for standard rendering and layer adjustments if desired.
But why doesn't GIBS provide the untransformed, normalized, single channel datasets I ask myself...
NASA Worldview uses a processing step where a transfer function is applied to each tile to support changing color maps on the fly. From Ben King: