imported>Mysticporo Created page with "<languages></languages> <translate> <!--T:1--> {{stub}} {{Infobox Component |Image=LUT_MaterialComponent.png |Name=LUT Material }} <!--T:2--> == Fields == {{Table ComponentFi..." |
Added further detail to LUT construction and usage. Still need to add examples and images. |
||
Line 7: | Line 7: | ||
|Name=LUT Material | |Name=LUT Material | ||
}} | }} | ||
An LUT or Lookup Table is a way of mapping input values to output values via sampling a [[StaticTexture3D_(Component)|3D Texture]]. This 3D table of values allows for any arbitrary function to be applied to an input. | |||
<!--T:2--> | <!--T:2--> | ||
Line 14: | Line 16: | ||
|Rect|Rect| | |Rect|Rect| | ||
|RectClip|Bool| | |RectClip|Bool| | ||
|ColorMask|ColorMask| | |ColorMask|ColorMask|The color channels to affect | ||
|StencilComparison|StencilComparison| | |StencilComparison|StencilComparison| | ||
|StencilOperation|StencilOperation| | |StencilOperation|StencilOperation| | ||
Line 22: | Line 24: | ||
|RenderQueue|Int| | |RenderQueue|Int| | ||
|_shader|IAssetProvider`1|TypeString10=IAssetProvider<Shader>| | |_shader|IAssetProvider`1|TypeString10=IAssetProvider<Shader>| | ||
|LUT|IAssetProvider`1|TypeString11=IAssetProvider<Texture3D>| | |LUT|IAssetProvider`1|TypeString11=IAssetProvider<Texture3D>|The 3D texture to use as a lookup table | ||
|SecondaryLUT|IAssetProvider`1|TypeString12=IAssetProvider<Texture3D>| | |SecondaryLUT|IAssetProvider`1|TypeString12=IAssetProvider<Texture3D>|A secondary 3D texture to use to lerp between | ||
|Lerp|Float| | |Lerp|Float|Allows blending from the first LUT (0) or the secondary LUT (1) | ||
|BlendMode|BlendMode| | |BlendMode|BlendMode| | ||
|Sidedness|Sidedness| | |Sidedness|Sidedness| | ||
Line 33: | Line 35: | ||
<!--T:3--> | <!--T:3--> | ||
== Usage == | == Usage == | ||
An LUT is commonly constructed via 2D slices of a [[StaticTexture3D_(Component)|3D Texture]]. These slices represent XY planes of incremental Z coordinates ranging from 0 to 1. This can either be packed into a single 2D image, or imported as multiple 2D images in a folder where each slice is alphabetically organized. | |||
Currently the maximum packed 2D image that the importer detects as a valid LUT is 1024x32. In this orientation there are 32 total cells arranged as 32x32 pixel sub images. A 1:1 mapping LUT which simply maps its inputs directly to the same value on its outputs is shown below which demonstrates the coordinate system: | |||
[[File:LUT_BaseLinear.png|center|alt=Linear LUT|Linear LUT|thumb|800x800px]] | |||
* The '''Red''' channel increases constantly from 0 to 1 from left to right within each cell and repeats. | |||
[[File:LUT_BaseLinear_RED.png|center|alt=Linear LUT Red Channel|Linear LUT Red channel|thumb|800x800px]] | |||
* The '''Green''' channel linearly increases from the top to bottom. | |||
[[File:LUT_BaseLinear_GREEN.png|center|alt=Linear LUT Green Channel|Linear LUT Green channel|thumb|800x800px]] | |||
* The '''Blue''' channel increases step wise within each cell itself, the first cell being all 0, and the last cell is all 1. | |||
[[File:LUT_BaseLinear_BLUE.png|center|alt=Linear LUT Blue Channel|Linear LUT Blue channel|thumb|800x800px]] | |||
The mapping function of an LUT takes an input RGB value and then samples the 3D Texture at that corresponding coordinate to find the output RGB value, using the [[StaticTexture3D_(Component)|3D Texture]]'s [[Type:TextureFilterMode|Filter Mode]] and [[Type:TextureWrapMode|Wrap Mode]] to resolve how intermediate values work. | |||
<!--T:4--> | <!--T:4--> | ||
== Examples == | == Examples == | ||
<!--T:5--> | <!--T:5--> |
Revision as of 00:45, 19 January 2024
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
An LUT or Lookup Table is a way of mapping input values to output values via sampling a 3D Texture. This 3D table of values allows for any arbitrary function to be applied to an input.
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
HighPriorityIntegration
|
Bool | |
Rect
|
Rect | |
RectClip
|
Bool | |
ColorMask
|
ColorMask | The color channels to affect |
StencilComparison
|
StencilComparison | |
StencilOperation
|
StencilOperation | |
StencilID
|
Byte | |
StencilWriteMask
|
Byte | |
StencilReadMask
|
Byte | |
RenderQueue
|
Int | |
_shader
|
IAssetProvider<Shader> | |
LUT
|
IAssetProvider<Texture3D> | The 3D texture to use as a lookup table |
SecondaryLUT
|
IAssetProvider<Texture3D> | A secondary 3D texture to use to lerp between |
Lerp
|
Float | Allows blending from the first LUT (0) or the secondary LUT (1) |
BlendMode
|
BlendMode | |
Sidedness
|
Sidedness | |
ZWrite
|
ZWrite | |
ZTest
|
ZTest |
Usage
An LUT is commonly constructed via 2D slices of a 3D Texture. These slices represent XY planes of incremental Z coordinates ranging from 0 to 1. This can either be packed into a single 2D image, or imported as multiple 2D images in a folder where each slice is alphabetically organized.
Currently the maximum packed 2D image that the importer detects as a valid LUT is 1024x32. In this orientation there are 32 total cells arranged as 32x32 pixel sub images. A 1:1 mapping LUT which simply maps its inputs directly to the same value on its outputs is shown below which demonstrates the coordinate system:
- The Red channel increases constantly from 0 to 1 from left to right within each cell and repeats.
- The Green channel linearly increases from the top to bottom.
- The Blue channel increases step wise within each cell itself, the first cell being all 0, and the last cell is all 1.
The mapping function of an LUT takes an input RGB value and then samples the 3D Texture at that corresponding coordinate to find the output RGB value, using the 3D Texture's Filter Mode and Wrap Mode to resolve how intermediate values work.