Node Texture Transform - anticto/Mutable-Documentation GitHub Wiki

image


Function

Allows the user to modify the Mutable texture's transform by changing its offset, scale and also rotation:

  • Offset (X and Y) : Applies a delta over the texture's pixel positions. It displaces their position over the texture space. Each unit means a full texture offset so -1 would produce the exact same output as 0 or 1 or 2. Then 0.5 would displace the texture half its size to X or/and Y, depending on the axis updated.

  • Scale (X and Y) : Scales the whole texture linearly. A value of 0.5 produces a texture half the size of the original one filled with tiled data over it's periphery. A texture with scale 1 is visually identical to the provided texture. And an texture with scale -1 produces the mirrored original texture.

  • Rotation : Rotates the texture clockwise using the center as origin for the rotation. A value of 0 returns the same texture while a value of 0.5 rotates the texture half the way (180º). Each rotation unit represents a full texture rotation (360º).

(NOTE) The** order in witch the transforms get applied** is first offset, then **scale **and last rotation.


Use Cases

  • You want to provide the user the capacity of scaling down and rotating a pattern you have provided for your character creation system. You also want it to automatically tile over itself.

Bellow a simple example is presented where all three types of values are changed on an example texture. It may help you to get a practical understanding about how the node works and how to interact with it:

image

(NOTE) Missing pixel data due to scaling, offsetting or rotating the texture is automatically filled with tiled data from the texture being worked on. Shown on the texture above on point 2 and 3.

(NOTE) Something to highlight is that the resolution of the texture does not get modified but the contents of it do. So, the output texture will have the same resolution of the original texture if, for example, we scale it.


Input Pins

Base Texture : Input texture used as base for the transformation operation.

Offset X : Offset value to be set on the texture's X axis.

Offset Y : Offset value to be set on the texture's Y axis.

Scale X : Scale value to be applied over the X axis of the texture.

Scale Y : Scale value to be applied over the Y axis of the texture.

Rotation : Value used to set the rotation of the output texture.


Output Pins

**Texture : ** Output texture that satisfies the requirements set over the input side of the node. It will be representative of the base texture but with the offsets, scale adjustments and also rotation applied in it.