mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
Add dynamic exposure correction (#12959)
* Add uniform for frame delta time * Adjust exposure in logarithmic (EV) space * Add network support and LUA API * Add testing mod
This commit is contained in:
parent
2715cc8bf6
commit
6d45c243f8
29 changed files with 567 additions and 71 deletions
|
@ -531,8 +531,13 @@ void ClientEnvironment::updateFrameTime(bool is_paused)
|
|||
{
|
||||
// if paused, m_frame_time_pause_accumulator increases by dtime,
|
||||
// otherwise, m_frame_time increases by dtime
|
||||
if (is_paused)
|
||||
if (is_paused) {
|
||||
m_frame_dtime = 0;
|
||||
m_frame_time_pause_accumulator = porting::getTimeMs() - m_frame_time;
|
||||
else
|
||||
m_frame_time = porting::getTimeMs() - m_frame_time_pause_accumulator;
|
||||
}
|
||||
else {
|
||||
auto new_frame_time = porting::getTimeMs() - m_frame_time_pause_accumulator;
|
||||
m_frame_dtime = new_frame_time - MYMAX(m_frame_time, m_frame_time_pause_accumulator);
|
||||
m_frame_time = new_frame_time;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue