Regression: Precision artifacts on refractive materials with Cycles MetalRT #125307

Closed
opened 2024-07-23 13:30:32 +02:00 by Xhaos · 8 comments

System Information
Operating system: macOS Sonoma 14.5
Graphics card: M3 Max

Blender Version
Broken: (Blender 4.2 LTS)
Worked: (Blender 4.1.0, Blender 4.1.1 LTS)

Spent the whole day trying to reproduce the issue, and as of writing this I discovered that I think it has to do with how far away the object is from the world origin.

Context: Was working on a project till I noticed something off about an asset I simply appended which was this transparent cosmetic bottle. It had these cross-hatch-like lines on it that was noticeable on renders. This cosmetic bottle did not have this artifact when I modeled it. (In hindsight, it did but it wasn't apparent because it was close to the world origin)

  1. Create mesh object (cube/cylinder)
  2. Add loop cuts (not necessary, but makes it more apparent, though it already is apparent)
  3. Add a glass shader (Glass BSDF works fine, but I've also tried glass shaders from Realtime Materials & Sanctus Library)
  4. Move object away from world origin (the further, the stronger the artifact)

The artifacts can be seen at close-ups as far as 10 meters away from world origin.
It also depends on which axis. -1000 m on the Y or X produces artifacts on the sides of the object. -1000 m on the Z on produces artifacts on the top & bottom faces, see attached screenshots.

I've attached a frantic video of me reproducing the issue and a blend file.
Thank you!

**System Information** Operating system: macOS Sonoma 14.5 Graphics card: M3 Max **Blender Version** Broken: (Blender 4.2 LTS) Worked: (Blender 4.1.0, Blender 4.1.1 LTS) Spent the whole day trying to reproduce the issue, and as of writing this I discovered that I think **it has to do with how far away the object is from the world origin.** Context: Was working on a project till I noticed something off about an asset I simply appended which was this transparent cosmetic bottle. It had these cross-hatch-like lines on it that was noticeable on renders. This cosmetic bottle did not have this artifact when I modeled it. (In hindsight, it did but it wasn't apparent because it was close to the world origin) 1. Create mesh object (cube/cylinder) 2. Add loop cuts (not necessary, but makes it more apparent, though it already is apparent) 3. Add a glass shader (Glass BSDF works fine, but I've also tried glass shaders from Realtime Materials & Sanctus Library) 4. Move object away from world origin (the further, the stronger the artifact) The artifacts can be seen at close-ups as far as 10 meters away from world origin. It also depends on which axis. -1000 m on the Y or X produces artifacts on the sides of the object. -1000 m on the Z on produces artifacts on the top & bottom faces, see attached screenshots. I've attached a frantic video of me reproducing the issue and a blend file. Thank you!
Xhaos added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2024-07-23 13:30:32 +02:00
Member

I can confirm this issue, with the file provided I can only confirm this issue with MetalRT on (which is enabled by default on M3 or newer Macs).

And I can confirm that the artifacts are less pronounced in 4.1. I will look into bisecting when this was introduced.

I can confirm this issue, with the file provided I can only confirm this issue with MetalRT on (which is enabled by default on M3 or newer Macs). And I can confirm that the artifacts are less pronounced in 4.1. I will look into bisecting when this was introduced.
Alaska changed title from Cross hatching artifacts on glass BSDF to Regression: Precision artifacts on refractive materials with Cycles MetalRT 2024-07-23 16:46:25 +02:00
Author

I can confirm this issue, with the file provided I can only confirm this issue with MetalRT on (which is enabled by default on M3 or newer Macs).

And I can confirm that 4.1 didn't have this issue. I will look into bisecting when this was introduced.

Thanks! I turned Metal RT Off and the issue resolved as well. My workaround for now is to adjust my entire scene to make the refractive object as close as possible to the world origin.

> I can confirm this issue, with the file provided I can only confirm this issue with MetalRT on (which is enabled by default on M3 or newer Macs). > > And I can confirm that 4.1 didn't have this issue. I will look into bisecting when this was introduced. Thanks! I turned Metal RT Off and the issue resolved as well. My workaround for now is to adjust my entire scene to make the refractive object as close as possible to the world origin.
Member

Bisecting points to 5508b41a40 as the culprit. The changed that caused this issue is the changes to ray offsetting in shade_surface.h

CC @Michael-Jones Can you take a look at this?

Bisecting points to 5508b41a403d6b5b81a2d1d4c6ab4162f823bf5c as the culprit. The changed that caused this issue is the changes to ray offsetting in `shade_surface.h` CC @Michael-Jones Can you take a look at this?

Hey @Alaska. Apologies - it seems I was a little overzealous with the optimisations. I'll happily revert that ray offsetting setting change, but wondering if it's worth adding a new unit test to cover it? Also should we make the change in 4.2.x as well as main?

Hey @Alaska. Apologies - it seems I was a little overzealous with the optimisations. I'll happily revert that ray offsetting setting change, but wondering if it's worth adding a new unit test to cover it? Also should we make the change in 4.2.x as well as main?
Member

@Michael-Jones You'll probably want to check with @Sergey about those, but I'll comment to the best of my understanding.

wondering if it's worth adding a new unit test to cover it?

A test for this may not work as different backends may produce different results due to their own precision differences leading to everything but the reference platform failing the test. But testing on actual hardware will reveal if this is a problem worth worrying about. And this scene may be small enough that the differences aren't large enough to be a problem. Double check with Sergey.

Also should we make the change in 4.2.x as well as main?

Now that Blender 4.2 has released, the general process is:

  1. Make the change in Main.
  2. If it meets certain criteria, then add it to the "to be backported" list for 4.2 #124452 and Philipp or Thomas from the Blender foundation will commit your fix to 4.2.X

Since a revert would fix the bug introduced in 4.2, and isn't risky (as it's just restoring old behaviour) I believe it's safe to put on the 4.2 backport list, but double check with Sergey.

@Michael-Jones You'll probably want to check with @Sergey about those, but I'll comment to the best of my understanding. > wondering if it's worth adding a new unit test to cover it? A test for this may not work as different backends may produce different results due to their own precision differences leading to everything but the reference platform failing the test. But testing on actual hardware will reveal if this is a problem worth worrying about. And this scene may be small enough that the differences aren't large enough to be a problem. Double check with Sergey. > Also should we make the change in 4.2.x as well as main? Now that Blender 4.2 has released, the general process is: 1. Make the change in Main. 2. If it meets certain criteria, then add it to the "to be backported" list for 4.2 #124452 and Philipp or Thomas from the Blender foundation will commit your fix to 4.2.X Since a revert would fix the bug introduced in 4.2, and isn't risky (as it's just restoring old behaviour) I believe it's safe to put on the 4.2 backport list, but double check with Sergey.

Alaska covered it very well, don't think I have much to add.

The idea of having tests for such shading render issues sounds very interesting, but, as Alaska said, it might come with consequences. I think we can go on case-by-case basis, and see if tests behave close enough on all supported platforms.

Maybe there are some tricks we can do with thesholding to mitigate known differences between platforms, and yet be able to catch actual regressions.

@Michael-Jones is this something you can look into?

Alaska covered it very well, don't think I have much to add. The idea of having tests for such shading render issues sounds very interesting, but, as Alaska said, it might come with consequences. I think we can go on case-by-case basis, and see if tests behave close enough on all supported platforms. Maybe there are some tricks we can do with thesholding to mitigate known differences between platforms, and yet be able to catch actual regressions. @Michael-Jones is this something you can look into?
Member

I've submitted a PR !126003 for this just so the fix can be commited quickly.

I have a wide range of hardware and can investigate whether or not this type of precision test can be safely added to the render test suite.

I've submitted a PR !126003 for this just so the fix can be commited quickly. I have a wide range of hardware and can investigate whether or not this type of precision test can be safely added to the render test suite.

@Alaska Thanks. That'd be lovely if you look into adding such tests.

@Alaska Thanks. That'd be lovely if you look into adding such tests.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-08-07 17:23:26 +02:00
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
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
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
Core
Module
Development Management
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
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
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#125307
No description provided.