Skip to content

Vulkan POM: lightmapped PBR + normalHeightMap height source#55

Draft
timfox wants to merge 2 commits intomainfrom
cursor/pending-todo-item-3829
Draft

Vulkan POM: lightmapped PBR + normalHeightMap height source#55
timfox wants to merge 2 commits intomainfrom
cursor/pending-todo-item-3829

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented Apr 10, 2026

Summary

Completes POM follow-ups from the materials roadmap:

  1. Lightmapped PBR: POM is no longer force-disabled when a lightmap is bound. Parallax still displaces base UVs (texcoord0); lightmaps continue to use lightmapTexCoord() / sampleLightmap() on their own set.

  2. Dedicated height without tying to ORM occlusion: Stages that use normalHeightMap now ray-march height from the normal map alpha (specialization pom_height_source == 1), so height can be authored independently of packed ORM R (occlusion). ORM-based height remains the default when a metalness/roughness physical map is bound (physical_texture_set == 0).

  3. Pipeline correctness: POM enablement is computed after physical_texture_set is assigned, so spec-gloss (physical_texture_set == 1) no longer incorrectly enabled POM.

CI hardening (this PR)

  • MSYS2: pacman -Sy before install; --disable-download-timeout to reduce spurious curl timeouts when installing SDL/curl/etc.
  • Android (CMake matrix): Retry loop for sdkmanager NDK install; broader android-deps cache key (cmake/**, android/**, workflow); retry cmake configure (clean build dir) and cmake --build on transient failures.
  • Android APK job: Retry sdkmanager for NDK/CMake/platforms/build-tools; retry ./gradlew assembleDebug.
  • macOS: Retry brew install for CDN/mirror flakes.

Files

  • vk_create_pipeline.c / vk_create_pipeline.h / vk.hpom_height_source in frag spec + Vk_Pipeline_Def.pom_height_source
  • tr_shader.c — set def.pom_height_source from normalMapType == PHYS_NORMALHEIGHT
  • gen_frag.tmpl + regenerated SPIR-V (shader_data.c, meta)
  • docs/RENDERERS.md — updated POM paragraph
  • .github/workflows/build.yml — CI resilience

Validation

  • ./scripts/compile_shaders.sh --apply
  • ./scripts/compile_engine.sh vulkan
  • ctest in build-vk-Release (all passed)
Open in Web Open in Cursor 

cursoragent and others added 2 commits April 10, 2026 05:45
- Remove lightmap disable for POM; base UV displacement stays on texcoord0.
- Add pom_height_source specialization (ORM R vs normal map alpha).
- Set pom_height_source from normalHeightMap in pipeline def; reorder POM
  gating after physical_texture_set assignment.
- Regenerate SPIR-V blobs; update RENDERERS.md.

Co-authored-by: Tim Fox <timfox@outlook.com>
- MSYS2: pacman -Sy before install; --disable-download-timeout for curl flakiness
- Android matrix: retry sdkmanager NDK install; broader deps cache key
- Android CMake: retry configure (clean tree) and build on transient network failures
- android-apk: retry sdkmanager bundle + gradlew assembleDebug
- macOS: retry brew install for mirror/CDN flakes

Co-authored-by: Tim Fox <timfox@outlook.com>
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.

2 participants