LightmapGIData
Inherits:Resource<RefCounted<Object
Contains baked lightmap and dynamic object probe data forLightmapGI.
Description
LightmapGIData contains baked lightmap and dynamic object probe data forLightmapGI. It is replaced every time lightmaps are baked inLightmapGI.
Properties
| ||
|
Methods
add_user(path:NodePath, uv_scale:Rect2, slice_index:int, sub_instance:int) | |
get_user_path(user_idx:int)const | |
set_uses_spherical_harmonics(uses_spherical_harmonics:bool) |
Enumerations
enumShadowmaskMode:🔗
ShadowmaskModeSHADOWMASK_MODE_NONE =0
Shadowmasking is disabled. No shadowmask texture will be created when baking lightmaps. Existing shadowmask textures will be removed during baking.
ShadowmaskModeSHADOWMASK_MODE_REPLACE =1
Shadowmasking is enabled. Directional shadows that are outside theDirectionalLight3D.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.
ShadowmaskModeSHADOWMASK_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.
Property Descriptions
TextureLayeredlight_texture🔗
TextureLayeredget_light_texture()
Deprecated: The lightmap atlas can now contain multiple textures. Seelightmap_textures.
The lightmap atlas texture generated by the lightmapper.
Array[TextureLayered]lightmap_textures =[]
🔗
Array[TextureLayered]get_lightmap_textures()
The lightmap atlas textures generated by the lightmapper.
Array[TextureLayered]shadowmask_textures =[]
🔗
Array[TextureLayered]get_shadowmask_textures()
The shadowmask atlas textures generated by the lightmapper.
Method Descriptions
voidadd_user(path:NodePath, uv_scale:Rect2, slice_index:int, sub_instance:int)🔗
Adds an object that is considered baked within thisLightmapGIData.
Clear all objects that are considered baked within thisLightmapGIData.
Returns the number of objects that are considered baked within thisLightmapGIData.
NodePathget_user_path(user_idx:int)const🔗
Returns theNodePath of the baked object at indexuser_idx
.
boolis_using_spherical_harmonics()const🔗
Iftrue
, lightmaps were baked with directional information. See alsoLightmapGI.directional.
voidset_uses_spherical_harmonics(uses_spherical_harmonics:bool)🔗
Ifuses_spherical_harmonics
istrue
, tells the engine to treat the lightmap data as if it was baked with directional information.
Note: Changing this value on already baked lightmaps will not cause them to be baked again. This means the material appearance will look incorrect until lightmaps are baked again, in which case the value set here is discarded as the entireLightmapGIData resource is replaced by the lightmapper.