erge branch 'master' of http://git.nakadashi.lol/akko/diffvg
This commit is contained in:
20
diffvg.cpp
20
diffvg.cpp
@@ -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;
|
||||
|
Reference in New Issue
Block a user