You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Avoid calculating dynamic lights when lights are baked into LightmapGI using the static bake mode
This commit is contained in:
@@ -2211,6 +2211,10 @@ void fragment_shader(in SceneData scene_data) {
|
||||
continue; //not masked
|
||||
}
|
||||
|
||||
if (directional_lights.data[i].bake_mode == LIGHT_BAKE_STATIC && bool(instances.data[instance_index].flags & INSTANCE_FLAGS_USE_LIGHTMAP)) {
|
||||
continue; // Statically baked light and object uses lightmap, skip
|
||||
}
|
||||
|
||||
#ifdef LIGHT_TRANSMITTANCE_USED
|
||||
float transmittance_z = transmittance_depth;
|
||||
#ifndef SHADOWS_DISABLED
|
||||
|
||||
@@ -1445,6 +1445,10 @@ void main() {
|
||||
continue; //not masked
|
||||
}
|
||||
|
||||
if (directional_lights.data[i].bake_mode == LIGHT_BAKE_STATIC && bool(instances.data[draw_call.instance_index].flags & INSTANCE_FLAGS_USE_LIGHTMAP)) {
|
||||
continue; // Statically baked light and object uses lightmap, skip.
|
||||
}
|
||||
|
||||
float shadow = 1.0;
|
||||
|
||||
if (directional_lights.data[i].shadow_opacity > 0.001) {
|
||||
@@ -1560,6 +1564,10 @@ void main() {
|
||||
continue; //not masked
|
||||
}
|
||||
|
||||
if (directional_lights.data[i].bake_mode == LIGHT_BAKE_STATIC && bool(instances.data[draw_call.instance_index].flags & INSTANCE_FLAGS_USE_LIGHTMAP)) {
|
||||
continue; // Statically baked light and object uses lightmap, skip.
|
||||
}
|
||||
|
||||
// We're not doing light transmittence
|
||||
|
||||
float shadow = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user