Add probe refresh timer (similiar to how shadows work) to generate probes correctly on scene load
This commit is contained in:
parent
de928a44ce
commit
eab8a265f4
2 changed files with 6 additions and 0 deletions
|
@ -238,6 +238,7 @@ public:
|
||||||
std::array<bool, max_spot_shadows> spot_light_dirty;
|
std::array<bool, max_spot_shadows> spot_light_dirty;
|
||||||
|
|
||||||
int shadow_refresh_timer = 5;
|
int shadow_refresh_timer = 5;
|
||||||
|
int probe_refresh_timer = 5;
|
||||||
|
|
||||||
// environment
|
// environment
|
||||||
std::array<bool, max_environment_probes> environment_dirty;
|
std::array<bool, max_environment_probes> environment_dirty;
|
||||||
|
|
|
@ -156,6 +156,11 @@ void SceneCapture::create_scene_resources(Scene& scene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneCapture::render(GFXCommandBuffer* command_buffer, Scene* scene) {
|
void SceneCapture::render(GFXCommandBuffer* command_buffer, Scene* scene) {
|
||||||
|
if(scene->probe_refresh_timer > 0) {
|
||||||
|
scene->probe_refresh_timer--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int last_probe = 0;
|
int last_probe = 0;
|
||||||
auto probes = scene->get_all<EnvironmentProbe>();
|
auto probes = scene->get_all<EnvironmentProbe>();
|
||||||
for(auto [obj, probe] : probes) {
|
for(auto [obj, probe] : probes) {
|
||||||
|
|
Reference in a new issue