Fixed unshaded mode lightmaps

This commit is contained in:
Oxi 2024-02-16 01:13:12 +00:00
parent 4b7776e31b
commit 1815871b90
2 changed files with 38 additions and 29 deletions

View File

@ -3112,6 +3112,13 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
if (pass == 0) {
spec_constants |= SceneShaderGLES3::BASE_PASS;
if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_OMNI;
spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_SPOT;
spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_DIRECTIONAL;
spec_constants |= SceneShaderGLES3::DISABLE_LIGHTMAP;
} else {
if (inst->omni_light_gl_cache.size() == 0) {
spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_OMNI;
}
@ -3146,6 +3153,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
} else {
spec_constants |= SceneShaderGLES3::DISABLE_LIGHTMAP;
}
}
} else {
// Only base pass uses the radiance map.
spec_constants &= ~SceneShaderGLES3::USE_RADIANCE_MAP;

View File

@ -1157,6 +1157,7 @@ void RendererSceneRenderRD::render_scene(const Ref<RenderSceneBuffers> &p_render
render_data.lights = &empty;
render_data.reflection_probes = &empty;
render_data.voxel_gi_instances = &empty;
render_data.lightmaps = &empty;
}
if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_UNSHADED ||