[Bf-blender-cvs] [7f404f1c742] master: Fix T74395: Box interpolation does not support repeat extrapolation
Jacques Lucke
noreply at git.blender.org
Sun Mar 8 14:43:38 CET 2020
Commit: 7f404f1c74294c72cb66a708b26841b5ed6a84fb
Author: Jacques Lucke
Date: Sun Mar 8 14:43:06 2020 +0100
Branches: master
https://developer.blender.org/rB7f404f1c74294c72cb66a708b26841b5ed6a84fb
Fix T74395: Box interpolation does not support repeat extrapolation
Reviewers: fclem
Differential Revision: https://developer.blender.org/D7009
===================================================================
M source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl
===================================================================
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl
index 4633e59fde1..c39bec8ac64 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl
@@ -183,21 +183,21 @@ void tex_box_sample_nearest(
if (N.x < 0.0) {
uv.x = 1.0 - uv.x;
}
- ivec2 pix = ivec2(uv.xy * textureSize(ima, 0).xy);
+ ivec2 pix = ivec2(fract(uv.xy) * textureSize(ima, 0).xy);
color1 = texelFetch(ima, pix, 0);
/* Y projection */
uv = texco.xz;
if (N.y > 0.0) {
uv.x = 1.0 - uv.x;
}
- pix = ivec2(uv.xy * textureSize(ima, 0).xy);
+ pix = ivec2(fract(uv.xy) * textureSize(ima, 0).xy);
color2 = texelFetch(ima, pix, 0);
/* Z projection */
uv = texco.yx;
if (N.z > 0.0) {
uv.x = 1.0 - uv.x;
}
- pix = ivec2(uv.xy * textureSize(ima, 0).xy);
+ pix = ivec2(fract(uv.xy) * textureSize(ima, 0).xy);
color3 = texelFetch(ima, pix, 0);
}
More information about the Bf-blender-cvs
mailing list