allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
92 stars 7 forks source link

Feature/disable interpolation #76

Closed frasercl closed 1 year ago

frasercl commented 1 year ago

Resolve #62: add "the option to toggle voxel interpolation like in napari." (In ray march mode - would disabling interpolation in pathtrace mode mean anything or make sense?) Via:

And a couple stray modifications:

Screenshots

image

(from website-3d-cell-viewer) image image

I also attempted to replicate the same image of a cell membrane in both website-3d-cell-viewer and Fiji, to verify that the shader math is correct and samples pure pixel values. Fiji is first, 3d viewer is second:

695296_fiji 695296_3dv

toloudis commented 1 year ago

I think there might be still one more thing to do here. When texture2d is called in the shader, the gpu filters the lookup according to filtering settings on the texture that are set in the JavaScript. Do a search for LINEAR or NEAREST in the code. It might be set at texture creation time but it can also be set later. This could also be the way to make it work for pathtrace mode too.

For raymarch this would filter the xy lookup but the z filtering would still be the manually implemented math we are already doing. For pathtrace, if it uses a full 3D texture, then all 3 axes of the lookup would be filtered.