seanspicer / nexscenegraph

A New EXperimental Scene Graph in .NET Core
Apache License 2.0
31 stars 9 forks source link

3D Texture-based Direct Volume Rendering #21

Closed senften closed 3 years ago

senften commented 3 years ago

This PR is based on 3D Texture + Example by senften · Pull Request #20 · seanspicer/nexscenegraph

Introduced a delegate to LevoyCabralTechnique which is responsible for converting an IVoxelVolume into an RGBA Texture3D. The technique now creates and owns the ITexture3D accessing the data of the IVoxelVolume and using the delegate to translate into color, basically.

Also pay attention to the TexGen in LevoyCabralLocator and the example TextureVolumeShader-fragment.glsl.

senften commented 3 years ago

So, as you suggest - I really prefer that the 3D Texture generation happen inside the Init method for the LevoyCabralTechnique. This is actually a small change I think.

Other than that the rest looks reasonable.

Agreed.

senften commented 3 years ago

Add a default delegate. I had an explicit parula colormap implementation but I thought it was just too lengthy so I repurposed a procedural map. It's not an unreasonable default but I think someone would overwrite it pretty quickly.