TextureFX
- Last UpdatedDec 14, 2023
- 3 minute read
The TextureFX node can create dynamic runtime textures based on different effects.
Platform support
This node is supported on XR-Windows platform only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
No support |
No support |
No support |
No support |
|
|
|
|
|
|
Coloring
Texture coloring is done vertical line by vertical line from left to right with the following rules:
-
Points above the highest line have that line color.
-
Points below the lowest line have that line color.
-
Points on a line have line color. If more lines intersect in a point, the color is the one of the line with highest ID.
-
Points between two lines show a color that is the linear interpolation among the two line colors weighted on relative distance.
getAlphaColor function description
Parameters
It accept two comma-separated sfloat values containing the texture point coordinate in the space (0 0) - (1 1).
Parameter string example:
0.4,0.77
Result
It returns an sfloat value representing the current value in the color space (0-1) assigned to the uv coordinate.
Result example
0.74
Code example
This is a code example for the TextureFX node.
<TextureFX name="fx_itemcolor_TEE011" size="32 32" cellsW="2" cellsH="2" c_0_0="0" c_1_0="#1*@voxel_Liquid_Loop1|itemcolor_TEE011_14_voxel.value@+0*@voxel_Liquid_Loop1|itemcolor_TEE011_13_voxel.value@#" c_0_1="0" c_1_1="#1*@voxel_Liquid_Loop1|itemcolor_TEE011_14_voxel.value@+0*@voxel_Liquid_Loop1|itemcolor_TEE011_13_voxel.value@#" />
Lines
Texture filling is based on individual lines that move it horizontally.
Lines can be defined by one or more points with the following rules:
-
Before the first point, the line is assumed to be horizontal and keeps its first point v value.
-
After last point, the line is assumed to continue horizontally keeping the same v value.
From these rules, a single point is enough to draw a horizontal line.
Each line has a color selected in the colors list. Different lines can have the same color.

TextureFX fields
These are the fields for TextureFX node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > TextureFX
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
cellsW |
sint |
Optional |
1 |
Number of cells on the width where the texture is split. |
|
cellsH |
sint |
Optional |
1 |
Number of cells on the height where the texture is split. |
|
colors |
mvec4 |
Optional |
0 0 1 1,0 1 0 1,1 0 0 1 |
List of colors in (0-1) normalized RGBA space. When the type is set to cells, SVEC3 values are also accepted. |
|
c_X_Y |
sfloat |
Optional |
0 |
Value assigned to each cell that determines the behavior of the selected effect. |
|
getAlphaColor |
sfunction |
Read only |
Not set |
Returns the value in the color range (0-1) assigned to a UV coordinate in the texture. |
|
lines.linesNum |
sint |
Optional |
1 |
Number of lines used by effect. |
|
lines.pos_X |
mvec2 |
Optional |
These UV coordinates define the individual line aspect. At least one point must be provided. V values—before first point U and after last point U—are kept constant. |
|
|
lines.val_X |
sint |
Optional |
0 |
This value is used to assign a color to the line. It refers to the ID of the entries of the colors list. Zero (0) means first color in the list. |
|
size |
svec2 |
Optional |
256 256 |
The size of the produced texture. |
|
type |
senum |
Optional |
cells |
Specifies the type as cells or lines. |