Skip to content

TST cover voxline, slice-plane and lighting shader code - #762

Open
kroq-gar78 wants to merge 4 commits into
devfrom
tests-webgl-shader-voxline
Open

kroq-gar78 wants to merge 4 commits into
devfrom
tests-webgl-shader-voxline

Conversation

@kroq-gar78

@kroq-gar78 kroq-gar78 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

test_webgl_shaders.py never linked voxline, the slice planes' main shader, or any shader's lighting code, so a compile error in any of them would only show up as a blank viewer.

Changes

  • Link the surface_pixel shader with voxline on, once per color type.
  • Link the three variants of the main shader that the slice planes use.
  • Link both surface shaders for subjects without a white-matter surface (volume=0).
  • Build the test scene from the viewer's own Axes3D, so shaders compile with the viewer's lights. Before, the scene had no lights and all lighting code compiled away. A new assertion makes sure it stays compiled. (Most of the changes to PAGE are for this.)
  • Fail instead of skipping when the test page throws while loading. Before, a missing script silently skipped every tests.
  • Simplify the invalid-GLSL test
  • Replace Any with precise types.

Testing

  • test_webgl_shaders.py: 101 passed.
  • Breaking the voxline GLSL, removing the lights, or dropping a page script each makes the expected tests fail.

Follow-ups

  • Voxline with volume=0 isn't linked.
  • voxline_color / voxline_width have no effect on surfaces.

- Link surface_pixel with voxline on, once per color type.
- Link the three main variants the slice planes use.
- Replace Any annotations with precise types.
The test scene had no lights, so all lighting GLSL compiled away. Build
it from the viewer's Axes3D instead, and assert the lighting code stays
compiled.

Also fail, rather than skip, when the test page throws while loading.
The invalid-GLSL test now takes the same path as the real shaders.
@kroq-gar78
kroq-gar78 force-pushed the tests-webgl-shader-voxline branch from 3048c4d to 6663d34 Compare October 9, 2026 01:53
- Link both surface shaders without a white matter surface (volume=0),
  including voxline's non-cortical-sheet branch.
- Fail on page script errors thrown after load, not only during it.
- Dispose each linked material and geometry, and inline linkResult.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kroq-gar78
kroq-gar78 marked this pull request as ready for review October 27, 2026 02:27

This branch has not been deployed

No deployments
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