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

LightOccluder2D -- SDF Collision is always enabled #90882

Closed
cosparks opened this issue Apr 19, 2024 · 0 comments · Fixed by #90883
Closed

LightOccluder2D -- SDF Collision is always enabled #90882

cosparks opened this issue Apr 19, 2024 · 0 comments · Fixed by #90883

Comments

@cosparks
Copy link
Contributor

Tested versions

Reproducible on 4.2.1 and latest on master.

System information

Windows 10 - Vulkan Forward+

Issue description

On LightOccluder2D, disabling SDF collisions has no effect. It looks like this because in method RendererCanvasCull::canvas_light_occluder_set_as_sdf_collision in the file godot-engine\servers\rendering\renderer_canvas_cull.cpp, the parameter p_enable is never used:

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);
}

Proposed change:

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->enabled = p_enable;
}

Steps to reproduce

  • create a scene with GPUParticles2D and LightOccluder2D
  • add ParticleProcessMaterial to gpu particles instance and set collision mode to rigid
  • add occluder polygon to light occluder instance and create a shape
  • place light occluder in path of particles -- note that particles collide with it and bounce off
  • disable SDF collision on light occluder -- note that particles continue to collide

Minimal reproduction project (MRP)

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants