diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_effects.c | 1 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 9466366b740..5f61ed66386 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -218,6 +218,7 @@ static struct GPUShader *eevee_effects_ssr_shader_get(int options) } else { BLI_dynstr_appendf(ds_defines, "#define STEP_RAYTRACE\n"); + BLI_dynstr_appendf(ds_defines, "#define PLANAR_PROBE_RAYTRACE\n"); } if (options & SSR_FULL_TRACE) { BLI_dynstr_appendf(ds_defines, "#define FULLRES\n"); diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl index 9656bb0b4af..c593081ce91 100644 --- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl @@ -10,19 +10,24 @@ uniform float borderFadeFactor; float sample_depth(vec2 uv, int index, float lod) { +#ifdef PLANAR_PROBE_RAYTRACE if (index > -1) { return textureLod(planarDepth, vec3(uv, index), 0.0).r; } else { +#endif /* Correct UVs for mipmaping mis-alignment */ uv *= mipRatio[int(lod + 1.0)]; return textureLod(maxzBuffer, uv, lod).r; +#ifdef PLANAR_PROBE_RAYTRACE } +#endif } vec4 sample_depth_grouped(vec4 uv1, vec4 uv2, int index, float lod) { vec4 depths; +#ifdef PLANAR_PROBE_RAYTRACE if (index > -1) { depths.x = textureLod(planarDepth, vec3(uv1.xy, index), 0.0).r; depths.y = textureLod(planarDepth, vec3(uv1.zw, index), 0.0).r; @@ -30,11 +35,14 @@ vec4 sample_depth_grouped(vec4 uv1, vec4 uv2, int index, float lod) depths.w = textureLod(planarDepth, vec3(uv2.zw, index), 0.0).r; } else { +#endif depths.x = textureLod(maxzBuffer, uv1.xy, lod).r; depths.y = textureLod(maxzBuffer, uv1.zw, lod).r; depths.z = textureLod(maxzBuffer, uv2.xy, lod).r; depths.w = textureLod(maxzBuffer, uv2.zw, lod).r; +#ifdef PLANAR_PROBE_RAYTRACE } +#endif return depths; } |