scenery
scenery copied to clipboard
Volume: Improved raycast behaviour
This PR fixes the volume ray caster to only sample from volumes within their own bounding box.
@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.
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.
Is this good to merge, @aryaman-gupta?
Ping again @aryaman-gupta
@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)
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.
Superseded by #622.