Skip to content
Snippets Groups Projects

Implements #133 point alignment

Merged Nicolas Pope requested to merge feature/133/ilw into master
1 file
+ 9
3
Compare changes
  • Side-by-side
  • Inline
@@ -141,14 +141,20 @@ __global__ void move_points_kernel(
const unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;
if (x < p.width() && y < p.height()) {
const float4 world = p(x,y);
float4 vec = ev.tex2D((int)x,(int)y);
float contrib = vec.w;
const float4 world = p(x,y);
if (world.x == MINF) return;
float4 vec = make_float4(0.0f, 0.0f, 0.0f, 0.0f); //ev.tex2D((int)x,(int)y);
float contrib = 0.0f;
// Calculate screen space distortion with neighbours
for (int v=-MOTION_RADIUS; v<=MOTION_RADIUS; ++v) {
for (int u=-MOTION_RADIUS; u<=MOTION_RADIUS; ++u) {
const float4 vecn = ev.tex2D((int)x+u,(int)y+v);
//const float3 pn = make_float3(p.tex2D((int)x+u,(int)y+v));
//if (pn.x == MINF) continue;
//const float s = ftl::cuda::spatialWeighting(pn, make_float3(world), 0.04f);
contrib += vecn.w;
vec += vecn.w * vecn;
}
Loading