working on the frame controller, this might get messy

This commit is contained in:
MitchellHansen
2017-10-01 17:01:05 -07:00
parent 4d6cecc7e0
commit 5fcf1c0e44
12 changed files with 100 additions and 95 deletions

View File

@@ -375,7 +375,7 @@ __kernel void raycaster(
bool shadow_ray = false;
// Andrew Woo's raycasting algo
while (distance_traveled < max_distance && bounce_count < 2) {
while (distance_traveled < max_distance && bounce_count < 4) {
// Fancy no branch version of the logic step
face_mask = intersection_t.xyz <= min(intersection_t.yzx, intersection_t.zxy);
@@ -387,6 +387,7 @@ __kernel void raycaster(
voxel_data = 5;
voxel.xyz -= voxel_step.xyz * face_mask.xyz;
first_strike = mix(fog_color, voxel_color, 1.0 - max(distance_traveled / 700.0f, (float)0));
break;
}
@@ -537,10 +538,10 @@ __kernel void raycaster(
texture_atlas,
convert_int2(tile_face_position * convert_float2(*atlas_dim / *tile_dim)) +
convert_int2((float2)(3, 4) * convert_float2(*atlas_dim / *tile_dim))
).xyz/2;
).xyz/4;
voxel_color.w += 0.3f;
max_distance = 500;
voxel_color -= 0.3f;
max_distance = 700;
distance_traveled = 0;
float3 hit_pos = convert_float3(voxel) + face_position;