diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/camera.cc | 4 | ||||
-rw-r--r-- | src/render/draw.cc | 18 |
2 files changed, 7 insertions, 15 deletions
diff --git a/src/render/camera.cc b/src/render/camera.cc index a55038d..287e4ad 100644 --- a/src/render/camera.cc +++ b/src/render/camera.cc @@ -265,8 +265,8 @@ void Camera::draw(float seconds) } if (core::localcontrol()->model()) { - camera_target -= (core::localcontrol()->model()->maxbbox().x + 0.1f) * camera_axis.forward(); - camera_target += (core::localcontrol()->model()->maxbbox().z + 0.1f ) * camera_axis.up(); + camera_target -= (core::localcontrol()->model()->maxbbox().x + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.forward(); + camera_target += (core::localcontrol()->model()->maxbbox().z + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.up(); } } else if (mode() == Free) { diff --git a/src/render/draw.cc b/src/render/draw.cc index d1b06ea..c650169 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -716,14 +716,14 @@ void draw_pass_sky() if (!(r_sky && r_sky->value())) return; - size_t flare_texture = Textures::load("textures/env/sky"); - Textures::bind(flare_texture); + size_t sky_texture = Textures::load("textures/env/sky"); + Textures::bind(sky_texture); gl::enable(GL_TEXTURE_2D); gl::push(); gl::translate(Camera::eye()); - draw_sphere_inside(math::Color(), 16000); + draw_sphere_inside(math::Color(), 8192); gl::pop(); gl::disable(GL_TEXTURE_2D); @@ -784,7 +784,7 @@ void draw(float seconds) gl::matrixmode(GL_PROJECTION); gl::loadidentity(); gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(), - -frustum_size, frustum_size, frustum_front, 16384.0f); + -frustum_size, frustum_size, frustum_front, 8192.0f); gl::matrixmode(GL_MODELVIEW); gl::loadidentity(); @@ -826,16 +826,8 @@ void draw(float seconds) draw_pass_default(); // draw entities without model - gl::disable(GL_RESCALE_NORMAL); - - // adjust the projection matrix for local world view - gl::matrixmode(GL_PROJECTION); - gl::loadidentity(); - gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(), - -frustum_size, frustum_size, frustum_front, 1024.0f); - gl::matrixmode(GL_MODELVIEW); - glEnableClientState(GL_COLOR_ARRAY); + gl::disable(GL_RESCALE_NORMAL); draw_pass_model_vertex(); // draw entities with model |