Shadow stuff
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
calc_tight_light_projection :: (camera: Camera, light_direction: Vector3) -> Matrix4 {
|
calc_tight_light_projection :: (camera: Camera, light_direction: Vector3) -> Matrix4 {
|
||||||
// View space camera frustum
|
// View space camera frustum
|
||||||
aspect_ratio := cast(float)engine.renderer.render_target_height / cast(float)engine.renderer.render_target_width;
|
aspect_ratio := cast(float)engine.renderer.render_target_height / cast(float)engine.renderer.render_target_width;
|
||||||
frustum := get_frustum(camera.fov, aspect_ratio, camera.z_near-20.0, camera.z_far+20);
|
frustum := get_frustum(camera.fov, aspect_ratio, camera.z_near, camera.z_far);
|
||||||
|
|
||||||
// View frustum back to world space
|
// View frustum back to world space
|
||||||
success :, inv_camera_view := inverse(camera.view_matrix);
|
success :, inv_camera_view := inverse(camera.view_matrix);
|
||||||
@@ -122,4 +122,4 @@ sync_engine_buffers :: () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user