diff --git a/Sources/iron/RenderPath.hx b/Sources/iron/RenderPath.hx index ec2cb70e..e924db80 100644 --- a/Sources/iron/RenderPath.hx +++ b/Sources/iron/RenderPath.hx @@ -19,6 +19,7 @@ import iron.object.MeshObject; import iron.object.Uniforms; class RenderPath { + public static var active: RenderPath; public var frameScissor = false; @@ -124,7 +125,6 @@ class RenderPath { commands(); if (!isProbe) frame++; - } public function setTarget(target: String, additional: Array = null, viewportScale = 1.0) { diff --git a/Sources/iron/Scene.hx b/Sources/iron/Scene.hx index 3f38132a..462de368 100644 --- a/Sources/iron/Scene.hx +++ b/Sources/iron/Scene.hx @@ -27,7 +27,6 @@ import iron.data.TerrainStream; import iron.data.SceneStream; import iron.data.MeshBatch; import iron.system.Time; - using StringTools; class Scene { @@ -214,6 +213,9 @@ class Scene { Data.getSceneRaw(sceneName, function(format: TSceneFormat) { Scene.create(format, function(o: Object) { if (done != null) done(o); + #if rp_voxels // Revoxelize + RenderPath.active.voxelized = 0; + #end #if (rp_background == "World") if (removeWorldShader != null) { diff --git a/Sources/iron/data/ShaderData.hx b/Sources/iron/data/ShaderData.hx index ac42101f..b5c66670 100644 --- a/Sources/iron/data/ShaderData.hx +++ b/Sources/iron/data/ShaderData.hx @@ -80,7 +80,7 @@ class ShaderContext { public function new(raw: TShaderContext, done: ShaderContext->Void, overrideContext: TShaderOverride = null) { this.raw = raw; - #if (rp_voxels == "Off") + #if (!rp_voxels) if (raw.name == "voxel") { done(this); return; diff --git a/Sources/iron/object/MeshObject.hx b/Sources/iron/object/MeshObject.hx index 15f1ed26..089144fa 100644 --- a/Sources/iron/object/MeshObject.hx +++ b/Sources/iron/object/MeshObject.hx @@ -167,6 +167,10 @@ class MeshObject extends Object { if (skip_context == context) return setCulled(isShadow, true); if (force_context != null && force_context != context) return setCulled(isShadow, true); + #if (!arm_voxelgi_revox) // No revox - do not voxelize moving objects + if (context == "voxel" && raw != null && raw.mobile == true) return setCulled(isShadow, true); + #end + return setCulled(isShadow, false); }