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
一維紋理,其中像素亮度對應於曲線上的點。
說明
一維紋理,像素亮度對應於單位 Curve 資源上的點,可以是灰度圖或紅色圖。這種視覺表達簡化了將曲線儲存為影像檔案的任務。
如果你需要在單個紋理中儲存最多 3 條曲線,請改用 CurveXYZTexture。另見 GradientTexture1D 和 GradientTexture2D。
屬性
resource_local_to_scene |
|
|
|
||
|
列舉
enum TextureMode: 🔗
TextureMode TEXTURE_MODE_RGB = 0
將曲線平均儲存在紅色、綠色和藍色通道上。這會使用更多的顯存,但與唯讀取綠色和藍色值的著色器更相容。
TextureMode TEXTURE_MODE_RED = 1
僅將曲線儲存在紅色通道中。這可以節省顯存,但某些自訂著色器可能無法使用它。
屬性說明
TextureMode texture_mode = 0 🔗
void set_texture_mode(value: TextureMode)
TextureMode get_texture_mode()
生成紋理時應使用的格式。當將 CurveTexture 作為輸入傳遞給 Shader 時,可能需要調整。
紋理寬度(單位為圖元)。較大的值能夠更好地表示高頻資料(例如方向的突變),但會增加生成時間和記憶體佔用。