Cycles tiling artifacts with path guiding and caustics #113799

Open
opened 2023-10-17 04:02:27 +02:00 by Masud-Al-Mahdi · 8 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.6.0 Core Profile Context 23.8.1.230810

Blender Version
Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-02 01:10, hash: 883033a0969f
Worked: (newest version of Blender that worked as expected)

Short description of error
Rendering artifacts on cycles. As soon as increasing rendering resolution. (probably when tiled rendering takes place).

Exact steps for others to reproduce the error

Render the .blend file without any change. resolution 3840x2160. (causes artifact) Render the .blend file at 1920x1080. resolution 1920x1080. (no artifacts)
artifacted-image non-artifact-image

Where I think problems are

  1. Probably on tilted drawing.
  2. Could also be at denoising. (Denoising was turned on in both).
  3. Otherwise I don't know.
**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.6.0 Core Profile Context 23.8.1.230810 **Blender Version** Broken: version: 4.0.0 Beta, branch: blender-v4.0-release, commit date: 2023-10-02 01:10, hash: `883033a0969f` Worked: (newest version of Blender that worked as expected) **Short description of error** Rendering artifacts on cycles. As soon as increasing rendering resolution. (probably when tiled rendering takes place). **Exact steps for others to reproduce the error** | Render the .blend file without any change. resolution 3840x2160. (causes artifact) | Render the .blend file at 1920x1080. resolution 1920x1080. (no artifacts) | | -- | -- | | ![artifacted-image](https://i.ibb.co/RDQj89Z/artifact-3840.png) | ![non-artifact-image](https://i.ibb.co/BV2fXS6/no-artifact-1920.png) | **Where I think problems are** 1. Probably on tilted drawing. 2. Could also be at denoising. (Denoising was turned on in both). 3. Otherwise I don't know.
Masud-Al-Mahdi added the
Severity
Normal
Type
Report
Status
Needs Triage
labels 2023-10-17 04:02:27 +02:00

Those images look like Path Guiding was turned on, a CPU only feature, however the .blend attached is set to use the GPU for render. Can you confirm whether you were rending on CPU w/Path Guiding, or just on the GPU?

Does this occur for you if you shrink the final render resolution and also shrink the Tile size in Render properties -> Performance -> Memory -> Tile size. I tried a smaller image with correspondingly smaller tiles and did not observe the artifacts here at least.

As always, please try with a more recent version of the 4.0 beta in case problems have been fixed in the past 2 weeks.

Those images look like Path Guiding was turned on, a CPU only feature, however the .blend attached is set to use the GPU for render. Can you confirm whether you were rending on CPU w/Path Guiding, or just on the GPU? Does this occur for you if you shrink the final render resolution and also shrink the Tile size in `Render properties` -> `Performance` -> `Memory` -> `Tile size`. I tried a smaller image with correspondingly smaller tiles and did not observe the artifacts here at least. As always, please try with a more recent version of the 4.0 beta in case problems have been fixed in the past 2 weeks.
Jesse Yurkovich added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-10-17 04:21:29 +02:00
Author

The issue still Appears on the latest build.

Following your answer, I pulled the latest commit on blender4.0 & built blender again (today 8:00 AM at GMT+6). Also set the cycles device to "cpu" and path guiding "on".

More details:

  1. Artifact appears in cycles, before denoising
  2. Artifact appears when tiling-size is 0.5x width of the resolution (ex: if resolution is 1920x1080 tilesize is 1024).
  3. Artifact on smaller resolutions artifact is still small. on 4k artifact is almost half the image.

Artifact on (960x540) resolution:

artifact on smaller resolutions

Artifact on 4k resolution:

artifact on bigger resolutions
tilesize:2048

Note: increasing tiling size should not be a workaround to fix rendering artifacts. Because obviously there will be a point where we users can not increase tiling any more (tiling was introduced for exact same reason i believe).

**The issue still Appears on the latest build.** Following your answer, I pulled the latest commit on blender4.0 & built blender again (today 8:00 AM at GMT+6). Also set the cycles device to "cpu" and path guiding "on". ### More details: 1. Artifact appears in cycles, before denoising 2. Artifact appears when tiling-size is 0.5x width of the resolution (ex: if resolution is 1920x1080 tilesize is 1024). 3. Artifact on smaller resolutions artifact is still small. on 4k artifact is almost half the image. ### **Artifact on (960x540) resolution:** ![artifact on smaller resolutions](https://i.ibb.co/Qbgvzvr/960x540.png) ### **Artifact on 4k resolution:** ![artifact on bigger resolutions](https://i.ibb.co/RDQj89Z/artifact-3840.png) **tilesize:2048** Note: increasing tiling size should not be a workaround to fix rendering artifacts. Because obviously there will be a point where we users can not increase tiling any more (tiling was introduced for exact same reason i believe).
Jesse Yurkovich added
Status
Needs Triage
and removed
Status
Needs Information from User
labels 2023-10-17 07:40:54 +02:00
Iliya Katushenock added the
Interest
Render & Cycles
label 2023-10-17 13:51:40 +02:00
Member

I can confirm this issue with CPU rendering with Path Guiding in 3.6 and 4.0.


I have an idea on what might be causing this.

Path Guiding generates a structure to store information about how rays should be guided. The structure is filled with useful information as samples are taken in different parts of the scene/structure.

What I believe is happening is that with tiling enabled, the "left" side the structure is filled out with information while the tile is on the left, while the "right" side of the structure gets very little information due to rays rarely going to that side. Then when the tile goes to the right side of the image, Path Guiding training has stopped (because the 128 training samples have been used up), and the rays on the right tile have to rely on the poorly formed Path Guiding structure, resulting in noticeable artifacts.

If tiling is off, then both the left and right side of the structure are filled out with information fairly evenly throughout the render, meaning there's no issues of "poorly formed" structures inside the camera view.


Here's some "simple" ideas from the code side on how to fix it:

  • When the render finishes a tile and starts a new one, re-enable Path Guiding training/reset the Path Guiding Structure.
    • This should remove artifacts, but will probably introduce discontinuities near the tile borders in some scenes.
  • If tiling is active, turn off the Path Guiding training limit, meaning training is happening all the time.
    • Testing reveled that this doesn't help. Which makes sense because the samples from the right tile are weighted lower than the initial samples in the Path Guiding Structure, meaning the artifacts can be seen through the enhanced Path Guiding structure that forms as samples are taken.
  • If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training.
    • This should resolve the issue, but will increase render times, and using the low resolution render to generate the path guiding structure may accidentally introduce other issues (E.G. Reduced Path Guiding quality?).
  • If tiling is active, don't allow people to use Path Guiding.
    • Not really a fix. Just a way of letting people know this combo is not supported and not letting them use it.
  • If Path Guiding is active, don't allow people to use tiling.
    • Not really a fix. Just a way of letting people know this combo is not supported and not letting them use it.
  • Something else I haven't thought of.

CC @brecht and/or @Sebastian-Herholz to weigh in on what should be done.

I can confirm this issue with CPU rendering with Path Guiding in 3.6 and 4.0. --- I have an idea on what might be causing this. Path Guiding generates a structure to store information about how rays should be guided. The structure is filled with useful information as samples are taken in different parts of the scene/structure. What I believe is happening is that with tiling enabled, the "left" side the structure is filled out with information while the tile is on the left, while the "right" side of the structure gets very little information due to rays rarely going to that side. Then when the tile goes to the right side of the image, Path Guiding training has stopped (because the 128 training samples have been used up), and the rays on the right tile have to rely on the poorly formed Path Guiding structure, resulting in noticeable artifacts. If tiling is off, then both the left and right side of the structure are filled out with information fairly evenly throughout the render, meaning there's no issues of "poorly formed" structures inside the camera view. --- Here's some "simple" ideas from the code side on how to fix it: - When the render finishes a tile and starts a new one, re-enable Path Guiding training/reset the Path Guiding Structure. - This should remove artifacts, but will probably introduce discontinuities near the tile borders in some scenes. - ~~If tiling is active, turn off the Path Guiding training limit, meaning training is happening all the time.~~ - Testing reveled that this doesn't help. Which makes sense because the samples from the right tile are weighted lower than the initial samples in the Path Guiding Structure, meaning the artifacts can be seen through the enhanced Path Guiding structure that forms as samples are taken. - If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training. - This should resolve the issue, but will increase render times, and using the low resolution render to generate the path guiding structure may accidentally introduce other issues (E.G. Reduced Path Guiding quality?). - If tiling is active, don't allow people to use Path Guiding. - Not really a fix. Just a way of letting people know this combo is not supported and not letting them use it. - If Path Guiding is active, don't allow people to use tiling. - Not really a fix. Just a way of letting people know this combo is not supported and not letting them use it. - Something else I haven't thought of. CC @brecht and/or @Sebastian-Herholz to weigh in on what should be done.
Alaska added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-10-17 15:07:58 +02:00
Brecht Van Lommel changed title from Cycles rendering artifact when rendering at 3840x2160 render resolution to Cycles tiling artifacts with path guiding and caustics 2023-10-17 16:43:55 +02:00
Brecht Van Lommel added
Type
Known Issue
and removed
Type
Report
labels 2023-10-17 16:44:08 +02:00

This is a known limitation of the path guiding implementation currently. First is that it's not really designed to render caustics like this, it can find them sometimes but the probably is low and so it will not do so consistently across tiles or different frames in an animation.

If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training.

Something along these lines is probably the right solution, but it of course has downsides.

More generally, the issue is that we don't have an efficient way to render these caustics, and if we had a dedicated mechanism for that it would sidestep this problem somewhat.

This is a known limitation of the path guiding implementation currently. First is that it's not really designed to render caustics like this, it can find them sometimes but the probably is low and so it will not do so consistently across tiles or different frames in an animation. > If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training. Something along these lines is probably the right solution, but it of course has downsides. More generally, the issue is that we don't have an efficient way to render these caustics, and if we had a dedicated mechanism for that it would sidestep this problem somewhat.
Jesse Yurkovich added
Module
Render & Cycles
and removed
Interest
Render & Cycles
labels 2023-10-20 08:29:05 +02:00

The observation of @Alaska is right. Path guiding does not work well together with tiled rendering.
The training of the guiding structures works best when we have samples from rendering the full image.
This way, we gather information about the whole light transport of the scene at once, and information from paths originating from multiple image regions can be shared.

At the moment, there exists no guiding method, which is based on online learning, that works well with tiled rendering.

The easiest (short-term) solution would be to disable path guiding when the user needs to use tiled rendering or vice-versa (i.e., disable tiled rendering when path guiding is enabled).

The best (long-term) solution, in my opinion, is the one also proposed by @Alaska, is to have a pre-rendering path using a lower resolution to learn the guiding structure and then switch to full-resolution tiled rendering when the training is done.
One could even think about jittering the samples in the training phase in such a way that the samples are splatted in a high-resolution buffer (e.g., rendering every odd pixel in the first iteration and every even in the second).

@brecht is there an easy way to achieve the first solution for now?

The observation of @Alaska is right. Path guiding does not work well together with tiled rendering. The training of the guiding structures works best when we have samples from rendering the full image. This way, we gather information about the whole light transport of the scene at once, and information from paths originating from multiple image regions can be shared. At the moment, there exists no guiding method, which is based on online learning, that works well with tiled rendering. The easiest (short-term) solution would be to disable path guiding when the user needs to use tiled rendering or vice-versa (i.e., disable tiled rendering when path guiding is enabled). The best (long-term) solution, in my opinion, is the one also proposed by @Alaska, is to have a pre-rendering path using a lower resolution to learn the guiding structure and then switch to full-resolution tiled rendering when the training is done. One could even think about jittering the samples in the training phase in such a way that the samples are splatted in a high-resolution buffer (e.g., rendering every odd pixel in the first iteration and every even in the second). @brecht is there an easy way to achieve the first solution for now?

It's certainly possible to disable path guiding or tiled rendering automatically, but I don't think doing either silently is a good user interface. Reporting and error with a suggestions to use disable tiling seems better to me (through device->set_error).

But, it may also be that case that path guiding works fine with tiling for less challenging scenes? The same kind of scenes where there is enough coherency for animation perhaps? There is also some amount of overlapping pixels between tiles. If that is common, it would be good to still allow users to use both together.

It's certainly possible to disable path guiding or tiled rendering automatically, but I don't think doing either silently is a good user interface. Reporting and error with a suggestions to use disable tiling seems better to me (through `device->set_error`). But, it may also be that case that path guiding works fine with tiling for less challenging scenes? The same kind of scenes where there is enough coherency for animation perhaps? There is also some amount of overlapping pixels between tiles. If that is common, it would be good to still allow users to use both together.
Author

From what i think, If path guiding fills up PGS at the start of the rendering, how about:

  • if path guiding is on & tiles are smaller then render resolution:
    • for final render(which is most important):
      • switch tile size to full resolution and fill up the PGS (path guiding stucture) after that switch tile sizes back to original and render the rest of the image.
    • warn the user about it
From what i think, If path guiding fills up PGS at the start of the rendering, how about: - if path guiding is on & tiles are smaller then render resolution: - for final render(which is most important): - switch tile size to full resolution and fill up the PGS (path guiding stucture) after that switch tile sizes back to original and render the rest of the image. - warn the user about it
  • If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training.
    • This should resolve the issue, but will increase render times, and using the low resolution render to generate the path guiding structure may accidentally introduce other issues (E.G. Reduced Path Guiding quality?).

@Alaska I'm doing a fair amount of large renders (between 10000 and 20000px) and often those scenes cannot fit into VRAM, so I'm left with rendering on a CPU with tiles.
Having the ability to bake PG on lower res image - lets say 50% of the final size - would be absolutely great to have.
PG paths could be also stored for faster re-renders as part of persistent data option if nothing in the scene have changed.

> - If tiling is active, render a low resolution version of the scene (without tiling) to fill out the Path Guiding structure, then render the full resolution image (with tiling), using the generated Path Guiding structure from earlier with no further training. > - This should resolve the issue, but will increase render times, and using the low resolution render to generate the path guiding structure may accidentally introduce other issues (E.G. Reduced Path Guiding quality?). @Alaska I'm doing a fair amount of large renders (between 10000 and 20000px) and often those scenes cannot fit into VRAM, so I'm left with rendering on a CPU with tiles. Having the ability to bake PG on lower res image - lets say 50% of the final size - would be absolutely great to have. PG paths could be also stored for faster re-renders as part of persistent data option if nothing in the scene have changed.
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
Code Documentation
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
6 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#113799
No description provided.