feat(multiple scatter): support experimental multiple scatter option #2490
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.
Context
This PR adds multiple scatter option as an alternative to simple ray casting. If this option is turned on, gradient-based and volumetric shading are turned off by default due to computational limit. Multiple scatter accentuate the translucency of the volume and captures a little bit of shadow. Three parameters are added:
multipleScatter
: toggles scatter on and offmultipleScatterSamplingDistFactor
: increase or decrease sample distance for higher order scatter raysphericalSampleNumber
: number of sampled in-scatters on uniform sphereParameters that are not exposed:
Results
Because scattering contribution is added on top of regular rendering it increases the overall brightness level. The scattering effect is not obvious for solid, opaque volume.
This function is very much work in progress.
Changes
vtkVolumeFS.glsl
: added path integration algorithm for multiple scatteropengl/VolumeMapper
: added parameters and uniformscore/VolumMapper
: expose get/set of new parametersPR and Code Checklist
npm run reformat
to have correctly formatted codeTesting