Lookup Table (LUT) Mapping node
A node that transforms an input texture by converting each pixel using a LUT (lookup table).
Description
This node generates a 4-channel OutRenderTexture by applying a per-pixel transformation to a 1-channel InRenderTexture. The transformation is a linear mapping described via the 3-channel texture LUT:
Input value in InRenderTexture[i, j] | Output value in OutRenderTexture[i, j] |
---|---|
InputStart |
LUT[0] |
InputEnd |
LUT[LUT width - 1] |
When EnableSpecialValue is true
, instead of using LUT, the color OutputSpecialValue is written to the output texture when the input texture value is InputSpecialValue.
Inputs
Name | Type | Description |
---|---|---|
InRenderTexture | RenderTexture |
The input texture to transform. Only the first channel is used. |
LUT | Texture2D |
The texture to use as lookup table for the mapping. Must have at least 3 channels. |
InputStart | float |
The value of the input texture to map the lookup table first entry. |
InputEnd | float |
The value of the input texture to map the lookup table last entry. |
EnableSpecialValue | bool |
Enables overriding the LUT for a specific input value. |
InputSpecialValue | float |
The specific value of the input texture which ignores the LUT. Ignored if EnableSpecialValue is false . |
OutputSpecialValue | Vector4 |
The value to use in the output texture when the input texture special value is encountered. Ignored if EnableSpecialValue is false . |
Outputs
Name | Type | Description |
---|---|---|
OutRenderTexture | RenderTexture |
The texture resulting from LUT mapping. The format used is ARGB32. |
Execution
Asynchronous. Executes when InRenderTexture changes.
Limitations
You currently can't specify an image file for LUT directly inside of a system graph. As an alternative, you can define a Texture2D property for that graph, connect it to the LUT port, and use the Inspector window to bind an image file asset to the property.
Notes
- The alpha channel of OutRenderTexture is always set to 1.
- If InRenderTexture has more than one channel, this node only uses the first channel.
- The wrap mode of LUT determines what happens to input values that fall outside the range [InputStart, InputEnd]. This node performs either clamping or wrap-around of the values.
- The filter mode of LUT determines whether to interpolate the LUT.
- Use LUT Mapping for color mapping of depth maps or range images. SensorSDK provides multiple color maps for different color mapping scenarios. See Use LUT Mapping for visualization for the complete list.
- It's possible to reverse LUT if you provide an InputStart greater than InputEnd. InputStart must not be equal to InputEnd.