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
I'm building an nanovdb::IndexGrid from an openvdb::FloatGrid. It encodes voxel values as blind data that can be accessed with a nanovdb::ChannelAccessor<float, nanovdb::ValueOnIndex>, there everythings works as it should.
But when using an openvdb::VectorGrid and the accessor nanovdb::ChannelAccessor<nanovdb::Vec3f, nanovdb::ValueOnIndex> the channel ptr is empty.
To Reproduce
using SrcGridT = openvdb::FloatGrid; // replace by opevdb::VectorGrid using DstBuildT = nanovdb::ValueOnIndex;
using BufferT = nanovdb::cuda::DeviceBuffer;
nanovdb::GridHandle<BufferT> idxHandle = nanovdb::tools::createNanoGrid<SrcGridT, DstBuildT, BufferT>(*floatGrid /* *vectorGrid */, 1u, false , false, 0);
idxHandle.deviceUpload(stream, false);
constauto* gpuGrid = idxHandle.deviceGrid<DstBuildT>();
launch_kernels(gpuGrid, toSample, stream);
Then a cuda kernel is launched to access the grid on the GPU.
__global__ voidgpu_kernel(const nanovdb::NanoGrid<nanovdb::ValueOnIndex>* gpuGrid, constfloat* data) {
const nanovdb::ChannelAccessor<float/* nanovdb::Vec3f */, nanovdb::ValueOnIndex> acc(*gpuGrid);
if (!acc) {
printf("Error: ChannelAccessor has no valid channel pointer! (null)\n");
return;
}
constuint32_t idx000 = acc.idx(0, 0, 0);
printf("Idx at Coord 0,0,0 : %u\n", idx000);
}
Additional context
I tried different configurations such as adding 3u channel with the VectorGrid and trying to access each component individually but it didn't work.
The text was updated successfully, but these errors were encountered:
Environment
Operating System: Win 10
Version: VDB 12.0
Describe the bug
I'm building an
nanovdb::IndexGrid
from anopenvdb::FloatGrid
. It encodes voxel values as blind data that can be accessed with ananovdb::ChannelAccessor<float, nanovdb::ValueOnIndex>
, there everythings works as it should.But when using an
openvdb::VectorGrid
and the accessornanovdb::ChannelAccessor<nanovdb::Vec3f, nanovdb::ValueOnIndex>
the channel ptr is empty.To Reproduce
Then a cuda kernel is launched to access the grid on the GPU.
Additional context
I tried different configurations such as adding
3u
channel with the VectorGrid and trying to access each component individually but it didn't work.The text was updated successfully, but these errors were encountered: