This commit is contained in:
Akko
2023-05-15 16:23:02 +02:00
63 changed files with 1067 additions and 948 deletions

View File

@@ -1490,6 +1490,11 @@ void render(std::shared_ptr<Scene> scene,
bool use_prefiltering,
ptr<float> eval_positions,
int num_eval_positions) {
/////////////////
// Setup stuff //
/////////////////
#ifdef __NVCC__
int old_device_id = -1;
if (scene->use_gpu) {
@@ -1519,6 +1524,11 @@ void render(std::shared_ptr<Scene> scene,
}
}
///////////////////////////////////////////////////////////////////
// IDK what this does but I think it relates to the prefiltering //
// TODO //
///////////////////////////////////////////////////////////////////
if (render_image.get() != nullptr || d_render_image.get() != nullptr ||
render_sdf.get() != nullptr || d_render_sdf.get() != nullptr) {
if (weight_image != nullptr) {
@@ -1533,6 +1543,11 @@ void render(std::shared_ptr<Scene> scene,
}, width * height * num_samples_x * num_samples_y, scene->use_gpu);
}
////////////////////////////////////////////////
// Think this relates to the actual rendering //
////////////////////////////////////////////////
auto num_samples = eval_positions.get() == nullptr ?
width * height * num_samples_x * num_samples_y : num_eval_positions;
parallel_for(render_kernel{
@@ -1555,6 +1570,11 @@ void render(std::shared_ptr<Scene> scene,
}, num_samples, scene->use_gpu);
}
/////////////////////////////////////////////////////////////////////
// The reason for this is described in the diffvg paper //
// I don't think it's especially important for the gradient meshes //
/////////////////////////////////////////////////////////////////////
// Boundary sampling
if (!use_prefiltering && d_render_image.get() != nullptr) {
auto num_samples = width * height * num_samples_x * num_samples_y;