feat: volume rendering axis aligned clipping planes#616
Open
seankmartin wants to merge 12 commits into
Open
Conversation
refactor: clean up solution fix: add update volume check refactor: move bulk of logic to volume renderable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds XYZ clipping plane support to volume rendering. Any volumes outside of these clip planes are set to be non-visible. This means that objects now can be set to be
visible, and the renderer will skip rendering any non-visible object. When clipping planes are moved the proxy geometry of the volume updates to match the new bounds and the shader maps the proxy bounds to texture co-ordinates for sampling.Clip bounds are stored on the
VolumeLayer, and are used when:to call
clipToBoundson the volumes in the volume layer. To facilitate this, the previous method on the volume layer to update the transforms of the volume renderables has moved into the volume renderable. This allows the clipping function to be run independently of needing a chunk. The volume renderable also stores information about the world space bounds of the volume. This is separate to theboundingBoxof the volume, because theboundingBoxrepresents the bounding box of the proxy geometry, which may now be clipped to be smaller than the full extent of the volume.Changes in the fragment shader are quite small, requiring two new uniforms which are used to map the existing computation that was performed in the shader into texture co-ordinates. This is because now the proxy geometry bounds may not exactly match the texture bounds.
This does not affect loading of chunks, and is purely a rendering change.
This is a video on the existing example:
https://github.com/user-attachments/assets/292ebde3-445d-47c8-9756-0c0381ab5816
This video is from an example not included in this PR, was just for testing. Can be included if desired
https://github.com/user-attachments/assets/3cd9963b-62a5-44f2-b9c5-3a37c88ee813
One note - rotations of the volume itself are not very well handled here. Rotations were already not very well handled in the previous branch. So not sure if should be considered