diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
4 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl index 14fd6d3dff5..7cf4259a938 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl @@ -131,8 +131,7 @@ void main() /* Add a N pixel border to ensure filtering is correct * for N mipmap levels. */ - uvs += uvs * texelSize * paddingSize * 2.0; - uvs -= texelSize * paddingSize; + uvs = (uvs - texelSize * paddingSize) / (1.0 - 2.0 * texelSize * paddingSize); /* edge mirroring : only mirror if directly adjacent * (not diagonally adjacent) */ diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl index e4199e6a5ed..bb23051b7e5 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl @@ -30,8 +30,7 @@ void main() { /* Add a N pixel border to ensure filtering is correct * for N mipmap levels. */ - uvs += uvs * texelSize * paddingSize * 2.0; - uvs -= texelSize * paddingSize; + uvs = (uvs - paddingSize) / (1.0 - 2.0 * paddingSize); /* edge mirroring : only mirror if directly adjacent * (not diagonally adjacent) */ diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl index 211fa8f0ce8..083d2313337 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_visibility_frag.glsl @@ -49,8 +49,7 @@ void main() cos.xy = (vec2(texel) + 0.5) * storedTexelSize; /* add a 2 pixel border to ensure filtering is correct */ - cos.xy *= 1.0 + storedTexelSize * 2.0; - cos.xy -= storedTexelSize; + cos.xy = (cos.xy - storedTexelSize) / (1.0 - 2.0 * storedTexelSize); float pattern = 1.0; diff --git a/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl b/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl index 631b325ae37..ec13c885bbb 100644 --- a/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/octahedron_lib.glsl @@ -13,8 +13,7 @@ vec2 mapping_octahedron(vec3 cubevec, vec2 texel_size) vec2 uvs = cubevec.xy * (0.5) + 0.5; /* edge filtering fix */ - uvs *= 1.0 - 2.0 * texel_size; - uvs += texel_size; + uvs = (1.0 - 2.0 * texel_size) * uvs + texel_size; return uvs; } |