GradientTexture1D
A gradient strip represented by a one-pixel-high Texture2D.
Assign Gradient and Width to generate a Texture2D strip with height 1. A new C# instance has Width=256, UseHdr=false and Gradient=null; pixels have not been generated. Use Width of at least 2 for an interpolated strip because sampling uses i/(Width−1).
Changing the shared Gradient automatically queues strip regeneration. GetImage processes a pending update and returns independent data; do not use per-frame GPU readbacks instead of ordinary Texture2D rendering. Increasing Width increases strip sampling resolution, not the Gradient point count. No mipmaps are generated.
UseHdr switches RGBA8 to RGBAF and does not enable scene glow. Assigning Gradient=null does not clear existing generated pixels: assign a valid gradient of the intended color or create a new resource.
Pixels, regeneration, HDR/LDR and RID continuity were checked in Forward+/Vulkan. Shader sampling, Width=1 interpolation, visual quality and performance were not established by this run.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
GradientTexture1DConstructor
public GradientTexture1D();Creates a texture with no assigned Gradient and no generated pixels. Default parameter values do not mean an image already exists.
Properties3
GradientProperty
public Gradient Gradient { get; set; }Color source, null in the C# constructor by default. This is a shared reference, not a copy. Gradient changes queue pixel regeneration; GetImage synchronously handles a pending update. Assigning null disconnects the source but does not clear pixels already created.
UseHdrProperty
public bool UseHdr { get; set; }False by default: RGBA8 pixels with 0…1 clamping and quantization. True selects RGBAF and retains extended range, including values above 1. This controls texture data format; it does not independently enable glow or HDR window output.
WidthProperty
public int Width { get; set; }Width in pixels, initially 256; height is always 1. The setter accepts 1…16384. Use at least 2 for an interpolated strip: the implementation samples i/(Width−1). This run did not accept Width=1 interpolation.
Methods5
GetGradientGradient
public Gradient GetGradient();Returns the value of GradientTexture1D.Gradient.
GradientThe current Gradient source, or null when unassigned. This is a shared reference, not a copy.
IsUsingHdrbool
public bool IsUsingHdr();Returns the value of GradientTexture1D.UseHdr.
SetGradientvoid
public void SetGradient(Gradient gradient);Assigns the value of GradientTexture1D.Gradient.
| Name | Type | Default |
|---|---|---|
gradient | Gradient | — |
gradientA shared Gradient or null. Null does not remove previously generated pixels.
SetUseHdrvoid
public void SetUseHdr(bool enabled);Assigns the value of GradientTexture1D.UseHdr.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledTrue for RGBAF, false for clamped and quantized RGBA8.
SetWidthvoid
public void SetWidth(int width);Assigns the value of GradientTexture1D.Width.
| Name | Type | Default |
|---|---|---|
width | int | — |
widthWidth in pixels within the accepted range; use at least 2 for a GradientTexture1D transition.