Skip to content

Bake leaf scales into generated GLB geometry safely - #161

Merged
SpectralDragon merged 3 commits into
mainfrom
fix/baked-leaf-scale-and-xcode-build
Oct 17, 2026
Merged

SpectralDragon merged 3 commits into
mainfrom
fix/baked-leaf-scale-and-xcode-build

Conversation

@SpectralDragon

@SpectralDragon SpectralDragon commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Non-uniformly scaled procedural leaf parts, such as squashed spheres used for clouds, can shade incorrectly when their scale stays on the node. Bake positive, finite leaf scales into mesh positions and inverse-scale-normalized normals during GLB export. Keep parent transforms and leaf scales with negative, zero, or nonfinite components unchanged, preserving mirrored geometry and avoiding division by zero.

Add regression coverage for preserved transforms, geometry and triangle indices through GLB export/import. Retain the navigation demo's explicit matrix-vector grouping and document procedural scale behavior.

Merge current main and resolve both navigation conflicts using its existing Int64 C-enum comparisons. The inspector localization fix is already present in main.

Validation

  • Independent source review passed.
  • Xcode 26.6 / Swift 6.3.3: an isolated SwiftPM harness compiling the actual procedural, glTF, Math, navigation and Recast/Detour sources built successfully. The harness substitutes only AssetsManager.restrictedResourceRoot = nil; external resource loading is outside these tests.
  • All 10 ProceduralModelTests passed, including 11 unsupported-scale cases and 6 GLB round-trip cases.
  • Combined procedural/navigation validation: 31 of 32 tests passed. The unchanged NavigationTests.swift:42 slope assertion failed: abs(start.y - 0.5) = 0.2247191, expected < 0.2. Navigation sources, tests, native dependencies and Math match main exactly.
  • git diff --check passed. Full engine/editor builds, the AdaScript generator suite and GPU rendering were not re-run for this revision.

SpectralDragon and others added 3 commits October 17, 2026 17:03
A non-uniform node scale distorted normals in the renderer, which gave a clouds model made from squashed spheres black patches in the Flappy3D trial. GLBWriter now applies the scale of parts without children to vertices and normals (inverse transpose), leaving the node unscaled.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Match C enum raw values against Int32 results with an explicit conversion (navigation), parenthesize a matrix-vector product the type checker resolved as matrix-matrix, and remove a doubled L10n.text call in the Studio inspector.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SpectralDragon SpectralDragon changed the title Bake leaf part scale in generated GLB; fix main build with Xcode 26.6 Bake leaf scales into generated GLB geometry safely Oct 17, 2026
@SpectralDragon
SpectralDragon marked this pull request as ready for review October 17, 2026 16:54
@SpectralDragon
SpectralDragon merged commit 433e2d8 into main Oct 17, 2026
1 of 3 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T16:55:26.831793Z f5fd0e7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant