Repository navigation
Vulkan: feature-edge-only overlay + empty auto-clip bbox refresh - #70
Merged
Merged
Conversation
The VulkanWireframe edge overlay re-drew every line-topology command with its uniform edge color, so it recolored arbitrary line geometry -- most visibly the Draft working-plane grid, whose two colored axes both came out the overlay color instead of red/green. Mark feature edges in the IR: SoShape::isFeatureEdgeSet() (default false) is folded into SoRenderCommand::isFeatureEdge by soshape_emit_ir_commands(), and FreeCAD's SoBrepEdgeSet overrides it true. buildWorkItems() then only re-draws commands with that flag, leaving the grid, dimensions and other annotation line sets to the normal pass with their own per-part colors.
setClippingPlanes() keys its bbox cache on computeSceneFingerprint(), which hashes the retained draw list -- that lags the live graph by one frame because setClippingPlanes() runs before the traversal re-records it. A pure visibility toggle (SoSwitch::whichChild) therefore left the fingerprint unchanged and reused a stale box. On an empty scene that stale box is the empty-box default (near=1/far=10), which clips GUI trackers added at the origin: the Draft working-plane grid's z=0 plane sits exactly on the near plane at the default camera (pos z=1) and stayed invisible until a camera move happened to refresh the box. Force the bbox walk when the scene is dirty and the cached box is empty, so the grid is inside the frustum as soon as it is enabled; scoping to the empty case avoids re-running the O(scene) walk on every selection/hover field write.
brianmk
added a commit
that referenced
this pull request
Sep 29, 2026
Re-apply the two fixes merged on the fork's coin-Integrate (#70) so adopting the stack port does not regress the Draft working-plane grid: - Feature edges are marked in the IR (SoShape::isFeatureEdgeSet() folded into SoRenderCommand::isFeatureEdge); the Vulkan edge overlay re-draws only those, so the grid keeps its own per-part red/green axes instead of the uniform overlay color. - The empty auto-clip bbox is refreshed on a scene change, so the grid's z=0 plane is not clipped on a fresh/empty document before a camera move. coin-vulkan-tests: 28/28 pass (the tess-overlay test marks its synthetic feature line with isFeatureEdge).
brianmk
added a commit
that referenced
this pull request
Sep 29, 2026
coin-Integrate now carries the Draft-grid fixes (#70). The port re-applies them on the stack tree (previous commit), so this merge keeps the port tree and records the integration branch as an ancestor for a conflict-free PR.
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.
Two Vulkan renderer fixes surfaced by the Draft working-plane grid (the "ground plane" in the FreeCAD fork).
1. Restrict the edge overlay to real B-Rep feature edges
buildWorkItems()re-drew everySO_TOPOLOGY_LINES/LINE_STRIPcommand with the uniformVulkanWireframeedge color. That recolored arbitrary line geometry, so the Draft grid's two colored axes both rendered in the overlay color (both red) instead of red/green.SoShape::isFeatureEdgeSet()(defaultfalse) is folded intoSoRenderCommand::isFeatureEdgebysoshape_emit_ir_commands().SoBrepEdgeSetoverrides ittrue.2. Refresh an empty auto-clip bbox on a scene change
setClippingPlanes()keys its bbox cache oncomputeSceneFingerprint(), which hashes the retained draw list. That lagged the live graph by one frame, so a pureSoSwitch::whichChildvisibility toggle left the fingerprint unchanged and reused a stale box.On an empty document that stale box is the empty-box default (
near=1/far=10), which clips trackers added at the origin: the Draft grid'sz=0plane sat exactly on the near plane at the default camera (pos z=1) and stayed invisible until a camera move refreshed the box. Forcing the bbox walk when the scene is dirty and the cached box is empty puts the grid inside the frustum as soon as it is enabled; scoping to the empty case avoids re-running the O(scene) walk on every selection/hover field write.Verified with
FC_VULKAN_CLIP_DEBUG=1: right after the toggle, with no camera move, the clip box goes from empty (near=1/far=10) toboxz=[-1,-1] near=0/far=2, i.e. the grid is inside the frustum.