DataTexture

csharp
public sealed class DataTexture : Object

Namespace NodeWorld.Flux.

A small texture of floats written by the script (RGBA, point filtering, clamped, no mipmaps, linear): data for shaders, given to them with Shader.SetGlobalTexture. Released with Release or when the world unloads. Client only.

Properties

width

csharp
public int width { get; }

Width in texels.

height

csharp
public int height { get; }

Height in texels.

Methods

Create

csharp
public static DataTexture Create(int width, int height)

A data texture of the world, 1 to 1024 texels on each side, every texel at zero.

SetPixels

csharp
public void SetPixels(float[] rgba)

Writes every texel and uploads them: width x height x 4 floats (r, g, b, a), row by row from y = 0.

Release

csharp
public void Release()

Frees the texture.