-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volume rendering compositing changes and wireframe rendering to vis chunks in volume rendering mode #503
Volume rendering compositing changes and wireframe rendering to vis chunks in volume rendering mode #503
Conversation
The gain float can be used to scale the VR intensity. Also bind that gain to Python controls and bind VR bool to Python.
Refactored volume rendering shader to accomodate
This pull request implements four main features:
Additionally, the volume rendering flag has been bound to a Python controllable tool. I think it should be good for another round of review if you get the time @jbms. Thanks again for all the thoughtful input on this one so far, really helpful and much appreciated! |
src/image_user_layer.ts
Outdated
|
||
const OPACITY_JSON_KEY = "opacity"; | ||
const GAIN_JSON_KEY = "gain"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename to volumeRenderingGain since it only applies to volume rendering?
Also when I've created this control manually as a UI control, I've typically found it convenient to give it an exponential scale so that it can more easily cover a larger range, i.e. the slider ranges from -10 to 10 and the actual gain is exp(gain)
. But that could also be handled purely in the slider control. Maybe you've also found the linear gain to work okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks! Linear worked pretty well, but I prefer the exponential scale after trying it out, thanks for the suggestion on that.
Not sure if we should hint at the scale in the UI somehow now, or if the name Gain (3D) is clear enough. Happy either way, but let me know if you have thoughts on that
Thanks! This looks good --- I left just a few minor comments. |
src/image_user_layer.ts
Outdated
@@ -125,6 +127,7 @@ export class ImageUserLayer extends Base { | |||
dataType = new WatchableValue<DataType | undefined>(undefined); | |||
sliceViewRenderScaleHistogram = new RenderScaleHistogram(); | |||
sliceViewRenderScaleTarget = trackableRenderScaleTarget(1); | |||
volumeRenderingGain = trackableFiniteFloat(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default should probably be 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch, sorry about that!
…hunks in volume rendering mode (google#503) * feat: VR front-to-back compositing and chunk vis * chore: add comment about opacity correction source * refactor: clearer naming for compositing * chore: fix formatting * feat: add gain parameter to VR and python binds The gain float can be used to scale the VR intensity. Also bind that gain to Python controls and bind VR bool to Python. * refactor: pull OIT emit function out as standalone * feat: perform OIT along rays during VR * test: ensure that color and revealage are independent of sampling rate Refactored volume rendering shader to accomodate * feat: add depth culling to VR rays during marching * chore: format file * fix: break composite loop if VR ray goes behind opaque * fix: remove console.log during testing * feat: volume rendering chunk vis in wireframe mode * refactor: rename gain to volumeRenderingGain Also update relevant Python bindings * feat: change gain scale from linear to exponential * refactor: rename to depthBufferTexture (remove ID) * format: run python formatting * fix: default volume rendering slider gain of 0 (e^0 passed to shader)
Performs front-to-back compositing in three steps:
Also adds a chunk visualiser to VR if wireframe mode is enabled in settings