Fix T74395: Box interpolation does not support repeat extrapolation

Reviewers: fclem

Differential Revision: https://developer.blender.org/D7009
This commit is contained in:
Jacques Lucke 2020-03-08 14:43:06 +01:00
parent bc2343d5c3
commit 7f404f1c74
Notes: blender-bot 2023-02-13 23:18:18 +01:00
Referenced by issue #74395, Setting image interpolation to "closest" and projection to "box" causes extrapolation setting "repeat" to fail
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}