You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Ensure contact shadows are only used when lights use them.
This commit is contained in:
@@ -4132,7 +4132,17 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
|
|||||||
|
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
|
||||||
state.used_contact_shadows = true;
|
state.used_contact_shadows = false;
|
||||||
|
|
||||||
|
for (int i = 0; i < p_light_cull_count; i++) {
|
||||||
|
|
||||||
|
ERR_BREAK(i >= RenderList::MAX_LIGHTS);
|
||||||
|
|
||||||
|
LightInstance *li = light_instance_owner.getptr(p_light_cull_result[i]);
|
||||||
|
if (li->light_ptr->param[VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE] > CMP_EPSILON) {
|
||||||
|
state.used_contact_shadows = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!storage->config.no_depth_prepass && storage->frame.current_rt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { //detect with state.used_contact_shadows too
|
if (!storage->config.no_depth_prepass && storage->frame.current_rt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { //detect with state.used_contact_shadows too
|
||||||
//pre z pass
|
//pre z pass
|
||||||
|
|||||||
Reference in New Issue
Block a user