Clarify MeshRasterizer zbuf as view-space depth#2023
Open
kenshi84 wants to merge 1 commit intofacebookresearch:mainfrom
Open
Clarify MeshRasterizer zbuf as view-space depth#2023kenshi84 wants to merge 1 commit intofacebookresearch:mainfrom
kenshi84 wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
The mesh rasterizer docs said `Fragments.zbuf` contained NDC z values, but the implementation preserves view-space z in `MeshRasterizer.transform` and rasterizes that depth. This change aligns the documented contract with the actual behavior and removes a few nearby inconsistencies that had drifted in related renderer docs. Update the mesh rasterization docs to describe `zbuf` as barycentrically interpolated view-space depth rather than a raw face vertex z value. Also clarify that `MeshRasterizer.transform` produces vertices with x/y in NDC space while keeping z in view space. Fix adjacent wording in the clipping helpers and OpenGL rasterizer docs so they no longer describe the same depth values as world-space z or as generic distance-from-camera values. Update the renderer getting-started note to match the API docs. Add a regression test that rasterizes a mesh with a perspective camera and checks that `fragments.zbuf` matches interpolated view-space z, while differing from both world-space z and projected NDC z. This change does not modify rasterization behavior; it only corrects the documentation and adds coverage for the existing convention. (This whole patch was generated by Codex v0.113.0 with gpt-5.4 xhigh)
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.
The mesh rasterizer docs said
Fragments.zbufcontained NDC z values, butthe implementation preserves view-space z in
MeshRasterizer.transformandrasterizes that depth. This change aligns the documented contract with the
actual behavior and removes a few nearby inconsistencies that had drifted in
related renderer docs.
Update the mesh rasterization docs to describe
zbufas barycentricallyinterpolated view-space depth rather than a raw face vertex z value. Also
clarify that
MeshRasterizer.transformproduces vertices with x/y in NDCspace while keeping z in view space.
Fix adjacent wording in the clipping helpers and OpenGL rasterizer docs so
they no longer describe the same depth values as world-space z or as generic
distance-from-camera values. Update the renderer getting-started note to
match the API docs.
Add a regression test that rasterizes a mesh with a perspective camera and
checks that
fragments.zbufmatches interpolated view-space z, whilediffering from both world-space z and projected NDC z.
This change does not modify rasterization behavior; it only corrects the
documentation and adds coverage for the existing convention.
(This whole patch was generated by Codex v0.113.0 with gpt-5.4 xhigh)