Closed KaavayGupta closed 4 months ago
After alot tinkering around, I've finally figured out the solution. The problem was in example code provided by OptiX. It was accessing the volume coordinates in the raymarching loop.
In the function template<typename AccT> inline __device__ float transmittanceHDDA(const nanovdb::Vec3f& start, const nanovdb::Vec3f& end, AccT& acc, const float opacity )
:
It used ijk = hdda.voxel()
to get the current coordinate.
Replacing it to ijk = nanovdb::RoundDown<nanovdb::Coord>(ray(hdda.time() + 1.0001f));
solved this issue.
Though, I still cannot figure out the exact reason why this solved it.
Thanks!
Environment
Operating System: Ubuntu Version / Commit SHA: 08409f00 Others: Optix 7.7.0
Describe the bug
In the sample provided by OptiX,
optixVolumeViewer
, I am getting square artifacts while raymarching using HDDA that correspond to the vdb grid subdivisions. The volume I am using iswdas_cloud_half
from here. I converted it to.nvdb
using the shippednanovdb_convert
tool. I also replaced the nanovdb library in optixVolumeViewer with the newer one to handle the new volume. These are the artifacts I am talking about:They are only visible from one side and disappear when viewed from the opposite side. The code used in
optixVolumeViewer
'svolume.cu
that does volume rendering is (comments and other parts omitted):Complete code can be found in the OptiX-Samples shipped with their SDK
To Reproduce
Steps to reproduce the behavior:
nanovdb
folder inoptixVolumeViewer
with theinclude/nanovdb
folder from the directory where openvdb was installed. And then build it.wdas_cloud_half.vdb
from here.nanovdb_convert
innanovdb
to convertwdas_cloud_half.vdb
towdas_cloud_half.nvdb
.optixVolumeViewer
executable with argument--volume wdas_cloud_half.nvdb
.Additional Context
The sample smoke volume provided by Optix does not show these artifacts.