Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LightOccluder2D SDF Collision Enable/Disable #90883

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ void RasterizerCanvasGLES3::render_sdf(RID p_render_target, LightOccluderInstanc
while (instance) {
OccluderPolygon *oc = occluder_polygon_owner.get_or_null(instance->occluder);

if (!oc || oc->sdf_vertex_array == 0) {
if (!oc || oc->sdf_vertex_array == 0 || !instance->sdf_collision) {
instance = instance->next;
continue;
}
Expand Down
2 changes: 2 additions & 0 deletions servers/rendering/renderer_canvas_cull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,8 @@ void RendererCanvasCull::canvas_light_occluder_set_polygon(RID p_occluder, RID p
void RendererCanvasCull::canvas_light_occluder_set_as_sdf_collision(RID p_occluder, bool p_enable) {
RendererCanvasRender::LightOccluderInstance *occluder = canvas_light_occluder_owner.get_or_null(p_occluder);
ERR_FAIL_NULL(occluder);

occluder->sdf_collision = p_enable;
}

void RendererCanvasCull::canvas_light_occluder_set_transform(RID p_occluder, const Transform2D &p_xform) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ void RendererCanvasRenderRD::render_sdf(RID p_render_target, LightOccluderInstan
while (instance) {
OccluderPolygon *co = occluder_polygon_owner.get_or_null(instance->occluder);

if (!co || co->sdf_index_array.is_null()) {
if (!co || co->sdf_index_array.is_null() || !instance->sdf_collision) {
instance = instance->next;
continue;
}
Expand Down
Loading