Fixed for compiler version 0.2.012
This commit is contained in:
@@ -4,7 +4,7 @@ calc_tight_light_projection :: (camera: Camera, light_direction: Vector3) -> Mat
|
||||
frustum := get_frustum(camera.fov, aspect_ratio, camera.z_near, camera.z_far);
|
||||
|
||||
// View frustum back to world space
|
||||
inv_camera_view := inverse(camera.view_matrix);
|
||||
success :, inv_camera_view := inverse(camera.view_matrix);
|
||||
view_frustum_in_world_space := transform(frustum, inv_camera_view);
|
||||
|
||||
light_view := look_at_lh(.{0,0,0}, light_direction, .{0,1,0});
|
||||
@@ -15,7 +15,7 @@ calc_tight_light_projection :: (camera: Camera, light_direction: Vector3) -> Mat
|
||||
top_right := Vector3.{aabb.max.x, aabb.max.y, aabb.min.z};
|
||||
light_pos_world := (bottom_left + top_right) * 0.5;
|
||||
|
||||
inverse_light_view := inverse(light_view);
|
||||
succes, inverse_light_view := inverse(light_view);
|
||||
light_pos_world = transform_position(light_pos_world, inverse_light_view);
|
||||
|
||||
light_view = look_at_lh(light_pos_world, light_pos_world + light_direction, .{0,1,0});
|
||||
|
||||
Reference in New Issue
Block a user