Unify Image Texture node in geometry and shader nodes #93905

Open
opened 2021-12-09 16:06:12 +01:00 by Brecht Van Lommel · 5 comments

Geometry nodes added a new Image Texture node where the image datablock is a socket.

We should unify these two nodes. There are some design decision to make regarding how to deal with image users and the frame offset socket, see discussion in {D12827.}.

Geometry nodes added a new Image Texture node where the image datablock is a socket. We should unify these two nodes. There are some design decision to make regarding how to deal with image users and the frame offset socket, see discussion in {[D12827](https://archive.blender.org/developer/D12827).}.
Member

Exposing the image as a socket adds a little more complexity in that I think the image used cannot vary per-evaluation like other options on the node like the position input. I assume that's an incorrect assumption.

To distinguish the "constant" inputs and the varying inputs, maybe it makes sense to add a concept like fields to the shader node graph.
Most sockets would become fields, but others like the image input and other inputs that are currently node properties could become non-field sockets.

This could reuse the existing field status inferencing used for geometry nodes.

Exposing the image as a socket adds a little more complexity in that I think the image used cannot vary per-evaluation like other options on the node like the position input. I assume that's an incorrect assumption. To distinguish the "constant" inputs and the varying inputs, maybe it makes sense to add a concept like fields to the shader node graph. Most sockets would become fields, but others like the image input and other inputs that are currently node properties could become non-field sockets. This could reuse the existing field status inferencing used for geometry nodes.
Author
Owner

Can you explain what the field status inferencing would do for shader nodes? I'm not sure what you mean by that exactly.

If we require there to be a fixed single image datablock per image texture node, without any links, then we can compute that as part of expanding all the group nodes into a single graph. We actually handle string sockets for Principled Volume already.

There's nothing explicitly enforcing these to be non-fields, but since there exist no nodes that can edit strings this is not a problem. I guess the inferencing becomes important once we add nodes that can e.g. switch an image or string based on an integer.

Can you explain what the field status inferencing would do for shader nodes? I'm not sure what you mean by that exactly. If we require there to be a fixed single image datablock per image texture node, without any links, then we can compute that as part of expanding all the group nodes into a single graph. We actually handle string sockets for Principled Volume already. There's nothing explicitly enforcing these to be non-fields, but since there exist no nodes that can edit strings this is not a problem. I guess the inferencing becomes important once we add nodes that can e.g. switch an image or string based on an integer.
Member

The fields status would make that distinction explicit on the user level, making it much easier to tell which sockets can be adjusted per shader evaluation and which sockets are computed ahead of time for the whole material.

Here's a slightly contrived example:
This setup is invalid:
image.png

But this setup is totally fine:
image.png

Other inputs that this could apply to:

  • Attribute > Name
  • Sky Texture > All node properties
  • AOV Output > Name
  • Point Density > Object

Maybe some of those are pushing some fundamental limits, but the simple ones like the image socket and attribute name make a lot of sense I think.

The fields status would make that distinction explicit on the user level, making it much easier to tell which sockets can be adjusted per shader evaluation and which sockets are computed ahead of time for the whole material. Here's a slightly contrived example: This setup is invalid: ![image.png](https://archive.blender.org/developer/F13016328/image.png) But this setup is totally fine: ![image.png](https://archive.blender.org/developer/F13016337/image.png) Other inputs that this could apply to: - Attribute > Name - Sky Texture > All node properties - AOV Output > Name - Point Density > Object Maybe some of those are pushing some fundamental limits, but the simple ones like the image socket and attribute name make a lot of sense I think.
Brecht Van Lommel added this to the Render & Cycles project 2023-02-07 19:08:06 +01:00
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:02:52 +01:00
Member

Any news on this? The image socket type is so important for reusability!

Any news on this? The image socket type is so important for reusability!
Member

I made a larger design task about fields, high level interfaces and materials here: #112547

I think it's essential to address this feature (image sockets) as part of a bigger picture of material node graph reusability.

I made a larger design task about fields, high level interfaces and materials here: #112547 I think it's essential to address this feature (image sockets) as part of a bigger picture of material node graph reusability.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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 Assignees
3 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#93905
No description provided.