Skip to content

Commit

Permalink
simplify voxelize(), increase Level on updateFrame()
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002e committed Jan 13, 2024
1 parent 148490b commit e769cd7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Sources/iron/RenderPath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Sources/iron/Scene.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e769cd7

Please sign in to comment.