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¶
继承: Texture2D < Texture < Resource < RefCounted < Object
一维纹理,其中像素亮度对应于曲线上的点。
描述¶
1D 纹理,其中像素亮度对应于 Curve 资源上的点(以灰度或红色来表示)。这种视觉表示简化了将曲线保存为图像文件的任务。
如果需要在单个纹理中,存储最多 3 条曲线,请改用 CurveXYZTexture。另见 GradientTexture1D 和 GradientTexture2D。
属性¶
resource_local_to_scene |
|
|
|
||
|
枚举¶
enum TextureMode:
TextureMode TEXTURE_MODE_RGB = 0
将曲线平均存储在红色、绿色和蓝色通道上。这会使用更多的显存,但与只读取绿色和蓝色值的着色器更兼容。
TextureMode TEXTURE_MODE_RED = 1
仅将曲线存储在红色通道中。这可以节省显存,但某些自定义着色器可能无法使用它。
属性说明¶
Curve curve
渲染到纹理上的 Curve。
TextureMode texture_mode = 0
void set_texture_mode ( TextureMode value )
TextureMode get_texture_mode ( )
生成纹理时应使用的格式。当将 CurveTexture 作为输入传递给 Shader 时,可能需要调整。
int width = 256
纹理宽度(单位为像素)。较大的值能够更好地表示高频数据(例如方向的突变),但会增加生成时间和内存占用。