Nodes > Inputs > Parameters > Texture 2D Parameter
Exposes a texture parameter on the material. This value can be modified through the Inspector panel or by script at runtime.
In addition, this node automatically samples the texture and returns the color value.
Inputs
Name | Type | Description |
---|---|---|
UV Coords | float | Coordinates to sample the texture at |
LOD | float | Which LOD level to sample from. Only works if Mipmaps are enabled in the texture parameters in the material inspector |
Outputs
Name | Type | Description |
---|---|---|
Color | color | Sampled color of the texture |
Texture Size | float | Dimensions of the texture (width, height), in pixels |
Pixel Size | float | Width and height of a pixel (1/texture size) |
Depth | float | When the Type is set to "View Space Depth Map", this returns the depth buffer value at the sampled position in view space. When the Type is set to 2d Map, the depth value is returned in screen space. |
Properties
Name | Type | Description |
---|---|---|
Title | string | Title used for this parameter when viewing the Material in the Inspector |
Script Name | string | Variable name scripts can use to access this parameter through the Material's mainPass |
Type | dropdown | If Normal Map is selected, the values will be remapped from 0,1 to -1,1, which is more suitable for normal map textures. If View Space Depth Map is selected, the input texture should be a depth buffer texture, and the output will return a depth value in view space. |
UV Coords Mode | dropdown | Choose what source to use for the UV Coordinates. If "UV Coord 0" or "UV1 Coord 1" are selected, the respective surface UV set will be used. If "Custom" is selected, the UV Coords input will be exposed and used instead |
LOD Mode | dropdown | If set to "Auto", LOD will be handled automatically. If set to "Custom", the LOD input will be exposed and used instead |
Expose Size Outputs | bool | If enabled, the Texture Size and Pixel Size output ports will be exposed |
Group | string | If not empty, specifies the parameter group this parameter is shown in |
Sort Index | int | Specifies the order this should be listed relative to other parameters |
Tooltip | string | Tooltip message shown on mouse hover |
Was this page helpful?