16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

opengl 3.3 renderer cascaded shadow maps, minor gfx renderer optimizations

This commit is contained in:
tmj-fstate
2019-12-05 15:42:54 +01:00
parent 194400e1af
commit 63619d13a6
21 changed files with 416 additions and 443 deletions

View File

@@ -37,14 +37,8 @@ bool
opengl_camera::visible( TDynamicObject const *Dynamic ) const {
// sphere test is faster than AABB, so we'll use it here
glm::vec3 diagonal(
static_cast<float>( Dynamic->MoverParameters->Dim.L ),
static_cast<float>( Dynamic->MoverParameters->Dim.H ),
static_cast<float>( Dynamic->MoverParameters->Dim.W ) );
// we're giving vehicles some extra padding, to allow for things like shared bogeys extending past the main body
float const radius = glm::length( diagonal ) * 0.65f;
return ( m_frustum.sphere_inside( Dynamic->GetPosition(), radius ) > 0.0f );
return ( m_frustum.sphere_inside( Dynamic->GetPosition(), Dynamic->radius() * 1.25 ) > 0.0f );
}
// debug helper, draws shape of frustum in world space