tkeskita / BVtkNodes

Create and execute VTK pipelines in Blender Node Editor
GNU General Public License v3.0
117 stars 20 forks source link

Unstructured volume data #76

Open mclarsen opened 2 years ago

mclarsen commented 2 years ago

First, let me thank you for this plugin. Its fantastic. My question is I would be able to volume render unstructured grids , but from what I can tell, the only thing that is supported is image data (e.g., uniform grids). Is this possible? The data I have is from CDF simulations with large differences is cell size (i.e., very resolved in certain places and coarse in others), so resampling to a uniform grid would produce huge artifacts unless I sampled at a very large rate, which would make the data huge.

I am pretty new to blender, but I do have a strong background in mesh representations. Any help would be appreciated.

tkeskita commented 2 years ago

Hi, yes you got it right. Image data must be used, and it is uniform grid, so it would need a fine resolution to avoid artefacts (like those shown here). I haven't looked into OpenVDB closely, but I'm guessing there is some possibility to use different resolution grids, in order to have fine resolution only in pre-defined areas. Maybe there are also some ways to smoothen the artefacts, I don't know. Please comment if you learn some good way!

mclarsen commented 2 years ago

I just looked at some of the openvdb documentation and I would agree that there is a way to represent voxels of different sizes, although the leaf voxel patches have to be 16x16x16 i think. This turns the problem into creating an AMR grid (kinda) out of an unstructured one. I could think of a naive implementation that uses cell volume within a spatial region to choose patch sizes. A real solution that minimizes error and memory footprint would be non-trivial. There isn't anything in vtk/paraview that does anything like that to my knowledge, but there is an extract region of interest filter that could be used to get out some uniform blocks that could be inserted into the vdb data structure. I'll think about how hard this would be.

In terms of other support for unstructured volume data, I did come across a plugin that replaced the renderer with Ospray, which supports unstructured. That said, it does look actively developed and I don't think it would produce the photorealistic images I am looking for.

tkeskita commented 2 years ago

You mean Blospray? It's interesting but I've never tried it, see this presentation on Blender conference 2019.

mclarsen commented 2 years ago

Yes, but i don't know how developed it is. iirc, when I looked the repo didn't look active, and I would rather use cycles. I am still trying to get the openVDB stuff working. I haven't had a lot of free time, but I ended up building the latest vtk from source with the latest version of OpenVDB. I'll hopefully start trying some things this weekend.