feat: interpolation in shader UI controls invlerp/transfer function and use interpolation in multi-channel setup for volume rendering #855
+19
−1
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.
For both
invlerpandtransferFunctionshader ui controls, we could add an interpolation parameter to them, which would turn on trilinear interpolation when sampling the data.There are two ways this parameter could be added, and we might want to have just one or both. For invlerps, to demonstrate the process, I've added both. Transfer functions only has the simpler version.
Option 1 - passing it as a parameter in the shader when calling the control.
This option would allow something like:
to be possible, where a single UI control can be created, but used in two different ways. In other words, the switch between interpolation on/off does not happen at build time.
Option 2 - provide a build time option to the shader control to enable interpolation when called with no parameters
This would be a shader build time switch, so no if statement inside the shader.
There's nothing I can see that prevents having both. I also hooked the multi-channel image creation into having interpolation enabled for volume rendering, and disabled for slice rendering, if you want to try the performance @fcollman @dyf
Leaving in draft for now to see if we want one/both options or any changes to naming etc. Then could expand whatever we choose so that both the
invlerpandtransferFunctionshare the same parameters for this interpolation. Would also expand theshader_ui_controlsbrowser tests for the interpolation.