mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix shadow flicker on camera offset update (#15709)
This commit is contained in:
parent
7c6ade0fc5
commit
b861f0c5c5
4 changed files with 25 additions and 22 deletions
|
@ -2984,6 +2984,10 @@ void Game::updateCameraOffset()
|
|||
return;
|
||||
|
||||
if (!m_flags.disable_camera_update) {
|
||||
auto *shadow = RenderingEngine::get_shadow_renderer();
|
||||
if (shadow)
|
||||
shadow->getDirectionalLight().updateCameraOffset(camera);
|
||||
|
||||
env.getClientMap().updateCamera(camera->getPosition(),
|
||||
camera->getDirection(), camera->getFovMax(), camera_offset,
|
||||
env.getLocalPlayer()->light_color);
|
||||
|
@ -3978,11 +3982,10 @@ void Game::updateShadows()
|
|||
v3f light = is_day ? sky->getSunDirection() : sky->getMoonDirection();
|
||||
|
||||
v3f sun_pos = light * offset_constant;
|
||||
|
||||
shadow->getDirectionalLight().setDirection(sun_pos);
|
||||
shadow->setTimeOfDay(in_timeofday);
|
||||
|
||||
shadow->getDirectionalLight().update_frustum(camera, client, m_camera_offset_changed);
|
||||
shadow->getDirectionalLight().updateFrustum(camera, client);
|
||||
}
|
||||
|
||||
void Game::drawScene(ProfilerGraph *graph, RunStats *stats)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue