From f092ee3de465788274687809ba71888a03148de9 Mon Sep 17 00:00:00 2001 From: yvain Date: Fri, 6 Sep 2024 16:26:23 +0200 Subject: [PATCH] fix make_mesh and forward render path --- Sources/armory/renderpath/RenderPathForward.hx | 7 +++++++ blender/arm/material/make_mesh.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/armory/renderpath/RenderPathForward.hx b/Sources/armory/renderpath/RenderPathForward.hx index ebafc7c63..b906994c5 100644 --- a/Sources/armory/renderpath/RenderPathForward.hx +++ b/Sources/armory/renderpath/RenderPathForward.hx @@ -449,6 +449,13 @@ class RenderPathForward { } #end + #if rp_ssrefr + { + path.setTarget("gbuffer_refraction"); + path.clearTarget(0xffffff00); + } + #end + RenderPathCreator.setTargetMeshes(); #if rp_shadowmap diff --git a/blender/arm/material/make_mesh.py b/blender/arm/material/make_mesh.py index f083fb24b..9824b8f6e 100644 --- a/blender/arm/material/make_mesh.py +++ b/blender/arm/material/make_mesh.py @@ -799,7 +799,7 @@ def make_forward_base(con_mesh, parse_opacity=False, transluc_pass=False): frag.add_uniform('sampler3D voxels') frag.add_uniform('sampler3D voxelsSDF') frag.write('if (opacity < 1.0) {') - frag.write(' vec3 refraction = traceRefraction(wposition, n, voxels, voxelsSDF, vVec, ior, roughness, clipmaps, gl_FragCoord.xy).rgb * voxelgiRefr;') + frag.write(' vec3 refraction = traceRefraction(wposition, n, voxels, voxelsSDF, vVec, ior, roughness, clipmaps, texCoord).rgb * voxelgiRefr;') frag.write(' indirect = mix(refraction, indirect, opacity);') frag.write(' direct = mix(refraction, direct, opacity);') frag.write('}')