NoiseTexture2D
Procedural 2D texture with deferred generation, a color ramp and normal-map processing.
Set Width/Height and Noise, subscribe to Changed before waiting, and let the update queue run. Construction/setters do not return ready pixels. The first generation runs in a deferred call without a worker; later updates use WorkerThreadPool when threads are supported. A large first image can therefore stall the main thread too.
GetImage exposes the current shared CPU image, not a copy or necessarily the latest setter result. Resource dimensions are requested settings. Rapid edits can publish an intermediate result before another generation; Changed does not confirm completion for the latest parameter set. Configure stable parameters and inspect data after notification. Noise=null also emits Changed but makes the CPU Image null; the previous GPU resource is not guaranteed to clear. A RID can be a placeholder rather than readiness proof.
Processing order: noise/invert/normalize → RGBA8 ColorRamp → AsNormalMap → mipmaps. Shared Noise/Gradient resources are observed through Changed; do not mutate them concurrently with generation. In 1.0.0 HasAlpha returns false even for alpha-bearing ramp pixels, so it does not prove opacity.
Small CPU images, deferred updates and settings were tested. Visible graphics, GPU readback, seams, HDR and thread races were not accepted.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
NoiseTexture2DConstructor
public NoiseTexture2D();Creates a texture resource with Width/Height=512, GenerateMipmaps=true, Normalize=true and no Noise. Generation is deferred: set a small size and Noise first and subscribe to Changed before waiting. Construction does not yield a ready CPU Image. Dispose the owned resource after use.
Properties12
AsNormalMapProperty
public bool AsNormalMap { get; set; }Converts luminance to a normal map after ColorRamp using BumpStrength, then generates mipmaps. Creates no geometry, surface displacement or lighting automatically. Normally leave ColorRamp empty for normals from the original heightfield.
BumpStrengthProperty
public float BumpStrength { get; set; }Height-gradient strength with AsNormalMap=true, default 8. Not mesh height. With normal-map mode disabled, the value is stored without regeneration. Validate a finite meaningful range yourself.
ColorRampProperty
public Gradient ColorRamp { get; set; }Shared Gradient ramp: noise Image luminance supplies its Sample position. Ramp Changed triggers regeneration. Output becomes RGBA8, losing HDR values and float precision. Applied after invert/normalize rather than changing noise itself. Resulting alpha does not make NoiseTexture2D.HasAlpha return true.
GenerateMipmapsProperty
public bool GenerateMipmaps { get; set; }Generates mip levels after ColorRamp/normal-map processing, default true. Helps minification aliasing but costs extra work and memory; does not increase base-image detail. This flag is not a running-task status.
HeightProperty
public int Height { get; set; }Requested positive height, default 512. Not a completion indicator; compare it with the actual Image after generation.
In3DSpaceProperty
public bool In3DSpace { get; set; }For the 2D texture, samples 3D noise at z=0 with generator Offset; default false uses 2D noise. Creates neither a volume texture nor Image depth.
InvertProperty
public bool Invert { get; set; }Inverts source-image brightness before ColorRamp and normal-map processing. Changes no seed and does not mean inversion of final RGB. Changes queue regeneration.
NoiseProperty
public Noise Noise { get; set; }Shared Noise generator reference, such as FastNoiseLite. Setter subscribes to its Changed and queues regeneration; output is not immediately ready. Editing one shared generator regenerates all subscribed textures. null can still produce Changed without new data; the previous GPU resource is not guaranteed to clear. Do not dispose a borrowed getter wrapper or mutate the generator from another thread while sampling.
NormalizeProperty
public bool Normalize { get; set; }Enables min/max normalization during noise image/volume generation, default true. Changes data mapping rather than display alone. Separately normalized chunks can have different contrast; a constant field becomes zero brightness before invert. Changes require queued generation.
SeamlessProperty
public bool Seamless { get; set; }Selects blending of an expanded noise field for repetition. Does not guarantee continuity between arbitrary terrain chunks or enable material Repeat. Extra work/memory depends on SeamlessBlendSkirt; visual seam quality was not accepted here.
SeamlessBlendSkirtProperty
public float SeamlessBlendSkirt { get; set; }Extra-field fraction for Seamless, default 0.1; setter accepts 0..1, but extreme/large values were not accepted. Even 0 retains a minimum blend region in Noise. Neither pixels nor AA quality. Start with the default for ordinary use.
WidthProperty
public int Width { get; set; }Requested positive width, default 512. Setter changes metadata immediately and queues regeneration: the old GetImage can have another size. Bound size for memory/device limits; the Inspector range is not a GPU-allocation guarantee.
Methods22
GetBumpStrengthfloat
public float GetBumpStrength();Reads the BumpStrength setting, not task completion. Height-gradient strength with AsNormalMap=true, default 8. Not mesh height. With normal-map mode disabled, the value is stored without regeneration. Validate a finite meaningful range yourself.
floatStored setting, not a guarantee of ready pixels/GPU data.
GetColorRampGradient
public Gradient GetColorRamp();Reads the ColorRamp setting, not task completion. Shared Gradient ramp: noise Image luminance supplies its Sample position. Ramp Changed triggers regeneration. Output becomes RGBA8, losing HDR values and float precision. Applied after invert/normalize rather than changing noise itself. Resulting alpha does not make NoiseTexture2D.HasAlpha return true.
GradientShared assigned resource or null; do not dispose a borrowed wrapper.
GetInvertbool
public bool GetInvert();Reads the Invert setting, not task completion. Inverts source-image brightness before ColorRamp and normal-map processing. Changes no seed and does not mean inversion of final RGB. Changes queue regeneration.
boolStored setting, not a guarantee of ready pixels/GPU data.
GetNoiseNoise
public Noise GetNoise();Reads the Noise setting, not task completion. Shared Noise generator reference, such as FastNoiseLite. Setter subscribes to its Changed and queues regeneration; output is not immediately ready. Editing one shared generator regenerates all subscribed textures. null can still produce Changed without new data; the previous GPU resource is not guaranteed to clear. Do not dispose a borrowed getter wrapper or mutate the generator from another thread while sampling.
NoiseShared assigned resource or null; do not dispose a borrowed wrapper.
GetSeamlessbool
public bool GetSeamless();Reads the Seamless setting, not task completion. Selects blending of an expanded noise field for repetition. Does not guarantee continuity between arbitrary terrain chunks or enable material Repeat. Extra work/memory depends on SeamlessBlendSkirt; visual seam quality was not accepted here.
boolStored setting, not a guarantee of ready pixels/GPU data.
GetSeamlessBlendSkirtfloat
public float GetSeamlessBlendSkirt();Reads the SeamlessBlendSkirt setting, not task completion. Extra-field fraction for Seamless, default 0.1; setter accepts 0..1, but extreme/large values were not accepted. Even 0 retains a minimum blend region in Noise. Neither pixels nor AA quality. Start with the default for ordinary use.
floatStored setting, not a guarantee of ready pixels/GPU data.
IsGeneratingMipmapsbool
public bool IsGeneratingMipmaps();Reads the GenerateMipmaps setting, not task completion. Generates mip levels after ColorRamp/normal-map processing, default true. Helps minification aliasing but costs extra work and memory; does not increase base-image detail. This flag is not a running-task status.
boolStored setting, not a guarantee of ready pixels/GPU data.
IsIn3DSpacebool
public bool IsIn3DSpace();Reads the In3DSpace setting, not task completion. For the 2D texture, samples 3D noise at z=0 with generator Offset; default false uses 2D noise. Creates neither a volume texture nor Image depth.
boolStored setting, not a guarantee of ready pixels/GPU data.
IsNormalMapbool
public bool IsNormalMap();Reads the AsNormalMap setting, not task completion. Converts luminance to a normal map after ColorRamp using BumpStrength, then generates mipmaps. Creates no geometry, surface displacement or lighting automatically. Normally leave ColorRamp empty for normals from the original heightfield.
boolStored setting, not a guarantee of ready pixels/GPU data.
IsNormalizedbool
public bool IsNormalized();Reads the Normalize setting, not task completion. Enables min/max normalization during noise image/volume generation, default true. Changes data mapping rather than display alone. Separately normalized chunks can have different contrast; a constant field becomes zero brightness before invert. Changes require queued generation.
boolStored setting, not a guarantee of ready pixels/GPU data.
SetAsNormalMapvoid
public void SetAsNormalMap(bool asNormalMap);Sets AsNormalMap under the regeneration-queue rules. Converts luminance to a normal map after ColorRamp using BumpStrength, then generates mipmaps. Creates no geometry, surface displacement or lighting automatically. Normally leave ColorRamp empty for normals from the original heightfield.
| Name | Type | Default |
|---|---|---|
asNormalMap | bool | — |
asNormalMapNew AsNormalMap value; see the description for valid range and scope.
SetBumpStrengthvoid
public void SetBumpStrength(float bumpStrength);Sets BumpStrength under the regeneration-queue rules. Height-gradient strength with AsNormalMap=true, default 8. Not mesh height. With normal-map mode disabled, the value is stored without regeneration. Validate a finite meaningful range yourself.
| Name | Type | Default |
|---|---|---|
bumpStrength | float | — |
bumpStrengthNew BumpStrength value; see the description for valid range and scope.
SetColorRampvoid
public void SetColorRamp(Gradient gradient);Sets ColorRamp under the regeneration-queue rules. Shared Gradient ramp: noise Image luminance supplies its Sample position. Ramp Changed triggers regeneration. Output becomes RGBA8, losing HDR values and float precision. Applied after invert/normalize rather than changing noise itself. Resulting alpha does not make NoiseTexture2D.HasAlpha return true.
| Name | Type | Default |
|---|---|---|
gradient | Gradient | — |
gradientShared resource reference; Changed is observed and no copy is made.
SetGenerateMipmapsvoid
public void SetGenerateMipmaps(bool invert);Sets GenerateMipmaps under the regeneration-queue rules. Generates mip levels after ColorRamp/normal-map processing, default true. Helps minification aliasing but costs extra work and memory; does not increase base-image detail. This flag is not a running-task status.
| Name | Type | Default |
|---|---|---|
invert | bool | — |
invertDespite the name invert, true enables mipmaps and false disables them. Does not change texture Invert.
SetHeightvoid
public void SetHeight(int height);Sets Height under the regeneration-queue rules. Requested positive height, default 512. Not a completion indicator; compare it with the actual Image after generation.
| Name | Type | Default |
|---|---|---|
height | int | — |
heightPositive requested dimension; bound memory and await data generation.
SetIn3DSpacevoid
public void SetIn3DSpace(bool enable);Sets In3DSpace under the regeneration-queue rules. For the 2D texture, samples 3D noise at z=0 with generator Offset; default false uses 2D noise. Creates neither a volume texture nor Image depth.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableNew In3DSpace value; see the description for valid range and scope.
SetInvertvoid
public void SetInvert(bool invert);Sets Invert under the regeneration-queue rules. Inverts source-image brightness before ColorRamp and normal-map processing. Changes no seed and does not mean inversion of final RGB. Changes queue regeneration.
| Name | Type | Default |
|---|---|---|
invert | bool | — |
invertNew Invert value; see the description for valid range and scope.
SetNoisevoid
public void SetNoise(Noise noise);Sets Noise under the regeneration-queue rules. Shared Noise generator reference, such as FastNoiseLite. Setter subscribes to its Changed and queues regeneration; output is not immediately ready. Editing one shared generator regenerates all subscribed textures. null can still produce Changed without new data; the previous GPU resource is not guaranteed to clear. Do not dispose a borrowed getter wrapper or mutate the generator from another thread while sampling.
| Name | Type | Default |
|---|---|---|
noise | Noise | — |
noiseShared resource reference; Changed is observed and no copy is made.
SetNormalizevoid
public void SetNormalize(bool normalize);Sets Normalize under the regeneration-queue rules. Enables min/max normalization during noise image/volume generation, default true. Changes data mapping rather than display alone. Separately normalized chunks can have different contrast; a constant field becomes zero brightness before invert. Changes require queued generation.
| Name | Type | Default |
|---|---|---|
normalize | bool | — |
normalizeNew Normalize value; see the description for valid range and scope.
SetSeamlessvoid
public void SetSeamless(bool seamless);Sets Seamless under the regeneration-queue rules. Selects blending of an expanded noise field for repetition. Does not guarantee continuity between arbitrary terrain chunks or enable material Repeat. Extra work/memory depends on SeamlessBlendSkirt; visual seam quality was not accepted here.
| Name | Type | Default |
|---|---|---|
seamless | bool | — |
seamlessNew Seamless value; see the description for valid range and scope.
SetSeamlessBlendSkirtvoid
public void SetSeamlessBlendSkirt(float seamlessBlendSkirt);Sets SeamlessBlendSkirt under the regeneration-queue rules. Extra-field fraction for Seamless, default 0.1; setter accepts 0..1, but extreme/large values were not accepted. Even 0 retains a minimum blend region in Noise. Neither pixels nor AA quality. Start with the default for ordinary use.
| Name | Type | Default |
|---|---|---|
seamlessBlendSkirt | float | — |
seamlessBlendSkirtNew SeamlessBlendSkirt value; see the description for valid range and scope.
SetWidthvoid
public void SetWidth(int width);Sets Width under the regeneration-queue rules. Requested positive width, default 512. Setter changes metadata immediately and queues regeneration: the old GetImage can have another size. Bound size for memory/device limits; the Inspector range is not a GPU-allocation guarantee.
| Name | Type | Default |
|---|---|---|
width | int | — |
widthPositive requested dimension; bound memory and await data generation.