Skip to content

Add parallax occlusion mapping to PBR materials - #163

Merged
SpectralDragon merged 1 commit into
mainfrom
worktree-dof-color-grading
Oct 18, 2026
Merged

SpectralDragon merged 1 commit into
mainfrom
worktree-dof-color-grading

Conversation

@SpectralDragon

Copy link
Copy Markdown
Contributor

Summary

  • Add PBRMaterial.heightTexture, heightScale (world units), heightTextureCoordinate, heightMaxLayers and heightFadeDistance.
  • Ray-march the height map in flat3d.glsl; the UV shift comes from screen-space derivatives, so no tangents are needed, and it applies to every material texture sharing the height map's UV set.
  • The height map is read with the base color sampler, because Metal has no free sampler slot (0–15 are taken).
  • Depth, shadows and silhouettes are not displaced. There is no glTF import yet because no displacement extension is ratified.
  • Record the change in ADR-0027 (Stage 2).

Depth of field and color grading were already implemented (ADR-0027 Stage 1), so this PR only adds parallax.

Test plan

  • Render3DParallaxSettingsTests (uniform packing, clamping, revision invalidation)
  • Render3DGPUTests/Parallax on Metal (zero scale is identical to flat; the raised bar extends toward the camera)
  • All Render3DGPUTests on Metal (35 tests, golden frames unchanged)
  • MaterialUploadReuseTests, PBR3DSceneTests
  • WebGPU (script/validate_webgpu.sh) and Windows, not run (the shader uses textureGrad)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SpectralDragon
SpectralDragon marked this pull request as ready for review October 18, 2026 22:44
@SpectralDragon
SpectralDragon merged commit 2855be9 into main Oct 18, 2026
1 of 3 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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-18T22:45:30.330602Z b86b2fa 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