Compositor: glitch noise with classic Kuwahara filter in GPU compositor #113578
Labels
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113578
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40
Blender Version
Broken: version: 4.1.0 Alpha, branch: main, commit date: 2023-10-11 23:05, hash:
fba58a148317
It happens since the variable size support for Kuwahara filter was introduced with
203559757a
.Short description of error
Glitch noise appears when using classic mode of Kuwahara filter in GPU compositor. It can be observed in both viewport and rendered image.
Viewport:
Rendered with GPU compositor:
Exact steps for others to reproduce the error
File: kuwahara_noise (1).blend
It happens when...
When the emission of the material is set to 6.0. Noise is subtle compared to the above image (in which the emission was set to 500.0 to make the noise more apparent):
(The black dot is camera gizmo, not part of the noise.)
When the patch for variable size support was in development the noise appeared in a different range of size, see #112946 (comment)
To clarify the behavior, we have two methods for computing Classic Kuwahara. One is faster for low sizes below 5 and one is faster for sizes above 5. The latter has precision issues due to the use of a structure called Summed Area Tables, the precision gets worst as values gets higher in the image. Using the former accurate method was hard to justify because it can be orders of magnitude slower.
I suspect we can fix that somehow with reasonable performance, but I don't have a concrete plan. SO for now, I would say clamp your input to the
[0, 1]
range as a workaround.#114191 attempts to solve this issue. But a full fix is probably impossible at the same performance level.
@persun We attempted to solve this by improving precision, and while the precision was improved numerically, the artifacts persisted. So it is clear to us that this can't be solved completely by improving precision.
We have two alternatives:
[0, 1]
range in that case.What do you think? Is clamping sufficient for your needs?
@OmarEmaraDev I'm actually not sure. The case above with a very high emission value was to make the noise obvious and is unlikely use case (at least for me), so I don't worry about that much of excessive noise.
But subtle noise still happens with values close to real-life use cases, and I'm not sure clamping will help much in that case.
I also noticed it happens with CPU compositor too. For some reasons it starts with size 4.0 unlike GPU's 5.0, so it makes easier to compare the images with and without the noise.
Here are renders to showcase the effects of subtle noise.
Kuwahara size 4.0, GPU compositor render: no noise
Kuwahara size 4.0, Full frame CPU compositor render: subtle noise
Comparing size 4.0 CPU and GPU renders, you can see that the noise makes the top-right side of the image blurrier (or harsher if you zoom in).
With an additional light (Kuwahara size 4.0, GPU compositor render)
With an additional light (Kuwahara size 4.0, Full frame CPU compositor render)
With an additional light, the noise becomes red-ish, more noticeable. It also blurs the boundary of Suzanne.
That said, I also concur that performance hit is not desirable. So I'm not actually sure, other than marking this as a known issue and note users to work around or deal with the noise somehow. (I also think the harshness made by the noise look cool if it's desirable.) Maybe bring this to the feedback thread on devtalk and ask other users will help.
Can you check this build and see if the improvements to the GPU compositor resolves the noise in the base case?
https://builder.blender.org/download/patch/PR114191/
It reduces noise somewhat but it's still there and makes the image blurry.
Kuwahara size 5.0 - main build
Kuwahara size 5.1 - main build
Kuwahara size 5.1 - PR114191 build
Okay, at this point, I think we should add an option to change between the slow and fast methods.
But I will ask in DevTalk first. Thank you for the feedback @persun!