Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
CurveTexture¶
Inherits: Texture2D < Texture < Resource < RefCounted < Object
A 1D texture where pixel brightness corresponds to points on a curve.
Description¶
A 1D texture where pixel brightness corresponds to points on a Curve resource, either in grayscale or in red. This visual representation simplifies the task of saving curves 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¶
resource_local_to_scene |
|
|
|
||
|
Enumerations¶
enum TextureMode:
TextureMode TEXTURE_MODE_RGB = 0
将曲线平均存储在红色、绿色和蓝色通道上。这会使用更多的显存,但与只读取绿色和蓝色值的着色器更兼容。
TextureMode TEXTURE_MODE_RED = 1
仅将曲线存储在红色通道中。这可以节省显存,但某些自定义着色器可能无法使用它。
Property Descriptions¶
Curve curve
渲染到纹理上的 Curve。
TextureMode texture_mode = 0
void set_texture_mode ( TextureMode value )
TextureMode get_texture_mode ( )
生成纹理时应使用的格式。当将 CurveTexture 作为输入传递给 Shader 时,可能需要调整。
int width = 256
纹理宽度(单位为像素)。较大的值能够更好地表示高频数据(例如方向的突变),但会增加生成时间和内存占用。