From e769cd76f1fc150ff06466b8613c571998004453 Mon Sep 17 00:00:00 2001 From: Yvain Date: Sat, 13 Jan 2024 17:59:24 +0100 Subject: [PATCH] simplify voxelize(), increase Level on updateFrame() --- Sources/iron/RenderPath.hx | 10 ++++------ Sources/iron/Scene.hx | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/iron/RenderPath.hx b/Sources/iron/RenderPath.hx index 0766a03a..1615c37b 100644 --- a/Sources/iron/RenderPath.hx +++ b/Sources/iron/RenderPath.hx @@ -76,18 +76,16 @@ class RenderPath { #if (rp_voxels != "Off") static var voxelized = 0; public function voxelize() : Bool { - if(iron.Scene.active.camera.transform.diff() && armory.renderpath.RenderPathCreator.clipmapLevel == 0) { - voxelized = 0; + if(iron.Scene.active.camera.transform.diff()) { + return true; } - /* else for (mesh in iron.Scene.active.meshes) { - if (mesh.transform.diff() && armory.renderpath.RenderPathCreator.clipmapLevel == 0) { - voxelized = 0; + if (mesh.transform.diff()) { + return true; break; } } - */ return ++voxelized > Main.voxelgiClipmapCount ? false : true; } #end diff --git a/Sources/iron/Scene.hx b/Sources/iron/Scene.hx index 3f38132a..b08f5e96 100644 --- a/Sources/iron/Scene.hx +++ b/Sources/iron/Scene.hx @@ -237,6 +237,10 @@ class Scene { #end for (anim in animations) anim.update(Time.delta); for (e in empties) if (e != null && e.parent != null) e.transform.update(); + + #if (rp_voxels != "Off") + armory.renderpath.RenderPathCreator.clipmapLevel = (armory.renderpath.RenderPathCreator.clipmapLevel + 1) % Main.voxelgiClipmapCount; + #end } public function renderFrame(g: kha.graphics4.Graphics) {