Fix #113038: Box projection rotation inconsistent for dominant Z axis #113064

Open
Philipp Oeser wants to merge 1 commits from lichtwerk/blender:113038 into blender-v4.0-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 6 additions and 6 deletions

View File

@ -216,7 +216,7 @@ shader node_image_texture(int use_mapping = 0,
Alpha += weight[1] * tmp_alpha;
}
if (weight[2] > 0.0) {
point UV = point((signed_Nob[2] > 0.0) ? 1.0 - p[1] : p[1], p[0], 0.0);
point UV = point((signed_Nob[2] < 0.0) ? 1.0 - p[0] : p[0], p[1], 0.0);
Color += weight[2] * image_texture_lookup(filename,
UV[0],
UV[1],

View File

@ -199,7 +199,7 @@ ccl_device_noinline void svm_node_tex_image_box(KernelGlobals kg,
f += weight.y * svm_image_texture(kg, id, uv.x, uv.y, flags);
}
if (weight.z > 0.0f) {
float2 uv = make_float2((signed_N.z > 0.0f) ? 1.0f - co.y : co.y, co.x);
float2 uv = make_float2((signed_N.z < 0.0f) ? 1.0f - co.x : co.x, co.y);
f += weight.z * svm_image_texture(kg, id, uv.x, uv.y, flags);
}

View File

@ -82,8 +82,8 @@ void tex_box_sample_linear(
}
color2 = texture(ima, uv);
/* Z projection */
uv = texco.yx;
if (N.z > 0.0) {
uv = texco.xy;
if (N.z < 0.0) {
uv.x = 1.0 - uv.x;
}
color3 = texture(ima, uv);
@ -106,8 +106,8 @@ void tex_box_sample_cubic(
}
node_tex_image_cubic(uv.xyy, ima, color2, alpha);
/* Z projection */
uv = texco.yx;
if (N.z > 0.0) {
uv = texco.xy;
if (N.z < 0.0) {
uv.x = 1.0 - uv.x;
}
node_tex_image_cubic(uv.xyy, ima, color3, alpha);