UDIM's breaking in Eevee #105661

Closed
opened 2023-03-11 15:35:58 +01:00 by William-Hurst · 7 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.18

Blender Version
Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-03-11 00:58, hash: fe58ccfafb91
Worked: 3.4.1 and 3.3.4 LTS

Short description of error
[Please fill out a short description of the error here]
UDIM textures fail when using Eevee.

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]
Can only reproduce with these exact texture files. Error does not persist in Blender 3.3.4 LTS, or 3.4.1. With either this file or original Blend file where the issue was found.

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.18 **Blender Version** Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-03-11 00:58, hash: `fe58ccfafb91` Worked: 3.4.1 and 3.3.4 LTS **Short description of error** [Please fill out a short description of the error here] UDIM textures fail when using Eevee. **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] Can only reproduce with these exact texture files. Error does not persist in Blender 3.3.4 LTS, or 3.4.1. With either this file or original Blend file where the issue was found.
William-Hurst added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-11 15:35:59 +01:00
Iliya Katushenock added the
Interest
EEVEE & Viewport
label 2023-03-11 15:44:34 +01:00

We need more information obviously. You'll need to provide more details on how to reproduce the problem and better describe the problem. The UDIM demo file still works correctly as does a simple scene for me.

  • What is the filename you're using?
  • What is the image format you're using?
  • How many images and and what are their dimensions?
  • You say this affects Eevee. Is Cycles ok?
We need more information obviously. You'll need to provide more details on how to reproduce the problem and better describe the problem. The UDIM demo file still works correctly as does a simple scene for me. - What is the filename you're using? - What is the image format you're using? - How many images and and what are their dimensions? - You say this affects Eevee. Is Cycles ok?
Jesse Yurkovich added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-03-11 22:09:12 +01:00
Author

Sorry I thought I attached a blend file. It was too large and I didn't catch the error the first time.

Sorry I thought I attached a blend file. It was too large and I didn't catch the error the first time.

Confirmed, this is a regression since 3.4.x. Looks like it's running into a Sampler limit (at least for me).

There are 6 UDIM textures being used with just 3 unique sampler configurations but it looks like Eevee is not reusing the samplers since making these all the same doesn't help.

  • 3 textures using [Cubic,Flat,Repeat]
  • 2 textures using [Linear,Flat,Repeat]
  • 1 texture using [Linear,Box,Repeat]
ERROR (gpu.shader): GPU_material_compile VertShader:
      |
  972 | layout(binding = 20) uniform sampler1DArray tsamp10;
      |
      | Error: C7612: profile doesn't support more than 32 samplers

ERROR (gpu.shader): GPU_material_compile FragShader:
      |
  972 | layout(binding = 20) uniform sampler1DArray tsamp10;
      |
      | Error: C7612: profile doesn't support more than 32 samplers

CC @pragma37 @fclem

Confirmed, this is a regression since 3.4.x. Looks like it's running into a Sampler limit (at least for me). There are 6 UDIM textures being used with just 3 unique sampler configurations but it looks like Eevee is not reusing the samplers since making these all the same doesn't help. - 3 textures using [Cubic,Flat,Repeat] - 2 textures using [Linear,Flat,Repeat] - 1 texture using [Linear,Box,Repeat] ``` ERROR (gpu.shader): GPU_material_compile VertShader: | 972 | layout(binding = 20) uniform sampler1DArray tsamp10; | | Error: C7612: profile doesn't support more than 32 samplers ERROR (gpu.shader): GPU_material_compile FragShader: | 972 | layout(binding = 20) uniform sampler1DArray tsamp10; | | Error: C7612: profile doesn't support more than 32 samplers ``` CC @pragma37 @fclem
Author

Also I forgot to mention. Cycles works as expected. I was able to work around the error by adding an output node for Eevee that excludes a texture node. This prevents the error in the viewport while still allowing a Cycles render. Which makes sense after reading the above. Not optimal;, but woks as long as you do not intend to render with Eevee.

