diff --git a/assets/video.gif b/assets/video.gif new file mode 100644 index 0000000..305a74a Binary files /dev/null and b/assets/video.gif differ diff --git a/kernels/ray_caster_kernel.cl b/kernels/ray_caster_kernel.cl index f48c323..d27448c 100644 --- a/kernels/ray_caster_kernel.cl +++ b/kernels/ray_caster_kernel.cl @@ -13,6 +13,8 @@ float4 white_light(float4 input, float3 light, int3 mask) { } + + __kernel void min_kern( global char* map, global int3* map_dim, @@ -62,6 +64,8 @@ __kernel void min_kern( // for all 3 axis XYZ. float3 intersection_t = delta_t * offset; + // for negative values, wrap around the delta_t, rather not do this + // component wise, but it doesn't appear to want to work if (intersection_t.x < 0) { intersection_t.x += delta_t.x; } @@ -86,7 +90,7 @@ __kernel void min_kern( do { mask = intersection_t.xyz <= min(intersection_t.yzx, intersection_t.zxy); - float3 thing = delta_t * fabs(convert_float3(mask.xyz)); + intersection_t += delta_t * fabs(convert_float3(mask.xyz)); voxel.xyz += voxel_step.xyz * mask.xyz; diff --git a/src/Camera.cpp b/src/Camera.cpp index 1ace366..884adcb 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -68,7 +68,7 @@ int Camera::update(double delta_time) { // so vector multiplication broke? // have to do it component wise - double multiplier = 10; + double multiplier = 40; position.x += movement.x * delta_time * multiplier; position.y += movement.y * delta_time * multiplier;