shader editor's image texture node is aligning image to the wrong local axis when box projection is used. #113038

Open
opened 2023-09-29 00:32:48 +02:00 by michael campbell · 4 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99

Blender Version
Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-09-27 15:44, hash: f9dce9276748
Worked: Unknown

Short description of error
image texture node is aligning image to the wrong coordinates when box projection is used.

Exact steps for others to reproduce the error

  • Open attached blend file in 4.0 beta
  • notice how although the generated texture coordinates are identical, when the image texture node is set to box projection, the image's x axis is mapped to the texture coordinates y value, and the image's y axis is mapped to the texture coordinates x value.
  • This incorrect xy alignment also results in the side of the object (z texture coordinates) being flipped too.
  • Try to rotate the texture on the z axis so that the picture is the right way up, without losing the image on the side of the object.

It's quite a problem because it's not possible to use the mapping node to rotate the image the correct way up without the texture being lost on the side of the object. The only way to fix it is to modify the orientation of the origin, which isn't ideal. I think if this has been done along the wrong axis intentionally because objects are created with z up, then there could be an image alignment option on the image texture node to specify whether you want the image's rotation on the box projection to be aligned to the local xyz (expected), or to the local xzy (current).

Box projection image xy is flipped:
image

image

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.99 **Blender Version** Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-09-27 15:44, hash: `f9dce9276748` Worked: Unknown **Short description of error** image texture node is aligning image to the wrong coordinates when box projection is used. **Exact steps for others to reproduce the error** - Open attached blend file in 4.0 beta - notice how although the generated texture coordinates are identical, when the image texture node is set to box projection, the image's x axis is mapped to the texture coordinates y value, and the image's y axis is mapped to the texture coordinates x value. - This incorrect xy alignment also results in the side of the object (z texture coordinates) being flipped too. - Try to rotate the texture on the z axis so that the picture is the right way up, without losing the image on the side of the object. It's quite a problem because it's not possible to use the mapping node to rotate the image the correct way up without the texture being lost on the side of the object. The only way to fix it is to modify the orientation of the origin, which isn't ideal. I think if this has been done along the wrong axis intentionally because objects are created with z up, then there could be an image alignment option on the image texture node to specify whether you want the image's rotation on the box projection to be aligned to the local xyz (expected), or to the local xzy (current). Box projection image xy is flipped: ![image](/attachments/97cef3a6-f624-4724-b286-006e2dd62045) ![image](/attachments/1f1f65e2-69f0-4b74-8152-8069af7fb89a)
michael campbell added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-09-29 00:32:49 +02:00
michael campbell changed title from shader editor's image texture node is aligning image to the wrong coordinates when box projection is used. to shader editor's image texture node is aligning image to the wrong local axis when box projection is used. 2023-09-29 12:17:19 +02:00
Member

Worked: 2.93

Lets first get this out of the way
image

So looks the same for me in 2.93

dd8016f708 is probably the relevant commit, see the following comment:
/* Map so that no textures are flipped, rotation is somewhat arbitrary. */

But yeah, lets first check if this was indeed different for you in 2.93?

>Worked: 2.93 Lets first get this out of the way ![image](/attachments/2a240df7-1818-4b7d-98f5-da49b638dbc0) So looks the same for me in 2.93 dd8016f7081f is probably the relevant commit, see the following comment: ` /* Map so that no textures are flipped, rotation is somewhat arbitrary. */ ` But yeah, lets first check if this was indeed different for you in 2.93?
829 KiB
Philipp Oeser added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-09-29 13:09:28 +02:00

I think you might be reading an old version, I've edited it since then. The issue is there in 2.93 too (I hadn't noticed the local transform was oriented with z up in 2.93 whereas in 4.0 it was oriented y up). Either way It projects from the z axis downwards, but the x and y are flipped (see additional image I added to the main report text)

I think you might be reading an old version, I've edited it since then. The issue is there in 2.93 too (I hadn't noticed the local transform was oriented with z up in 2.93 whereas in 4.0 it was oriented y up). Either way It projects from the z axis downwards, but the x and y are flipped (see additional image I added to the main report text)
michael campbell changed title from shader editor's image texture node is aligning image to the wrong local axis when box projection is used. to shader editor's image texture node is aligning image to the wrong local axis when box projection is used. 2023-09-29 13:21:49 +02:00
Member

OK, so while rotation might seem a bit arbitrary (see the code comment in #113038 (comment)), I do indeed think it makes sense to match what we get from flat projection in box projection.

Will put up a PR for this , lets see what others think (this of course will break a lot of old files, but maybe 4.0 is a good chance to rectify this).

OK, so while rotation might seem a bit arbitrary (see the code comment in https://projects.blender.org/blender/blender/issues/113038#issuecomment-1034009), I do indeed think it makes sense to match what we get from flat projection in box projection. Will put up a PR for this , lets see what others think (this of course will break a lot of old files, but maybe 4.0 is a good chance to rectify this).
Member

Confirming for now, not sure yet what/if a solution will be in place (see discussion in !113064)

Confirming for now, not sure yet what/if a solution will be in place (see discussion in !113064)
Philipp Oeser added
Module
Render & Cycles
Status
Confirmed
and removed
Status
Needs Information from User
labels 2023-10-11 12:18:53 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113038
No description provided.