scenery icon indicating copy to clipboard operation
scenery copied to clipboard

Volume: Improved raycast behaviour

Open skalarproduktraum opened this issue 2 years ago • 5 comments

This PR fixes the volume ray caster to only sample from volumes within their own bounding box.

skalarproduktraum avatar Mar 15 '22 18:03 skalarproduktraum

@skalarproduktraum It looks good to me, mostly. It seems to sample the volumes correctly, and, compared to master, frame-rates improve by ~40% with 2 disjoint volumes in the scene, in the (limited) testing I was able to do so far.

However, it does not work with compute shaders, only fragment shaders. In fact, CustomVolumeManagerExample fails in this branch. I tried inserting the required terms (localNear and localFar) as appropriate in ComputeVolume.comp, but that is not sufficient. I suppose some changes are required in the VolumeManager that would enable the use of compute shaders with these changes. The compute shaders are required for the VDI generation.

aryaman-gupta avatar Mar 23 '22 16:03 aryaman-gupta

Did you also add the localNear and localFar keys in the place where you've created the VolumeManager? This is also not (yet) done in the CustomVolumeManagerExample.

skalarproduktraum avatar Mar 29 '22 11:03 skalarproduktraum

Is this good to merge, @aryaman-gupta?

skalarproduktraum avatar Apr 29 '22 13:04 skalarproduktraum

Ping again @aryaman-gupta

skalarproduktraum avatar May 12 '22 11:05 skalarproduktraum

@skalarproduktraum sorry for the delay in replying

Unfortunately, when a volume is sliced into multiple chunks, some artefacts are visible at the borders. It appears as though a single slice of voxels is not sampled correctly. The attached image is an example. The image shows the Stagbeetle dataset (Meister Eduard Gröller, Georg Glaeser, Johannes Kastner, 2005)

DistributedVolumeRenderer - 2022-05-25 00 02 31

To reproduce, the easiest way may be to run the VolumeFromFileExample of the scenery-insitu repository. Before running the application, the Stagbeetle dataset would need to be divided into two parts and placed in directories named Part1 and Part2, each with its own stacks.info file indicating the dimensions of the respective part.

aryaman-gupta avatar May 24 '22 22:05 aryaman-gupta

Superseded by #622.

skalarproduktraum avatar Apr 02 '24 14:04 skalarproduktraum