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

Vulkan: SoftBody3D is incorrectly culled due to its visibility AABB not being updated #52992

Closed
Tracked by #45333
jcostello opened this issue Sep 24, 2021 · 6 comments · Fixed by #72631
Closed
Tracked by #45333

Comments

@jcostello
Copy link
Contributor

Godot version

v4.0.dev.custom_build [88b347d]

System information

Ubuntu 21.04. RTX 2060

Issue description

This issue is very strange but like the title says. If the softbody plane mesh start above the camera, it is complete invisible even if the soft body is in direction with the camera view.

Steps to reproduce

Use the InvisibleCloth.tscn scene from the Minimal reproduction project

Minimal reproduction project

Godot 4.0 SoftBody.zip

@Calinou
Copy link
Member

Calinou commented Sep 24, 2021

This happens because the visibility AABB isn't automatically adjust to account for the displayed vertices. I'm not sure if it's possible to do this in a cheap way.

In the meantime, increase the Extra Cull Margin property on the mesh by a few units so that the frustum/occlusion culling is done in a more forgiving way. Don't make this value too large or the mesh won't be culled when it could be.

@jcostello
Copy link
Contributor Author

Good to know that. Since this is not related to soft bodies then the issue can be closed or rename to explain the cause

@pouleyKetchoupp
Copy link
Contributor

This happens because the visibility AABB isn't automatically adjust to account for the displayed vertices. I'm not sure if it's possible to do this in a cheap way.

Soft bodies are supposed to update their AABB after calculating the new vertex positions, but there's probably a bug either in godot physics or in the vulkan renderer.

RS::get_singleton()->mesh_set_custom_aabb(mesh, p_aabb);

@jcostello Do you know if it happens also in 3.x or just in 4.0?

@jcostello
Copy link
Contributor Author

@pouleyKetchoupp 4.0

@James103
Copy link

James103 commented Feb 4, 2022

Can confirm using the originally linked project in Godot 4.0 alpha 1.

@James103
Copy link

Still occurs in Godot 4.0 alpha 4 with the originally linked project.
Workaround: Move the SoftBody so that it is in view of the Camera or increase Extra Cull Margin.

@Calinou Calinou changed the title Soft-body with plane when the camera start bellow the plane even when the soft body passes in front of the camera Vulkan: SoftBody3D is incorrectly culled due to its visibility AABB not being updated Sep 9, 2022
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.

4 participants