USD: enable material displacement support #128909

Merged
Jesse Yurkovich merged 4 commits from deadpin/blender:hydra-displacement into main 2024-11-05 20:38:00 +01:00

This enables material displacement for UsdPreviewSurface import and
export. Scenarios are limited by what's supported by the preview surface
itself. Namely only Object Space displacement can be used (no vector
displacement)[1] and the Midlevel and Scale parameters are maintained by
adjusting the scale-bias on the image texture controlling the Height
(this means that Midlevel and Scale must be constants).

Hydra/MaterialX support is more complicated. First, there is a bug which
prevents scalar displacment from working correctly and that needs USD
2408+ for the fix[2]. Second, is that there's an open question about
which coordinate system to use for MaterialX's vector displacement maps.
Lastly, Hydra GL does not render displacement, making verification using
only Blender impossible[3]. As a result, this PR only makes MaterialX
"ready" for support, but stops short of actually connecting the final
piece of the node graph until more of the above can be sorted out.

Tests are added which cover:

  • Variations of Midlevel and Scale values
  • A constant Height setup
  • Negative scenarios checking that only Object space is supported
    and that midlevel and scale need to be constants

[1] https://openusd.org/release/spec_usdpreviewsurface.html
[2] https://github.com/PixarAnimationStudios/OpenUSD/issues/3325
[3] https://forum.aousd.org/t/materialx-displacement-hydra-storm/1098/2


New test data has been checked in: tests/data/usd/usd_materials_displace.blend

This enables material displacement for UsdPreviewSurface import and export. Scenarios are limited by what's supported by the preview surface itself. Namely only Object Space displacement can be used (no vector displacement)[1] and the Midlevel and Scale parameters are maintained by adjusting the scale-bias on the image texture controlling the Height (this means that Midlevel and Scale must be constants). Hydra/MaterialX support is more complicated. First, there is a bug which prevents scalar displacment from working correctly and that needs USD 2408+ for the fix[2]. Second, is that there's an open question about which coordinate system to use for MaterialX's vector displacement maps. Lastly, Hydra GL does not render displacement, making verification using only Blender impossible[3]. As a result, this PR only makes MaterialX "ready" for support, but stops short of actually connecting the final piece of the node graph until more of the above can be sorted out. Tests are added which cover: - Variations of Midlevel and Scale values - A constant Height setup - Negative scenarios checking that only Object space is supported and that midlevel and scale need to be constants [1] https://openusd.org/release/spec_usdpreviewsurface.html [2] https://github.com/PixarAnimationStudios/OpenUSD/issues/3325 [3] https://forum.aousd.org/t/materialx-displacement-hydra-storm/1098/2 ---- New test data has been checked in: `tests/data/usd/usd_materials_displace.blend`
Jesse Yurkovich added 4 commits 2024-10-12 02:12:34 +02:00
Unhook MaterialX displacement for now
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
5bdfa461c3
Author
Member

@blender-bot build

@blender-bot build
Jesse Yurkovich requested review from Michael Kowalski 2024-10-15 19:09:41 +02:00
Member

This is great! USD displacement export is something we've been waiting for on Poly Haven so we can publish all our materials as USD. (Re #106375)

This is great! USD displacement export is something we've been waiting for on Poly Haven so we can publish all our materials as USD. (Re #106375)
Author
Member

@GregZaal Yes, this is meant to address your issue :) Do you require MaterialX export at all or are you considering only using the preview surface? It just determines if I'll close out your issue after I checkin or if I leave it open until material x support lands.

@GregZaal Yes, this is meant to address your issue :) Do you require MaterialX export at all or are you considering only using the preview surface? It just determines if I'll close out your issue after I checkin or if I leave it open until material x support lands.
Member

@deadpin I'm not sure yet! We'll be working on compatibility with other 3D software via USD soon, so for now I'd say close the issue. MaterialX support is a bigger task than just "displacement support" right?

@deadpin I'm not sure yet! We'll be working on compatibility with other 3D software via USD soon, so for now I'd say close the issue. MaterialX support is a bigger task than just "displacement support" right?

These changes look good on a high level and work well in the tests. I'll take a closer look at the details and hope to finish my review in the next day or two.

These changes look good on a high level and work well in the tests. I'll take a closer look at the details and hope to finish my review in the next day or two.
Michael Kowalski approved these changes 2024-11-04 18:40:00 +01:00
Michael Kowalski left a comment
Member

The changes look good!

The changes look good!
Jesse Yurkovich merged commit b4c2feea38 into main 2024-11-05 20:38:00 +01:00
Jesse Yurkovich deleted branch hydra-displacement 2024-11-05 20:38:03 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
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#128909
No description provided.