Skip to content
Snippets Groups Projects
Commit 75648a60 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Remove upsample from attrib accum

parent 893bceea
No related branches found
No related tags found
2 merge requests!116Implements #133 point alignment,!114Ongoing #133 improvements
Pipeline #14669 passed
......@@ -63,6 +63,8 @@ __device__ inline float4 make_float4(const uchar4 &c) {
#define SMOOTHING_MULTIPLIER_B 4.0f // For z contribution
#define SMOOTHING_MULTIPLIER_C 4.0f // For colour contribution
#define ACCUM_DIAMETER 8
/*
* Pass 2: Accumulate attribute contributions if the points pass a visibility test.
*/
......@@ -92,7 +94,7 @@ __global__ void dibr_attribute_contrib_kernel(
if (camPos.z > params.camera.maxDepth) return;
const uint2 screenPos = params.camera.camToScreen<uint2>(camPos);
const int upsample = 8; //min(UPSAMPLE_MAX, int((5.0f*r) * params.camera.fx / camPos.z));
//const int upsample = 8; //min(UPSAMPLE_MAX, int((5.0f*r) * params.camera.fx / camPos.z));
// Not on screen so stop now...
if (screenPos.x >= depth_in.width() || screenPos.y >= depth_in.height()) return;
......@@ -107,9 +109,9 @@ __global__ void dibr_attribute_contrib_kernel(
// Each thread in warp takes an upsample point and updates corresponding depth buffer.
const int lane = tid % WARP_SIZE;
for (int i=lane; i<upsample*upsample; i+=WARP_SIZE) {
const float u = (i % upsample) - (upsample / 2);
const float v = (i / upsample) - (upsample / 2);
for (int i=lane; i<ACCUM_DIAMETER*ACCUM_DIAMETER; i+=WARP_SIZE) {
const float u = (i % ACCUM_DIAMETER) - (ACCUM_DIAMETER / 2);
const float v = (i / ACCUM_DIAMETER) - (ACCUM_DIAMETER / 2);
// Use the depth buffer to determine this pixels 3D position in camera space
const float d = ((float)depth_in.tex2D(screenPos.x+u, screenPos.y+v)/1000.0f);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment