diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-30 16:25:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 16:25:20 +0200 |
commit | b4a5bbaea28e68ffdec84fbed4d179b72ecb9a35 (patch) | |
tree | 55e906807a2f5c8fc1a34849804d8a3eedd42503 /servers/rendering | |
parent | d29514accef09ba0402cdbb87ec5f5e773a48bbc (diff) | |
parent | f7706659b560ad2c4453f69551c3f6115c93364a (diff) |
Merge pull request #38337 from RandomShaper/time_rollback
Improve shader time roll over
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/rasterizer_rd/rasterizer_rd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/rendering/rasterizer_rd/rasterizer_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_rd.cpp index 9c54f0caae..4c92912e9c 100644 --- a/servers/rendering/rasterizer_rd/rasterizer_rd.cpp +++ b/servers/rendering/rasterizer_rd/rasterizer_rd.cpp @@ -30,6 +30,8 @@ #include "rasterizer_rd.h" +#include "core/project_settings.h" + void RasterizerRD::prepare_for_blitting_render_targets() { RD::get_singleton()->prepare_screen_for_drawing(); } @@ -78,6 +80,10 @@ void RasterizerRD::blit_render_targets_to_screen(DisplayServer::WindowID p_scree void RasterizerRD::begin_frame(double frame_step) { frame++; time += frame_step; + + double time_roll_over = GLOBAL_GET("rendering/limits/time/time_rollover_secs"); + time = Math::fmod(time, time_roll_over); + canvas->set_time(time); scene->set_time(time, frame_step); } |