CurveTexture

Inherits: Texture2D < Texture < Resource < RefCounted < Object

A texture that shows a curve.

Description

Renders a given Curve provided to it. Simplifies the task of drawing curves and/or saving them as image files.

If you need to store up to 3 curves within a single texture, use CurveXYZTexture instead. See also GradientTexture1D and GradientTexture2D.

Properties

Curve

curve

TextureMode

texture_mode

0

int

width

256

Enumerations

enum TextureMode:

  • TEXTURE_MODE_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.

  • TEXTURE_MODE_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.

Property Descriptions

Setter

set_curve(value)

Getter

get_curve()

The Curve that is rendered onto the texture.


Default

0

Setter

set_texture_mode(value)

Getter

get_texture_mode()

The format the texture should be generated with. When passing a CurveTexture as a input to a Shader, this may need to be adjusted.


Default

256

Setter

set_width(value)

Getter

get_width()

The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage.