Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
ImageTexture3D¶
继承: Texture3D < Texture < Resource < RefCounted < Object
具有 3 个维度的纹理。
描述¶
ImageTexture3D 是一种具有宽度、高度、和深度的三维 ImageTexture。另请参阅 ImageTextureLayered。
3D 纹理通常用于存储 FogMaterial 的密度图、Environment 的色彩校正 LUT、GPUParticlesAttractorVectorField3D 的矢量场、和 GPUParticlesCollisionSDF3D 的碰撞图。3D 纹理也可用于自定义着色器。
方法¶
create ( Format format, int width, int height, int depth, bool use_mipmaps, Image[] data ) |
|
void |
方法说明¶
Error create ( Format format, int width, int height, int depth, bool use_mipmaps, Image[] data )
创建具有指定 width
、height
和 depth
的 ImageTexture3D。请参阅 Format 了解 format
选项。如果 use_mipmaps
为 true
,则为该 ImageTexture3D 生成 Mipmaps。
void update ( Image[] data )
将纹理的现有数据替换为 data
中指定的图层。data
的大小必须与用于 create 的参数一致。换句话说,不能通过调用 update 来调整纹理的大小或改变其格式。