Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
LightmapGIData¶
继承: Resource < RefCounted < Object
包含用于 LightmapGI 的烘焙光照贴图和动态对象探测数据。
描述¶
LightmapGIData 包含用于 LightmapGI 的烘焙光照贴图和动态对象探测数据。在 LightmapGI 中每当光照贴图被烘焙时都会替换它。
属性¶
|
方法¶
void |
add_user ( NodePath path, Rect2 uv_scale, int slice_index, int sub_instance ) |
void |
clear_users ( ) |
get_user_count ( ) const |
|
get_user_path ( int user_idx ) const |
|
is_using_spherical_harmonics ( ) const |
|
void |
set_uses_spherical_harmonics ( bool uses_spherical_harmonics ) |
属性说明¶
TextureLayered light_texture
void set_light_texture ( TextureLayered value )
TextureLayered get_light_texture ( )
由光照贴图器生成的光照贴图图集纹理。
已弃用。光照贴图图集现在可以有多个纹理。请参阅 lightmap_textures。
TextureLayered[] lightmap_textures = []
void set_lightmap_textures ( TextureLayered[] value )
TextureLayered[] get_lightmap_textures ( )
由光照贴图器生成的光照贴图图集纹理。
方法说明¶
void add_user ( NodePath path, Rect2 uv_scale, int slice_index, int sub_instance )
添加一个在该 LightmapGIData 中被视为已烘焙的对象。
void clear_users ( )
清除在该 LightmapGIData 中被视为已烘焙的所有对象。
int get_user_count ( ) const
返回在该 LightmapGIData 中被视为烘焙的对象的数量。
NodePath get_user_path ( int user_idx ) const
返回索引 user_idx
处烘焙对象的 NodePath。
bool is_using_spherical_harmonics ( ) const
如果为 true
,则光照贴图使用定向信息烘焙。另请参阅 LightmapGI.directional。
void set_uses_spherical_harmonics ( bool uses_spherical_harmonics )
如果 uses_spherical_harmonics
为 true
,则告诉引擎将光照贴图数据视为使用了定向信息烘焙的。
注意:在已烘焙的光照贴图上更改此值不会导致再次烘焙它们。这意味着在再次烘焙光照贴图之前,材质外观将看起来不正确,在这种情况下,此处设置的值将被丢弃,因为整个 LightmapGIData 资源被光照贴图器替换。