Improve UDIM functionality #72390

Open
opened 2019-12-12 15:55:23 +01:00 by Lukas Stockner · 39 comments
Member

The UDIM code from D3509 covers basic use cases, but there still are quite a few ToDos:

  • Correct UDIM drawing in workbench engine (D6421 or D6456)
  • UDIM support in Cycles with OSL (fa5e28ab08)
  • Add multiple tiles at once (e0cd5b980f)
  • Filling tiles during creation (11d9271804)
  • Support opening UDIMs by selecting any secondary tile in File Editor (bdbcb0df10)
  • Disable Add and Fill operators when primary tile is empty (850aa3a6cf)
  • Avoiding the texture limit in Eevee (D6456)
  • Consider adding support for different file name schemes (e.g. "u0_v0" instead of "1001") #77989 (UDIM Textures: support for different file name schemes)
  • Add operator for finding additional tiles on disk ( or support this via the image reload operator? #75116 (UDIM tiles not recognized when reloading images))
  • UDIM packing/unpacking (D14395, originally D6492)
  • Baking UDIMs (related to D3203), report #95190
  • Tools for UDIM-aware UV editing (e.g. "Move selection to separate tile")
  • Support for UDIMs in various other features that work with images
  • Displacement Modifier (f9e65fcea7)
  • "Edit Externally" (D7789 / #73730)
  • "Export UV Layout" blender/blender-addons#74325
  • Node Wrangler Principled Setup blender/blender-addons#93496
  • Generated UDIM images not saved properly (D14885 / #97251)
The UDIM code from [D3509](https://archive.blender.org/developer/D3509) covers basic use cases, but there still are quite a few ToDos: - [x] Correct UDIM drawing in workbench engine ([D6421](https://archive.blender.org/developer/D6421) or [D6456](https://archive.blender.org/developer/D6456)) - [x] UDIM support in Cycles with OSL (fa5e28ab08) - [x] Add multiple tiles at once (e0cd5b980f) - [x] Filling tiles during creation (11d9271804) - [x] Support opening UDIMs by selecting any secondary tile in File Editor (bdbcb0df10) - [x] Disable Add and Fill operators when primary tile is empty (850aa3a6cf) - [x] Avoiding the texture limit in Eevee ([D6456](https://archive.blender.org/developer/D6456)) - [x] Consider adding support for different file name schemes (e.g. "u0_v0" instead of "1001") #77989 (UDIM Textures: support for different file name schemes) - [x] Add operator for finding additional tiles on disk ( or support this via the image reload operator? #75116 (UDIM tiles not recognized when reloading images)) - [x] UDIM packing/unpacking ([D14395](https://archive.blender.org/developer/D14395), originally [D6492](https://archive.blender.org/developer/D6492)) - [x] Baking UDIMs (related to [D3203](https://archive.blender.org/developer/D3203)), report #95190 - [ ] Tools for UDIM-aware UV editing (e.g. "Move selection to separate tile") - [ ] Support for UDIMs in various other features that work with images - [x] Displacement Modifier (f9e65fcea7) - [ ] "Edit Externally" ([D7789](https://archive.blender.org/developer/D7789) / #73730) - [x] "Export UV Layout" blender/blender-addons#74325 - [ ] Node Wrangler Principled Setup blender/blender-addons#93496 - [ ] Generated UDIM images not saved properly ([D14885](https://archive.blender.org/developer/D14885) / #97251)
Author
Member

Added subscriber: @LukasStockner

Added subscriber: @LukasStockner

Added subscriber: @txo

Added subscriber: @txo

Added subscriber: @FrancoisRimasson

Added subscriber: @FrancoisRimasson

Added subscriber: @g-lul

Added subscriber: @g-lul

Added subscriber: @boberfly

Added subscriber: @boberfly

Hey @LukasStockner

Testing this out on my end. In GafferCycles if I create an image_texture node but have the filename path blank, I will get an assert. My workaround is:

  if(!path_exists(filename)) {
    return -1;
  }

In: https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/image.cpp$319

So that in https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/nodes.cpp$410 this doesn't get set to true on an invalid filename path.

While I have your attention, may I suggest using the syntax to force is_tiled to on? This is aligned with how OpenImageIO works and other renderers using OIIO adhere to this system (and I assume the TextureCache branch might also use):
https://github.com/OpenImageIO/oiio/blob/master/src/libtexture/imagecache.cpp#L300

Cheers, great work so far Lukas!

Hey @LukasStockner Testing this out on my end. In GafferCycles if I create an image_texture node but have the filename path blank, I will get an assert. My workaround is: ``` if(!path_exists(filename)) { return -1; } ``` In: https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/image.cpp$319 So that in https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/nodes.cpp$410 this doesn't get set to true on an invalid filename path. While I have your attention, may I suggest using the <UDIM> syntax to force is_tiled to on? This is aligned with how OpenImageIO works and other renderers using OIIO adhere to this system (and I assume the TextureCache branch might also use): https://github.com/OpenImageIO/oiio/blob/master/src/libtexture/imagecache.cpp#L300 Cheers, great work so far Lukas!

Added subscriber: @Yang_Jing_Gui

Added subscriber: @Yang_Jing_Gui
Author
Member

@boberfly I can't reproduce that issue - if I set an empty filename, it just renders pink without any asserts. Can you tell me which assert you're hitting?
Regarding the tag: Good point, implemented in e4413dc.

@boberfly I can't reproduce that issue - if I set an empty filename, it just renders pink without any asserts. Can you tell me which assert you're hitting? Regarding the <UDIM> tag: Good point, implemented in e4413dc.

Hi @LukasStockner

I just did a clean build off of Blender master to my standalone Cycles and I can't recreate the issue now, it is pink so that's good. I am balancing the texture cache, openvdb, adaptive sampling & light-groups patch here which probably one of them introduced something weird with the udim patch which I'll try to investigate on my side (gut-feeling it was the openvdb one).

In my case it is triggering has_image to true (first slot is not -1) despite having an invalid path so it never assigns pink and thinks there's an image so it'll eventually assert in the kernel somewhere when it can't find the right INTERPOLATION_* or EXTENSION_* as they were never uploaded to the device properly.

Cheers for adding the tag, that'll work consistently inside of GafferCycles next to Arnold, Appleseed & 3Delight.

Hi @LukasStockner I just did a clean build off of Blender master to my standalone Cycles and I can't recreate the issue now, it is pink so that's good. I am balancing the texture cache, openvdb, adaptive sampling & light-groups patch here which probably one of them introduced something weird with the udim patch which I'll try to investigate on my side (gut-feeling it was the openvdb one). In my case it is triggering `has_image` to `true` (first slot is not -1) despite having an invalid path so it never assigns pink and thinks there's an image so it'll eventually assert in the kernel somewhere when it can't find the right `INTERPOLATION_*` or `EXTENSION_*` as they were never uploaded to the device properly. Cheers for adding the <UDIM> tag, that'll work consistently inside of GafferCycles next to Arnold, Appleseed & 3Delight.

I just had another thought/idea which isn't necessarily UDIM-related but it might be a good feature to have. In the other renderer backends you are allowed to set the pink missing texture to a color plug. This works well as a fallback, so often in lookdev we would assign a safe texture fallback to the missing texture plug or set it to black if we don't care (like if the model/texture is WIP) or if there's an asset variant change and only some UDIMs are modified and the missing ones would just sample from the base UDIMs via the fallback plug.

In addition to this, I haven't done much testing here with Cycles UDIMs but usually a toggle to fail the render on missing UDIMs (when there are some tiles but not all tiles available based on the mesh UV requests) can be set in other renderer's image samplers, which you can turn off and show the missing texture colour instead of failing. This might go hand-in-hand with the above feature.

Cheers!

I just had another thought/idea which isn't necessarily UDIM-related but it might be a good feature to have. In the other renderer backends you are allowed to set the pink missing texture to a color plug. This works well as a fallback, so often in lookdev we would assign a safe texture fallback to the missing texture plug or set it to black if we don't care (like if the model/texture is WIP) or if there's an asset variant change and only some UDIMs are modified and the missing ones would just sample from the base UDIMs via the fallback plug. In addition to this, I haven't done much testing here with Cycles UDIMs but usually a toggle to fail the render on missing UDIMs (when there are some tiles but not all tiles available based on the mesh UV requests) can be set in other renderer's image samplers, which you can turn off and show the missing texture colour instead of failing. This might go hand-in-hand with the above feature. Cheers!

Hey Lukas,

I got a chance to test out UDIM support in GafferCycles/Standalone, and I think I've found a bit of an issue here. I noticed in the blender_shader.cpp that this is where the known tiles available are discovered eg.
https://developer.blender.org/diffusion/B/browse/master/intern/cycles/blender/blender_shader.cpp$669

However, in the case of Cycles standalone there's no real way to give this information if all you've got is a file path, so there is an early exit made here:
https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/nodes.cpp$311

Should this use a filesystem check to see what tiles are available, or should I made something custom in GafferCycles to do something similar to what Blender is doing? I'm guessing for regular Cycles standalone that a path won't know/check for more than 1001 either and would need code as well to set the tiles vector.

I wanted to post it here to see if it was an oversight or by design.

Cheers

Hey Lukas, I got a chance to test out UDIM support in GafferCycles/Standalone, and I think I've found a bit of an issue here. I noticed in the blender_shader.cpp that this is where the known tiles available are discovered eg. https://developer.blender.org/diffusion/B/browse/master/intern/cycles/blender/blender_shader.cpp$669 However, in the case of Cycles standalone there's no real way to give this information if all you've got is a file path, so there is an early exit made here: https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/nodes.cpp$311 Should this use a filesystem check to see what tiles are available, or should I made something custom in GafferCycles to do something similar to what Blender is doing? I'm guessing for regular Cycles standalone that a <UDIM> path won't know/check for more than 1001 either and would need code as well to set the tiles vector. I wanted to post it here to see if it was an oversight or by design. Cheers

Added subscriber: @Fuxna

Added subscriber: @Fuxna

This comment was removed by @Fuxna

*This comment was removed by @Fuxna*

Added subscriber: @Alumx

Added subscriber: @Alumx
Member

Added subscriber: @DanielBystedt

Added subscriber: @DanielBystedt

Added subscriber: @YegorSmirnov

Added subscriber: @YegorSmirnov

By the way, UDIMs are not autodetected if using ctrl+shift+t for simultaneous shader channels population with image nodes. But may be it's up to the node wrangler addon functionality.

By the way, UDIMs are not autodetected if using ctrl+shift+t for simultaneous shader channels population with image nodes. But may be it's up to the node wrangler addon functionality.

Added subscriber: @pixeltrain3d

Added subscriber: @pixeltrain3d

Added subscriber: @lemenicier_julien

Added subscriber: @lemenicier_julien

Added subscriber: @AndreasErni

Added subscriber: @AndreasErni

Added subscriber: @Kalle-SamuliRiihikoski

Added subscriber: @Kalle-SamuliRiihikoski

I don't know if this is already addressed, but I have python script that load tiled image (texture_1001, texture_1002) into texture node but preview only show first tile.

Did some more tests. So If I name textures in 3d-coat like this: Mesh_diffuse_1001..1002.jpg
Then use blender python script to create texture node and load images files into it. The preview will show only first tile. Now if I go back to 3d-coat and create textures again and this time name them Mesh_1001_diffuse.jpg, etc... then use texture node folder button to load images manually and select this new file ...1001.jpg file. Then preview view changes to look correct.

I don't know if this is already addressed, but I have python script that load tiled image (texture_1001, texture_1002) into texture node but preview only show first tile. Did some more tests. So If I name textures in 3d-coat like this: Mesh_diffuse_1001..1002.jpg Then use blender python script to create texture node and load images files into it. The preview will show only first tile. Now if I go back to 3d-coat and create textures again and this time name them Mesh_1001_diffuse.jpg, etc... then use texture node folder button to load images manually and select this new file ...1001.jpg file. Then preview view changes to look correct.

Added subscriber: @SLAD1026

Added subscriber: @SLAD1026

UDIM baking is not working yet, please update in the latest upcoming blender version.

**UDIM baking** is not working yet, please update in the latest upcoming blender version.

Added subscriber: @vr_sebas

Added subscriber: @vr_sebas

Added subscriber: @stjerneidioten

Added subscriber: @stjerneidioten

Added subscriber: @XB982

Added subscriber: @XB982

Added subscriber: @end_ahmed

Added subscriber: @end_ahmed

Added subscriber: @tomsmalley

Added subscriber: @tomsmalley

Added subscriber: @GregoryS

Added subscriber: @GregoryS

Added subscriber: @hemul

Added subscriber: @hemul

Added subscriber: @Chang-Chin-Wen

Added subscriber: @Chang-Chin-Wen

Added subscriber: @lampy

Added subscriber: @lampy

Removed subscriber: @AndreasErni

Removed subscriber: @AndreasErni

This issue was referenced by 6787cc13d4

This issue was referenced by 6787cc13d4efef19eb708e1912356f8c1d4d2e01

Added subscriber: @AlexeyAdamitsky

Added subscriber: @AlexeyAdamitsky

Added subscriber: @pauanyu_blender

Added subscriber: @pauanyu_blender

Added subscriber: @JerahmyPocott

Added subscriber: @JerahmyPocott

Can we also add interacting with tile images via python scripts? Currently only the first tiles pixels are available via the script interface.

Can we also add interacting with tile images via python scripts? Currently only the first tiles pixels are available via the script interface.
Julien Kaspar added this to the Sculpt, Paint & Texture project 2023-02-08 10:26:20 +01:00
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:12:45 +01: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 Assignees
28 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#72390
No description provided.