Adaptive perspective camera frustrum

This commit is contained in:
Enrico Turri 2019-06-24 09:38:46 +02:00
parent e5be8adadf
commit 8b3d88bc0a
3 changed files with 99 additions and 18 deletions

View file

@ -3902,8 +3902,11 @@ void GLCanvas3D::_render_overlays() const
glsafe(::glDisable(GL_DEPTH_TEST));
glsafe(::glPushMatrix());
glsafe(::glLoadIdentity());
// ensure the textures are renderered inside the frustrum
// ensure that the textures are renderered inside the frustrum
glsafe(::glTranslated(0.0, 0.0, -(m_camera.get_near_z() + 0.5)));
// ensure that the overlay fits the frustrum near z plane
double gui_scale = m_camera.get_gui_scale();
glsafe(::glScaled(gui_scale, gui_scale, 1.0));
_render_gizmos_overlay();
_render_warning_texture();