LightmapGI
Hereda: VisualInstance3D < Node3D < Node < Object
Calcula y almacena lightmaps procesados para una iluminación global rápida.
Descripción
The LightmapGI node is used to compute and store baked lightmaps. Lightmaps are used to provide high-quality indirect lighting with very little light leaking. LightmapGI can also provide rough reflections using spherical harmonics if directional is enabled. Dynamic objects can receive indirect lighting thanks to light probes, which can be automatically placed by setting generate_probes_subdiv to a value other than GENERATE_PROBES_DISABLED. Additional lightmap probes can also be added by creating LightmapProbe nodes. The downside is that lightmaps are fully static and cannot be baked in an exported project. Baking a LightmapGI node is also slower compared to VoxelGI.
Procedural generation: Lightmap baking functionality is only available in the editor. This means LightmapGI is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use VoxelGI or SDFGI instead (see Environment.sdfgi_enabled).
Performance: LightmapGI provides the best possible run-time performance for global illumination. It is suitable for low-end hardware including integrated graphics and mobile devices.
Note: Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again.
Note: Lightmap baking on CSGShape3Ds and PrimitiveMeshes is not supported, as these cannot store UV2 data required for baking.
Note: If no custom lightmappers are installed, LightmapGI can only be baked from devices that support the Forward+ or Mobile renderers.
Note: The LightmapGI node only bakes light data for child nodes of its parent. Nodes further up the hierarchy of the scene will not be baked.
Tutoriales
Propiedades
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Enumeraciones
enum BakeQuality: 🔗
BakeQuality BAKE_QUALITY_LOW = 0
Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count.
BakeQuality BAKE_QUALITY_MEDIUM = 1
Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count.
BakeQuality BAKE_QUALITY_HIGH = 2
High bake quality (slow bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count.
BakeQuality BAKE_QUALITY_ULTRA = 3
Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_ray_count and ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count.
enum GenerateProbes: 🔗
GenerateProbes GENERATE_PROBES_DISABLED = 0
No generar sondas de lightmaps para iluminar objetos dinámicos.
GenerateProbes GENERATE_PROBES_SUBDIV_4 = 1
Nivel más bajo de subdivisión (tiempos de procesado más rápidos, tamaños de archivo más pequeños).
GenerateProbes GENERATE_PROBES_SUBDIV_8 = 2
Nivel bajo de subdivisión (tiempos de procesado rápidos, tamaños de archivo pequeños).
GenerateProbes GENERATE_PROBES_SUBDIV_16 = 3
Nivel alto de subdivisión (tiempos de procesado lentos, tamaños de archivo grandes).
GenerateProbes GENERATE_PROBES_SUBDIV_32 = 4
Nivel más alto de subdivisión (tiempos de procesado más lentos, tamaños de archivo más grandes).
enum BakeError: 🔗
BakeError BAKE_ERROR_OK = 0
El procesado del lightmap se realizó correctamente.
BakeError BAKE_ERROR_NO_SCENE_ROOT = 1
El procesado del lightmap falló porque no se pudo acceder al nodo raíz de la escena editada.
BakeError BAKE_ERROR_FOREIGN_DATA = 2
El procesado del lightmap falló porque el recurso de datos del lightmap está integrado en un recurso externo.
BakeError BAKE_ERROR_NO_LIGHTMAPPER = 3
El procesado del lightmap falló porque no hay un mapeador de luz disponible en esta compilación de Godot.
BakeError BAKE_ERROR_NO_SAVE_PATH = 4
El procesado del lightmap falló porque la ruta de guardado de LightmapGIData no está configurada en el recurso.
BakeError BAKE_ERROR_NO_MESHES = 5
El procesado del lightmap falló porque no hay mallas cuyo GeometryInstance3D.gi_mode sea GeometryInstance3D.GI_MODE_STATIC y con un mapeo UV2 válido en la escena actual. Es posible que deba seleccionar escenas 3D en el dock de importación y cambiar su modo de iluminación global en consecuencia.
BakeError BAKE_ERROR_MESHES_INVALID = 6
El procesado del lightmap falló porque el mapeador de luz no pudo analizar algunas de las mallas marcadas como estáticas para el procesado.
BakeError BAKE_ERROR_CANT_CREATE_IMAGE = 7
El procesado del lightmap falló porque la imagen resultante no se pudo guardar o importar en Godot después de guardarla.
BakeError BAKE_ERROR_USER_ABORTED = 8
El usuario abortó la operación de procesado del lightmap (normalmente haciendo clic en el botón Cancelar en el diálogo de progreso).
BakeError BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL = 9
El procesado del lightmap falló porque el tamaño máximo de la textura es demasiado pequeño para que quepan algunas de las mallas marcadas para el procesado.
BakeError BAKE_ERROR_LIGHTMAP_TOO_SMALL = 10
El procesado del lightmap falló porque el lightmap es demasiado pequeño.
BakeError BAKE_ERROR_ATLAS_TOO_SMALL = 11
El procesado del lightmap falló porque el lightmap no pudo caber en un atlas.
enum EnvironmentMode: 🔗
EnvironmentMode ENVIRONMENT_MODE_DISABLED = 0
Ignorar la iluminación del entorno al procesar lightmaps.
EnvironmentMode ENVIRONMENT_MODE_SCENE = 1
Use the scene's environment lighting when baking lightmaps.
Note: If baking lightmaps in a scene with no WorldEnvironment node, this will act like ENVIRONMENT_MODE_DISABLED. The editor's preview sky and sun is not taken into account by LightmapGI when baking lightmaps.
EnvironmentMode ENVIRONMENT_MODE_CUSTOM_SKY = 2
Utiliza environment_custom_sky como fuente de iluminación ambiental al procesar lightmaps.
EnvironmentMode ENVIRONMENT_MODE_CUSTOM_COLOR = 3
Utiliza environment_custom_color multiplicado por environment_custom_energy como fuente constante de iluminación ambiental al procesar lightmaps.
Descripciones de Propiedades
El sesgo que se usará al calcular las sombras. Aumentar bias puede corregir el acné de sombra en el lightmap procesado resultante, pero puede introducir el efecto de peter-panning (sombras que no se conectan con sus emisores). Las sombras en tiempo real de Light3D no se ven afectadas por esta propiedad bias.
float bounce_indirect_energy = 1.0 🔗
El multiplicador de energía para cada rebote. Los valores más altos harán que la iluminación indirecta sea más brillante. Un valor de 1.0 representa un comportamiento físicamente preciso, pero se pueden usar valores más altos para hacer que la iluminación indirecta se propague de manera más visible cuando se usa un número bajo de rebotes. Esto se puede usar para acelerar los tiempos de procesado al disminuir el número de bounces y luego aumentar bounce_indirect_energy.
Nota: bounce_indirect_energy solo tiene efecto si bounces se establece en un valor mayor o igual a 1.
Número de rebotes de luz que se tienen en cuenta durante el procesado. Los valores más altos dan como resultado una iluminación más brillante y realista, a costa de tiempos de procesado más largos. Si se establece en 0, solo se procesa la iluminación del entorno, la luz directa y la iluminación emisiva.
CameraAttributes camera_attributes 🔗
void set_camera_attributes(value: CameraAttributes)
CameraAttributes get_camera_attributes()
El recurso CameraAttributes que especifica los niveles de exposición para procesar. La exposición automática y las propiedades de no exposición se ignorarán. La configuración de exposición debe utilizarse para reducir el rango dinámico presente durante el procesado. Si la exposición es demasiado alta, el LightmapGI tendrá artefactos de bandas o puede tener artefactos de sobreexposición.
The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if use_denoiser is true and ProjectSettings.rendering/lightmapping/denoising/denoiser is set to JNLM.
float denoiser_strength = 0.1 🔗
La fuerza del paso de eliminación de ruido aplicado a los lightmaps generados. Solo es efectivo si use_denoiser es true y ProjectSettings.rendering/lightmapping/denoising/denoiser está establecido en JNLM.
If true, bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked (Light3D.light_bake_mode set to Light3D.BAKE_STATIC and with Light3D.editor_only set to false). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes.
Note: The property's name has no relationship with DirectionalLight3D. directional works with all light types.
Color environment_custom_color = Color(1, 1, 1, 1) 🔗
El color que se utilizará para la iluminación del entorno. Solo es efectivo si environment_mode es ENVIRONMENT_MODE_CUSTOM_COLOR.
float environment_custom_energy = 1.0 🔗
El multiplicador de color que se utilizará para la iluminación del entorno. Solo es efectivo si environment_mode es ENVIRONMENT_MODE_CUSTOM_COLOR.
El cielo que se utilizará como fuente de iluminación del entorno. Solo es efectivo si environment_mode es ENVIRONMENT_MODE_CUSTOM_SKY.
EnvironmentMode environment_mode = 1 🔗
void set_environment_mode(value: EnvironmentMode)
EnvironmentMode get_environment_mode()
El modo de entorno que se utilizará al procesar lightmaps.
GenerateProbes generate_probes_subdiv = 2 🔗
void set_generate_probes(value: GenerateProbes)
GenerateProbes get_generate_probes()
El nivel de subdivisión que se utilizará al generar automáticamente LightmapProbes para la iluminación de objetos dinámicos. Los valores más altos dan como resultado una iluminación indirecta más precisa en los objetos dinámicos, a costa de tiempos de procesado más largos y archivos de mayor tamaño.
Nota: Los LightmapProbes generados automáticamente no son visibles como nodos en el dock del árbol de escenas y no se pueden modificar de esta manera después de generarlos.
Nota: Independientemente de generate_probes_subdiv, la iluminación directa en objetos dinámicos siempre se aplica utilizando nodos Light3D en tiempo real.
Si es true, ignora la iluminación del entorno al procesar lightmaps.
LightmapGIData light_data 🔗
void set_light_data(value: LightmapGIData)
LightmapGIData get_light_data()
El LightmapGIData asociado a este nodo LightmapGI. Este recurso se crea automáticamente después del procesado y no está destinado a ser creado manualmente.
int max_texture_size = 16384 🔗
El tamaño máximo de textura para el atlas de texturas generado. Los valores más altos darán como resultado la generación de menos divisiones, pero es posible que no funcionen en todo el hardware como resultado de las limitaciones de hardware en los tamaños de textura. Deja max_texture_size en su valor predeterminado de 16384 si no estás seguro.
BakeQuality quality = 1 🔗
void set_bake_quality(value: BakeQuality)
BakeQuality get_bake_quality()
El preajuste de calidad que se utilizará al procesar lightmaps. Esto afecta los tiempos de procesado, pero los tamaños de los archivos de salida siguen siendo prácticamente idénticos en todos los niveles de calidad.
Para acelerar aún más los tiempos de procesado, disminuye bounces, desactiva use_denoiser y/o disminuye texel_scale.
Para aumentar aún más la calidad, activa supersampling y/o aumenta texel_scale.
ShadowmaskMode shadowmask_mode = 0 🔗
void set_shadowmask_mode(value: ShadowmaskMode)
ShadowmaskMode get_shadowmask_mode()
Experimental: Esta propiedad podría ser modificada o eliminada en versiones futuras.
The shadowmasking policy to use for directional shadows on static objects that are baked with this LightmapGI instance.
Shadowmasking allows DirectionalLight3D nodes to cast shadows even outside the range defined by their DirectionalLight3D.directional_shadow_max_distance property. This is done by baking a texture that contains a shadowmap for the directional light, then using this texture according to the current shadowmask mode.
Note: The shadowmask texture is only created if shadowmask_mode is not LightmapGIData.SHADOWMASK_MODE_NONE. To see a difference, you need to bake lightmaps again after switching from LightmapGIData.SHADOWMASK_MODE_NONE to any other mode.
If true, lightmaps are baked with the texel scale multiplied with supersampling_factor and downsampled before saving the lightmap (so the effective texel density is identical to having supersampling disabled).
Supersampling provides increased lightmap quality with less noise, smoother shadows and better shadowing of small-scale features in objects. However, it may result in significantly increased bake times and memory usage while baking lightmaps. Padding is automatically adjusted to avoid increasing light leaking.
float supersampling_factor = 2.0 🔗
The factor by which the texel density is multiplied for supersampling. For best results, use an integer value. While fractional values are allowed, they can result in increased light leaking and a blurry lightmap.
Higher values may result in better quality, but also increase bake times and memory usage while baking.
See supersampling for more information.
Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times.
For example, doubling texel_scale doubles the lightmap texture resolution for all objects on each axis, so it will quadruple the texel count.
If true, uses a GPU-based denoising algorithm on the generated lightmap. This eliminates most noise within the generated lightmap at the cost of longer bake times. File sizes are generally not impacted significantly by the use of a denoiser, although lossless compression may do a better job at compressing a denoised image.
bool use_texture_for_bounces = true 🔗
If true, a texture with the lighting information will be generated to speed up the generation of indirect lighting at the cost of some accuracy. The geometry might exhibit extra light leak artifacts when using low resolution lightmaps or UVs that stretch the lightmap significantly across surfaces. Leave use_texture_for_bounces at its default value of true if unsure.
Note: use_texture_for_bounces only has an effect if bounces is set to a value greater than or equal to 1.