The sample's cube and plane are wound counter-clockwise from outside #107
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar!107
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/cube-winding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The cube indices were deliberately clockwise, on the reasoning that the projection's Y negation reverses a triangle's orientation, so a counter-clockwise face in the world would arrive clockwise on screen and be culled. That misses the second flip: Vulkan maps NDC onto a framebuffer whose Y runs down, and
frontFaceis judged in framebuffer space. The two flips cancel, so counter-clockwise world winding was already the front face and only the inner faces of every cube and the plane were drawn.The plane shares the cube mesh through
attach_cube_renderer, so the same change fixes it.cube_meshnow emits 0,1,2 and 0,2,3, the misleading winding comment is gone, and theperspectivecomment states why Y is negated. The winding test is renamedthe_cube_winds_counter_clockwise_seen_from_outsideand asserts outward-facing triangles.just testpasses all 63 tests.