You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System: Ubuntu Version / Commit SHA:08409f0 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 is wdas_cloud_half from here. I converted it to .nvdb using the shipped nanovdb_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's volume.cu that does volume rendering is (comments and other parts omitted):
template<typename AccT>
inline__device__floattransmittanceHDDA(
const nanovdb::Vec3f& start,
const nanovdb::Vec3f& end,
AccT& acc, constfloat opacity )
{
float transmittance = 1.f;
auto dir = end - start;
auto len = dir.length();
nanovdb::Ray<float> ray( start, dir / len, 0.0f, len );
nanovdb::Coord ijk = nanovdb::RoundDown<nanovdb::Coord>( ray.start() ); // first hit of bbox
nanovdb::HDDA<nanovdb::Ray<float> > hdda( ray, acc.getDim( ijk, ray ) );
float t = 0.0f;
float density = acc.getValue( ijk ) * opacity;
while( hdda.step() )
{
float dt = hdda.time() - t; // compute length of ray-segment intersecting current voxel/tile
transmittance *= expf( -density * dt );
t = hdda.time();
ijk = hdda.voxel();
density = acc.getValue( ijk ) * opacity;
hdda.update( ray, acc.getDim( ijk, ray ) ); // if necessary adjust DDA step size
}
return transmittance;
}
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.
Environment
Operating System: Ubuntu
Version / Commit SHA: 08409f0
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.
The text was updated successfully, but these errors were encountered: