Skip to content

Commit

Permalink
popping and pushing back the procedural volume
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeneren committed Dec 27, 2019
1 parent c3f853d commit 8c67e8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ int main(const int argc, const char* argv[])
float3 proc_box_max = make_float3(500, 1020, 500);
if(!proc_vol.create_volume(proc_box_min, proc_box_max, 1.0f, 0, 0.1f)) return 0;

instances.clear();
//instances.clear();
instances.push_back(proc_vol);

// Send volume instances to gpu
Expand Down Expand Up @@ -1700,7 +1700,10 @@ int main(const int argc, const char* argv[])
{

proc_vol.create_volume(proc_box_min, proc_box_max, noise_res, noise_type, scale);
check_success(cuMemcpyHtoD(d_volume_ptr, &proc_vol, sizeof(GPU_VDB)* instances.size()) == cudaSuccess);

instances.pop_back();
instances.push_back(proc_vol);
check_success(cuMemcpyHtoD(d_volume_ptr, instances.data(), sizeof(GPU_VDB)* instances.size()) == cudaSuccess);

kernel_params.iteration = 0;

Expand Down

0 comments on commit 8c67e8b

Please sign in to comment.