Also I forgot to mention. Cycles works as expected. I was able to work around the error by adding an output node for Eevee that excludes a texture node. This prevents the error in the viewport while still allowing a Cycles render. Which makes sense after reading the above. Not optimal;, but woks as long as you do not intend to render with Eevee.
Jeroen Bakker added this to the 3.5 milestone 2023-03-13 15:12:32 +01:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-03-13 15:12:35 +01:00
Member

I've been looking into this.
I know why it doesn't work, what's driving me crazy is why it worked before.

The issue is that gpu_node_graph_add_texture adds every tiled texture twice.
One when it's called for the tiled texture and another for the tiled map.
This is because it checks for sampler state too.

This is what the samplers look like in 3.4:
imagen
This looks wrong to me, samp and tsamp should go in pairs (ie. samp0 and tsamp0).

In 3.5, samplers are declared in pairs in the generated source, but they are not used in pairs, so half of the declared samplers are unused:
imagen

This is after the fix (not checking for sampler state if the link type is IMAGE_TILED_MAPPING):
imagen

This is what I would expect for it to look like, but committing it without knowing what caused the regression in the first place feels sloppy to me.

I've been looking into this. I know why it doesn't work, what's driving me crazy is why it worked before. The issue is that `gpu_node_graph_add_texture` adds every tiled texture twice. One when it's called for the tiled texture and another for the tiled map. This is because it checks for sampler state too. This is what the samplers look like in 3.4: ![imagen](/attachments/22c0f645-79f2-4c80-8fad-5a87a3f530cb) This looks wrong to me, `samp` and `tsamp` should go in pairs (ie. `samp0` and `tsamp0`). In 3.5, samplers are declared in pairs in the generated source, but they are not used in pairs, so half of the declared samplers are unused: ![imagen](/attachments/4bb95da6-6578-4cfb-bd44-440ac8f7c20d) This is after the fix (not checking for sampler state if the link type is IMAGE_TILED_MAPPING): ![imagen](/attachments/aea01f82-5da2-404e-9c22-70b76a027a06) This is what I would expect for it to look like, but committing it without knowing what caused the regression in the first place feels sloppy to me.

Making a note of a second issue affecting the Metal backend:

[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5326: failed assertion `Draw Errors Validation
Fragment Function(fragment_function_entry_eevee_legacy_shader_effect_subsurface_translucency): missing buffer binding at index 1 for uniforms[0].

This isn't directly related, as it is affecting a different shader (eevee_legacy_shader_effect_subsurface_translucency) but is triggered by this test asset.

Making a note of a second issue affecting the Metal backend: ``` [MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5326: failed assertion `Draw Errors Validation Fragment Function(fragment_function_entry_eevee_legacy_shader_effect_subsurface_translucency): missing buffer binding at index 1 for uniforms[0]. ``` This isn't directly related, as it is affecting a different shader (eevee_legacy_shader_effect_subsurface_translucency) but is triggered by this test asset.
Miguel Pozo was assigned by Jeroen Bakker 2023-03-14 15:46:22 +01:00
Member

The regression was actually caused by 6b8bb26c45.

Specifically, declaring built-in sampler uniforms with a fixed slot index in eevee_legacy_common_info.hh.

OpenGL drivers are usually fine with declaring as many sampler uniforms as you want as long as you don't use all of them, but it looks like that's not the case when using fixed bind slots.

The UDIM issue I explained before is still there and we should fix it, but the regression is not related UDIMs specifically, it affects all image nodes.

The regression was actually caused by https://projects.blender.org/blender/blender/commit/6b8bb26c457446875e0782a1701ec35c78b33308. Specifically, declaring built-in sampler uniforms with a fixed slot index in [eevee_legacy_common_info.hh](https://projects.blender.org/blender/blender/commit/6b8bb26c457446875e0782a1701ec35c78b33308#diff-1ce70d119e5827619ee6db44700b1ff8668bc2b9). OpenGL drivers are usually fine with declaring as many sampler uniforms as you want as long as you don't use all of them, but it looks like that's not the case when using fixed bind slots. The UDIM issue I explained before is still there and we should fix it, but the regression is not related UDIMs specifically, it affects all image nodes.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-03-15 13:37:32 +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
4 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#105661
No description provided.