CurveTexture
A one-pixel-high data strip generated from Curve.
CurveTexture generates a float texture: one value in RGBF or RF via TextureMode. Assign Curve sources and Width (32…4096). Sources are shared references whose Changed notification regenerates pixels; an absent curve supplies a zero channel. Values above 1 survive without a separate HDR flag.
Sampling uses Curve.SampleBaked(i/Width), not i/(Width−1). The final pixel does not sample exactly 1. Prepare a 0…1 Curve domain for a full-range lookup: other domains are not automatically remapped. No mipmaps are generated.
In the current implementation inherited GetImage() returns null even when GPU pixels exist. For occasional diagnostics obtain an Image through RenderingServer.Texture2DGet(texture.GetRid()); dispose the returned Image after use. Avoid per-frame GPU readbacks. Editing source BakeResolution requires EmitChanged() to refresh the texture.
GPU data, shared-source updates and resource persistence were checked in Windows Forward+/Vulkan. This run does not establish shader sampling, performance or graphics quality.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
CurveTextureConstructor
public CurveTexture();Creates a width-256 strip with no Curve sources. Construction does not guarantee initialized pixels before the first update.
Properties3
CurveProperty
public Curve Curve { get; set; }A shared Curve reference, initially null. Its Changed notification regenerates pixels. Null fills the channel with zero. Sampling always uses 0…1 even when the Curve domain differs.
TextureModeProperty
public CurveTexture.TextureModeEnum TextureMode { get; set; }Rgb by default: RGBF with the same value in all three channels. Red uses single-channel RF. Float data retains values above 1; the mode does not enable glow.
WidthProperty
public int Width { get; set; }Strip width 32…4096, initially 256; height is always 1. Samples use i/Width, so the final pixel does not reach coordinate 1. No mipmaps are generated.
Methods5
GetCurveCurve
public Curve GetCurve();A shared Curve reference, initially null. Its Changed notification regenerates pixels. Null fills the channel with zero. Sampling always uses 0…1 even when the Curve domain differs.
CurveThe current shared Curve or null, not a copy.
GetTextureModeCurveTexture.TextureModeEnum
public CurveTexture.TextureModeEnum GetTextureMode();Rgb by default: RGBF with the same value in all three channels. Red uses single-channel RF. Float data retains values above 1; the mode does not enable glow.
CurveTexture.TextureModeEnumRgb by default: RGBF with the same value in all three channels. Red uses single-channel RF. Float data retains values above 1; the mode does not enable glow.
SetCurvevoid
public void SetCurve(Curve curve);A shared Curve reference, initially null. Its Changed notification regenerates pixels. Null fills the channel with zero. Sampling always uses 0…1 even when the Curve domain differs.
| Name | Type | Default |
|---|---|---|
curve | Curve | — |
curveA shared Curve reference, initially null. Its Changed notification regenerates pixels. Null fills the channel with zero. Sampling always uses 0…1 even when the Curve domain differs.
SetTextureModevoid
public void SetTextureMode(CurveTexture.TextureModeEnum textureMode);Rgb by default: RGBF with the same value in all three channels. Red uses single-channel RF. Float data retains values above 1; the mode does not enable glow.
| Name | Type | Default |
|---|---|---|
textureMode | CurveTexture.TextureModeEnum | — |
textureModeRgb by default: RGBF with the same value in all three channels. Red uses single-channel RF. Float data retains values above 1; the mode does not enable glow.
SetWidthvoid
public void SetWidth(int width);Strip width 32…4096, initially 256; height is always 1. Samples use i/Width, so the final pixel does not reach coordinate 1. No mipmaps are generated.
| Name | Type | Default |
|---|---|---|
width | int | — |
widthStrip width 32…4096, initially 256; height is always 1. Samples use i/Width, so the final pixel does not reach coordinate 1. No mipmaps are generated.
CurveTexture.TextureModeEnum
| Value | Description |
|---|---|
Red = 1 | Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this. |
Rgb = 0 | Store the curve equally across the red, green and blue channels. This uses more video memory, but is more compatible with shaders that only read the green and blue values. |