Fix #96458: Add channel processing for UsdUVTexture #117901
No reviewers
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117901
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:96458"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds the processing required to import and export simple material graphs utilizing the UsdUVTexture outputs channels.
If only r, g or b are specified as output, we hook up a
Separate Color
node and connect the appropriate channel from there.(if a is specified as output, the Alpha output of an image texture node was used already)
On the export side, we traverse from the socket to the image texture node, and if a
Separate Color
on the way, we are using the channel from there to put on the output.https://openusd.org/release/spec_usdpreviewsurface.html#texture-reader
Retargeting for 4.1.
The changes look good to me and work nicely in my tests. Very nice work!
My one concern is that on import, duplicate
Separate Color
nodes are created when multipleUsdUVTexture
outputs are connected. (This is also an issue with the current code for converting texture scale/bias values, where duplicateVector Math
nodes are created for separate inputs.)See the attached images for an example. When the original Blender shaders in
original.png
are exported to USD and the USD is re-imported into Blender, we get an excessive number of nodes, as shown innodes_from_usd.png
.I have a proposed fix for this in https://projects.blender.org/makowalski/blender/src/branch/fix_duplicate_imported_shaders, in commit
5557f23fd1
The fix uses heuristics to cache and re-use nodes where possible. With this change the nodes are shared on import, as seen in
nodes_from_usd_fixed.png
.However, I'm fine with this pull request getting committed as is, and am approving it. I can submit the changes in my
fix_duplicate_imported_shaders
branch as a separate pull request for review after the current changes go in.Works well with the scenes and hand-crafted files I put together.
Yeah, I was mentioning that as well in #96458 (comment)
"it might make sense to cache the Separate Color nodes as well (so we dont create multiple of these for a single texture)"
This looks good to me.
OK, will merge the PR in a bit then. Thx already for the future followup "duplicate fix" commit!