Threshold filter and clip scalar filter is vulnerable with volume representation

Hi Paraview,
As title, I am testing volume representation with date after threshold/clip scalar filter.
And I found it crashes all the time with this file cube.vdb (435.3 KB).
I wonder if there’s something wrong between these two filters and volume representation, since it’s not a big file.

Update: paraview works without crashes on this very small file cube_small.vdb (15.8 KB).

Unable to reproduce with the nightly of ParaView:

Thank you for your replied, but your image does not look like volume representation.
I mean changing the threshold filter itself to volume representation.
Paraview is not responding while I click volume in the representation select.

Indeed, I confirm the issue. More investigation is needed.

Try running the Tetrahedralize filter before turning on volume rendering. It takes a while, and in my case it created over 1GB of data, but at least you can see the progress of it. Then volume rendering worked (although a bit slowly).

The lockup might just be ParaView running Tetrahedralize internally (which it has to do to render unstructured grids).

Hi @Kenneth_Moreland, thanks for this observation!
Just to confirm, do you mean that this issue happens because additional Tetrahedralize is needed when threshold filter turns structured grids to unstructured grids?

No. The Threshold filter works fine with any cell types and produces any cell types. What I mean is that the unstructured volume rendering only works with tetrahedra, so when you turn on volume rendering, ParaView will internally run the Tetrahedralize filter on unstructured data. That is probably why volume rendering is taking a while to start.

To be clear, ParaView uses different types of volume rendering depending on the data type. For uniform structured data (which is what you start with), ParaView will use faster image-based volume rendering algorithms. These algorithms don’t work with unstructured data, which is what Threshold produces. So, if you try to render the output of Threshold, ParaView will need to run Tetrahedralize internally if you don’t do it first.

I also note that if you volume render your data (cube.vdb) directly, it is pretty fast (because it is using the structured version of volume rendering). If you are coloring the volume rendering by the same variable that you are thresholding by, you can just change the volume rendering transfer function to make completely transparent the blocks that you don’t want to see. In that way, you don’t need to run Threshold at all.

That said, this trick only works if you are volume rendering by the same variable that you are thresholding by.

2 Likes

Hi @Kenneth_Moreland, really appreciate about the clarification!

I knew this trick you mentioned, but in my use case, there somehow exists some noises in the boundary and this trick will make it even more obvious. (I thought these noises come from this trick, but today I realize the noise is already there before I apply this trick.)
image
This layer should be completely transparent, but it somehow still consumes the color from other layers. Do you have any idea about where these noises come from?

[Update]
Volume rendering mode in the previous image is set as GPU Based.
In Ray Cast Only, the noises look different.
image
And nothing shows in OSPRay Based, it also happens (nothing shows) when I check Enable Ray Tracing. But I think it is supported with volume rendering now according to Ray tracing with volume rendering - ParaView Support - ParaView.

Ah. These are happening at transition cells with points on one side being opaque and the points on the other side being completely transparent. When rays are cast for volume rendering, samples that hit on the inside of these cells interpolate between the opaque and transparent colors.

In your example, it looks like one side is blue but completely transparent (let’s call it [0, 0, 1, 0]) and the other side is yellowish and opaque (let’s call it [0.7, 0.7, 0, 1]). If a sample is taken in the middle of the cell, it gets a color of [0.35, 0.35, 0.5, 0.5], giving you a transparent but visible bluish color. Different rays will hit at different interpolations and give you different variations between yellow and blue. This is why you get the noise and/or moire patterns.

That is a problem with having index data on points: ParaView wants to interpolate them, and interpolated indices make little sense. You might need to just play with the colors to diminish the effect.

1 Like