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.

LightmapGIData

繼承: Resource < RefCounted < Object

包含用於 LightmapGI 的烘焙光照貼圖和動態物件探測資料。

說明

LightmapGIData 包含用於 LightmapGI 的烘焙光照貼圖和動態物件探測資料。在 LightmapGI 中每當光照貼圖被烘焙時都會替換它。

屬性

TextureLayered

light_texture

Array[TextureLayered]

lightmap_textures

[]

Array[TextureLayered]

shadowmask_textures

[]

方法

void

add_user(path: NodePath, uv_scale: Rect2, slice_index: int, sub_instance: int)

void

clear_users()

int

get_user_count() const

NodePath

get_user_path(user_idx: int) const

bool

is_using_spherical_harmonics() const

void

set_uses_spherical_harmonics(uses_spherical_harmonics: bool)


列舉

enum ShadowmaskMode: 🔗

ShadowmaskMode SHADOWMASK_MODE_NONE = 0

Shadowmasking is disabled. No shadowmask texture will be created when baking lightmaps. Existing shadowmask textures will be removed during baking.

ShadowmaskMode SHADOWMASK_MODE_REPLACE = 1

Shadowmasking is enabled. Directional shadows that are outside the DirectionalLight3D.directional_shadow_max_distance will be rendered using the shadowmask texture. Shadows that are inside the range will be rendered using real-time shadows exclusively. This mode allows for more precise real-time shadows up close, without the potential "smearing" effect that can occur when using lightmaps with a high texel size. The downside is that when the camera moves fast, the transition between the real-time light and shadowmask can be obvious. Also, objects that only have shadows baked in the shadowmask (and no real-time shadows) won't display any shadows up close.

ShadowmaskMode SHADOWMASK_MODE_OVERLAY = 2

Shadowmasking is enabled. Directional shadows will be rendered with real-time shadows overlaid on top of the shadowmask texture. This mode makes for smoother shadow transitions when the camera moves fast, at the cost of a potential smearing effect for directional shadows that are up close (due to the real-time shadow being mixed with a low-resolution shadowmask). Objects that only have shadows baked in the shadowmask (and no real-time shadows) will keep their shadows up close.


屬性說明

TextureLayered light_texture 🔗

已棄用: The lightmap atlas can now contain multiple textures. See lightmap_textures.

The lightmap atlas texture generated by the lightmapper.


Array[TextureLayered] lightmap_textures = [] 🔗

The lightmap atlas textures generated by the lightmapper.


Array[TextureLayered] shadowmask_textures = [] 🔗

The shadowmask atlas textures generated by the lightmapper.


方法說明

void add_user(path: NodePath, uv_scale: Rect2, slice_index: int, sub_instance: int) 🔗

新增一個在該 LightmapGIData 中被視為已烘焙的物件。


void clear_users() 🔗

清除在該 LightmapGIData 中被視為已烘焙的所有物件。


int get_user_count() const 🔗

返回在該 LightmapGIData 中被視為烘焙的物件的數量。


NodePath get_user_path(user_idx: int) const 🔗

返回索引 user_idx 處烘焙對象的 NodePath


bool is_using_spherical_harmonics() const 🔗

如果為 true,則光照貼圖使用定向資訊烘焙。另請參閱 LightmapGI.directional


void set_uses_spherical_harmonics(uses_spherical_harmonics: bool) 🔗

如果 uses_spherical_harmonicstrue,則告訴引擎將光照貼圖資料視為使用了定向資訊烘焙的。

注意:在已烘焙的光照貼圖上更改此值不會導致再次烘焙它們。這意味著在再次烘焙光照貼圖之前,材質外觀將看起來不正確,在這種情況下,此處設定的值將被丟棄,因為整個 LightmapGIData 資源被光照貼圖器替換。