Vulkan RT: smooth vertex-normal shading and normal-pool offset fix - #14
Merged
brianmk merged 2 commits intoSep 11, 2026
Merged
Conversation
- The normal pool now stores each triangle's three vertex normals and the ray-query tracer barycentric-interpolates them (the SBT closest-hit path uses the averaged vertex normal, since GL_EXT_ray_tracing exposes no barycentrics), so curved solids shade smoothly instead of per-triangle. - Fix ensureNormalPoolCapacity(): growing the pool reset normalPoolUsed to zero, so every command that triggered a grow was assigned offset 0 and read the last-written geometry's normals -- the cylinder cap picked up the sphere's radial normals and shaded as a per-triangle fan. Preserve the existing records across a grow and stop resetting the used counter. - Fall back to the viewport clear color for the RT sky when no background gradient is configured. - Skip the overlay depth clear for full-frame overlays (selection and preselect highlights) so they are not drawn over occluding geometry. - Re-key a cached geometry only when the geometry matches, so an overlay command reusing a traced command's draw-list slot no longer restarts path-tracing accumulation.
The default GITHUB_TOKEN is read-only, so peaceiris/actions-gh-pages failed with a 403 pushing the generated site to the gh-pages branch.
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.
Coin-side counterpart of brianmk/FreeCAD-vulkan#30.
Changes
barycentric-interpolates them (SBT closest-hit uses the averaged vertex normal)
so curved solids shade smoothly.
ensureNormalPoolCapacity(): growing the pool resetnormalPoolUsedto 0,so every command that triggered a grow got offset 0 and read the last-written
geometry's normals (the cylinder cap picked up the sphere's radial normals and
shaded as a per-triangle fan). Preserve existing records across a grow.
so highlights are not drawn over occluding geometry.
reusing a traced command's draw-list slot no longer restarts path tracing.
contents: writeto the documentation workflow sopeaceiris/actions-gh-pagescan publish thegh-pagesbranch (the defaultGITHUB_TOKENis read-only, which was failing the default-branch run with a403).
Verification
sphere=4368.
Coin,FreeCADGui,FreeCADMainbuild green; changed TUs compile cleanunder clang++
-Werror.