Repository navigation
Poly Edit: hide edges behind the model; don't draw lines inside n-gons - #242
Merged
Merged
Conversation
A tester reported two display problems in Poly Edit. Edges showed through the model. The cage edges were painted by egui on top of the view, with only back-face culling, so after an extrusion the front-facing faces behind the new part still showed their edges. The renderer now draws the edited piece's edges in its depth-tested wireframe pass (a new per-item DrawItem::wireframe flag), so geometry in front hides them. With the smooth preview on, the cage floats off the smoothed surface, so it keeps the overlay drawn on top. N-gons showed their triangulation. A mesh built from polygons told the renderer which edges are quad diagonals but not which lie inside n-gons, so the wireframe drew the lines an n-gon is split into. Meshes built from a cage or a polygon subdivision base now record those edges (Mesh::set_ngon_edges), and the wireframe leaves them out like quad diagonals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GEttLK8THCkZ7KHELbSp7g Signed-off-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the two Poly Edit display problems a tester reported.
1. Edges showed through the model
The edited piece's polygon edges were painted by egui on top of the 3D view, culled only by face direction. After an extrusion, front-facing faces behind the new part still showed their edges, as if they were in front.
Now the renderer draws them in its existing depth-tested wireframe pass:
DrawItemgainswireframe: bool, which draws one piece's edges even with View > Wireframe off.ITEM_WIREFRAME_OPACITY).Editor::poly_wire_piece) and no longer paints those edges itself.Hover and reach highlights, creases and picks are still painted on top, as interaction feedback.
With the smooth preview on, the cage floats off the smoothed surface, so depth-testing it against that surface would hide most of it. In that mode the cage is still drawn on top, as before.
2. N-gons showed their inner lines
A mesh built from polygons told the renderer which edges are quad diagonals, but not which lie inside n-gons. The wireframe therefore drew the triangulation of every n-gon.
Meshnow hasset_ngon_edges/ngon_edges/is_inner_edge.Cage::build_mesh,relink) and when binding a Catmull–Clark stack whose base has n-gons (Multires::bind).This also covers meshes from the retopology tool and the View > Wireframe overlay.
Verified
cargo fmt --check,clippy -D warnings,cargo test --workspace,check_corpus_ip.py.poly_wire_pieceis on while Poly Edit is open and off with the smooth preview or after Done.These screenshots came from a temporary local hack (opening Poly Edit at start), which is not in this PR.
Not verified / notes
Generated by Claude Code