Skip to content

PBR debug channel views - #28

Closed
mtao wants to merge 3 commits into
mainfrom
feature/pbr-debug-views
Closed

mtao wants to merge 3 commits into
mainfrom
feature/pbr-debug-views

Conversation

@mtao

@mtao mtao commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Step 10 of the PBR plan: debug channel views for balsa.pbr_surface.

  • PbrDebugChannel + pbr_debug_channel_names(); PbrSurfaceRenderer::debug_channel with a Debug View control.
  • Channels: Final, base colour, alpha, metallic, roughness, occlusion, emissive, shading/geometry normal, tangent, bitangent, texture coordinates 0/1 (as in the Khronos Sample Viewer).
  • The channel belongs to each renderer, not the shared Material, so other layers drawing the same material are unaffected.
  • It is passed in options.w of the material block and picked with a uniform branch in pbr.frag, so switching channels builds no new pipeline.
  • Data channels are decoded from sRGB before output, so the sRGB swapchain shows their raw values; vectors are mapped from [-1, 1] to [0, 1].

Tests: pbr_surface_debug_channel covers the control, the uniform value, and that the setting is per renderer and copied by clones. The existing shader-permutation test compiles pbr.frag.

Not yet done: checking the channels visually in the viewer (e.g. NormalTangentTest, DamagedHelmet).

mtao added 3 commits November 10, 2026 17:14
PbrSurfaceRenderer gains a debug_channel (Final, base colour, alpha,
metallic, roughness, occlusion, emissive, shading/geometry normal,
tangent, bitangent, texture coordinates 0/1), as in the Khronos glTF
Sample Viewer, chosen with a "Debug View" control.

The channel is per renderer rather than on the shared Material, so
debugging one layer leaves others drawing the same material alone. It is
passed in the unused w of the material block's options and selected by
a uniform branch in pbr.frag, so changing it needs no new pipeline.
Data channels are decoded from sRGB before output so the sRGB swapchain
shows their raw values; vectors are mapped from [-1, 1] to [0, 1].
@mtao

mtao commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the generalized debug views on feature/debug-views (reviewed and merged locally).

@mtao mtao closed this Nov 11, 2026
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