2D Texture

Texture input that builds on Shaderlab's "2D" type.


2D Texture, Basic

  • Default texture input.

  • Requires an empty attributes list.

 

Example:

_Example ("'Example' {}", 2D) = "white" {}


2D Texture, Visualize

  • Adds a "Visualize" button that allows you to cycle through preview modes for that texture. Each shows an unlit version of the mesh with the texture mapped onto it.

  • Requires the Visualize attribute.

 

Example:

_Example ("'Example' {Visualize:{RGB, A}}", 2D) = "white" {}

_Example ("'Example' {Visualize:{R, G, B, A}}", 2D) = "white" {}

_Example ("'Example' {Visualize:{NRM}}", 2D) = "bump" {}


2D Texture, Visualize with Parented Transforms

  • Hides the texture input's transform controls, and causes the Visualize previews to instead use the parent texture's transforms.

  • Requires the Visualize and Parent attributes.

 

Example:

_ParentExample ("'Parent Example' {}", 2D) = "white" {}

_Example ("'Example' {Visualize:{G, A}, Parent:_ParentExample }", 2D) = "white" {}


2D Texture, Additional Transform parameters

  • Allows the texture to have additional transform parameters.

  • Can specify up to three properties with the same name but different suffixes.

    • *Velocity for Scroll option.

    • *Spin for Spin option. (note edit in degrees, but stored as radians)

    • *UV for Mode option.

 

Example:

_Example ("’Example' {}", 2D) = "white" {}

_ExampleVelocity ("Scroll", Vector) = (0,0,0,0)

_ExampleSpin ("Spin", Float) = 0

_ExampleUV ("Mode", Float) = 0


2D Texture, No Controls

  • Requires the Controls attribute set to False.

 

Example:

_Example ("'Example' {Controls:False}", 2D) = "white" {}


Attributes

Controls

Parent

Visualize