Compositor: Add High Precision option to Kuwahara #115763

Merged
Omar Emara merged 3 commits from OmarEmaraDev/blender:high-precision-classic-kuwahara into main 2024-01-17 14:30:39 +01:00
Member

For high radii Kuwahara, we use a Summed Area Table (SAT) implementation
to accelerate the classic variant of the algorithm. The problem is that
due to limited floating point precision, the SAT can produce artifacts
in its output.

An attempt to fix this was implemented in #114191, and while that patch
improved precision by 10x, the artifacts still existed, albeit less
noticeable. But since the improved precision also meant a performance
penalty, it was decided that the improvement is not worth it.

Since the artifacts are only noticeable for scenes with very high
values, this patch adds a High Precision option that defaults to false
and can be enabled by the user upon noticing any artifacts. The option
simply uses direction convolution instead of SAT in this case. The
downside, of course, is that it can be orders of magnitude slower.

An alternative to using this option is for the user to clamp the input
or downsample the image. Both methods should be documented in the
documentation.

Fixes: #113578.

For high radii Kuwahara, we use a Summed Area Table (SAT) implementation to accelerate the classic variant of the algorithm. The problem is that due to limited floating point precision, the SAT can produce artifacts in its output. An attempt to fix this was implemented in #114191, and while that patch improved precision by 10x, the artifacts still existed, albeit less noticeable. But since the improved precision also meant a performance penalty, it was decided that the improvement is not worth it. Since the artifacts are only noticeable for scenes with very high values, this patch adds a High Precision option that defaults to false and can be enabled by the user upon noticing any artifacts. The option simply uses direction convolution instead of SAT in this case. The downside, of course, is that it can be orders of magnitude slower. An alternative to using this option is for the user to clamp the input or downsample the image. Both methods should be documented in the documentation. Fixes: #113578.
Omar Emara added the
Interest
Compositing
Module
VFX & Video
labels 2023-12-04 17:08:18 +01:00
Omar Emara added 1 commit 2023-12-04 17:08:27 +01:00
504efd345d Compositor: Add High Precision option to Kuwahara
For high radii Kuwahara, we use a Summed Area Table (SAT) implementation
to accelerate the classic variant of the algorithm. The problem is that
due to limited floating point precision, the SAT can produce artifacts
in its output.

An attempt to fix this was implemented in #114191, and while that patch
improved precision by 10x, the artifacts still existed, albeit less
noticeable. But since the improved precision also meant a performance
penalty, it was decided that the improvement is not worth it.

Since the artifacts are only noticeable for scenes with very high
values, this patch adds a High Precision option that defaults to false
and can be enabled by the user upon noticing any artifacts. The option
simply uses direction convolution instead of SAT in this case. The
downside, of course, is that it can be orders of magnitude slower.

An alternative to using this option is for the user to clamp the input
or downsample the image. Both methods should be documented in the
documentation.

Fixes: #113578.
Omar Emara requested review from Sergey Sharybin 2023-12-04 17:08:45 +01:00
Sergey Sharybin requested changes 2024-01-17 12:55:21 +01:00
Sergey Sharybin left a comment
Owner

The convention is that boolean RNA properties should start with use_, so more proper name would be use_high_precision.

Other than that the patch looks good.

The convention is that boolean RNA properties should start with `use_`, so more proper name would be `use_high_precision`. Other than that the patch looks good.
Omar Emara added 2 commits 2024-01-17 14:21:28 +01:00
Sergey Sharybin approved these changes 2024-01-17 14:28:14 +01:00
Omar Emara merged commit e4a93d7b8c into main 2024-01-17 14:30:39 +01:00
Omar Emara deleted branch high-precision-classic-kuwahara 2024-01-17 14:30:50 +01:00
Sign in to join this conversation.
No reviewers
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
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#115763
No description provided.