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

Z-fighting occurs with collision shape fill or when a CSG node is selected due to gizmo drawing #99184

Open
fire opened this issue Nov 13, 2024 · 3 comments · May be fixed by #100211
Open

Z-fighting occurs with collision shape fill or when a CSG node is selected due to gizmo drawing #99184

fire opened this issue Nov 13, 2024 · 3 comments · May be fixed by #100211

Comments

@fire
Copy link
Member

fire commented Nov 13, 2024

Tested versions

  • Reproducible in Godot Engine 4.3 stable
  • Reproducible in Godot Engine master 76fa7b2

System information

Windows 11

Issue description

#94321 @aaronfranke mentioned that CSG has Z-fighting when a CSG node is selected

Steps to reproduce

Select the second csg node and fly around.

Recording.2024-11-13.091923.mp4

Minimal reproduction project (MRP)

csg_flicker.zip

@fire fire changed the title Avoid massive Z-fighting when a CSG box is selected. Avoid massive Z-fighting when a CSG node is selected. Nov 13, 2024
@JekSun97
Copy link
Contributor

I also mentioned this problem here #96969

@Calinou Calinou changed the title Avoid massive Z-fighting when a CSG node is selected. Z-fighting occurs when a CSG node is selected due to gizmo drawing Nov 13, 2024
@Calinou
Copy link
Member

Calinou commented Nov 13, 2024

This can be fixed by offsetting the gizmo's vertices in a way similar to the BaseMaterial3D's grow property. This is not currently exposed in the 3D material gizmos, so it should be done (or implemented manually on the CPU, but that would be slower).

If only we had glPolygonOffset() in modern low-level graphics APIs... It would greatly simplify the implementation of godotengine/godot-proposals#1000 as well.

@Calinou Calinou changed the title Z-fighting occurs when a CSG node is selected due to gizmo drawing Z-fighting occurs with collision shape fill or when a CSG node is selected due to gizmo drawing Jan 23, 2025
@RevoluPowered
Copy link
Contributor

RevoluPowered commented Jan 24, 2025

I just tested my own project and had the same problem, for me #100211 resolves the issue.

I updated my original issue and posted here for search indexing.
Editor Rendering is bugged with PR #90644 - Add CollisionShape3D custom debug colors #101939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Assess
Development

Successfully merging a pull request may close this issue.

5 participants