feat(poc): render textures upright, --front camera, and Text via a glyph atlas#33
Merged
Merged
Conversation
…t via a glyph atlas Three rendering-correctness changes surfaced by the Web3D/NIST conformance visual sweep, all in the PoC consumer + the stbtt io module (core stays headless): * Texture vertical flip: stb_image decodes rows top-first but GL treats the first row as the texture bottom, so file textures rendered upside-down (ConformanceNist Geometry/Box/texture.x3d: VTS decal inverted). Flip on load. * --front: new flag that frames the scene from a canonical straight-on, bounding-sphere-fit front camera (overriding any authored Viewpoint), matching how the NIST set bakes its *-front.jpg references so screenshots line up. * Text rendering: add StbttGlyphAtlas to the x3d_stbtt io module — bakes an ASCII coverage atlas via stb_truetype and returns a FontMetrics with advances (raw hmtx/unitsPerEm, matching StbttFontMetrics) AND atlas UVs. The PoC consumes it through the FontMetrics seam + a uGlyphAtlas shader branch (alpha-tested coverage, material color). Text was a blank white bar; now renders real glyphs. The shared Liberation faces move to third_party/fonts/ (one copy for both the SDK text tests and the PoC, no duplication); x3d_stbtt now also builds under -DX3D_CPP_BUILD_POC=ON. NOTICE updated.
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.
Three rendering-correctness changes the NIST visual conformance sweep surfaced. All in the PoC consumer + the
x3d_stbttio module — the headless core is untouched.1. Texture vertical flip (bug)
stb_imagedecodes rows top-first but GL treats the first row as the texture bottom, so file textures rendered upside-down (ConformanceNist/Geometry/Box/texture.x3d: the VTS decal was inverted). Flip on load; the inlineSFImagepath is genuinely bottom-up and stays unflipped.2.
--frontcanonical cameraNew flag that frames the scene from a straight-on, bounding-sphere-fit front camera (overriding any authored Viewpoint), matching how the NIST set bakes its
*-front.jpgreferences so screenshots line up apples-to-apples.3. Text rendering (feature)
Text was a blank white bar. Adds
StbttGlyphAtlasto thex3d_stbttio module: it bakes an ASCII coverage atlas via stb_truetype and returns aFontMetricswith advances (rawhmtx/unitsPerEm, matchingStbttFontMetrics) and atlas UVs. The PoC consumes it through theFontMetricsseam + auGlyphAtlasshader branch (alpha-tested coverage, material color). Per the seam decision, rasterization lives in the io module, not core.The shared Liberation faces move to
third_party/fonts/— one copy for both the SDK text tests and the PoC (no duplication);FIXTURES_DIRupdated.x3d_stbttnow also builds under-DX3D_CPP_BUILD_POC=ON.NOTICEupdated.Verified:
build-ci111/111, full PoC build, and visual confirmation against the conformance references (textured box upright, "The VRML Test Suite" renders as glyphs).