Realtime Compositor: Implement Fast Gaussian blur #120431

Merged
Omar Emara merged 31 commits from OmarEmaraDev/blender:recursive-gaussian-blur into main 2024-05-01 09:57:43 +02:00
Member

This patch implements the Fast Gaussian blur mode for the Realtime
Compositor. This is a faster but less accurate implementation of
Gaussian blur.

This is implemented as a recursive Gaussian blur algorithm based on the
general method outlined in the following paper:

Hale, Dave. "Recursive gaussian filters." CWP-546 (2006).

In particular, based on the table in Section 5 Conclusion, for very low
radius blur, we use a direct separable Gaussian convolution. For medium
blur radius, we use the fourth order IIR Deriche filter based on the
following paper:

Deriche, Rachid. Recursively implementating the Gaussian and its
derivatives. Diss. INRIA, 1993.

For high radius blur, we use the fourth order IIR Van Vliet filter based
on the following paper:

Van Vliet, Lucas J., Ian T. Young, and Piet W. Verbeek. "Recursive
Gaussian derivative filters." Proceedings. Fourteenth International
Conference on Pattern Recognition (Cat. No. 98EX170). Vol. 1. IEEE,
1998.

That's because direct convolution is faster and more accurate for very
low radius, while the Deriche filter is more accurate for medium blur
radius, while Van Vliet is more accurate for high blur radius. The
criteria suggested by the paper is a sigma value threshold of 3 and 32
for the Deriche and Van Vliet filters respectively, which we apply on
the larger of the two dimensions.

Both the Deriche and Van Vliet filters are numerically unstable for high
blur radius. So we decompose the Van Vliet filter into a parallel bank
of smaller second order filters based on the method of partial fractions
discussed in the book:

Oppenheim, Alan V. Discrete-time signal processing. Pearson Education
India, 1999.

We leave the Deriche filter as is since it is only used for low radii
anyways.

Compared to the CPU implementation, this implementation is more
accurate, but less numerically stable, since CPU uses doubles, which is
not feasible for the GPU.

This patch implements the Fast Gaussian blur mode for the Realtime Compositor. This is a faster but less accurate implementation of Gaussian blur. This is implemented as a recursive Gaussian blur algorithm based on the general method outlined in the following paper: Hale, Dave. "Recursive gaussian filters." CWP-546 (2006). In particular, based on the table in Section 5 Conclusion, for very low radius blur, we use a direct separable Gaussian convolution. For medium blur radius, we use the fourth order IIR Deriche filter based on the following paper: Deriche, Rachid. Recursively implementating the Gaussian and its derivatives. Diss. INRIA, 1993. For high radius blur, we use the fourth order IIR Van Vliet filter based on the following paper: Van Vliet, Lucas J., Ian T. Young, and Piet W. Verbeek. "Recursive Gaussian derivative filters." Proceedings. Fourteenth International Conference on Pattern Recognition (Cat. No. 98EX170). Vol. 1. IEEE, 1998. That's because direct convolution is faster and more accurate for very low radius, while the Deriche filter is more accurate for medium blur radius, while Van Vliet is more accurate for high blur radius. The criteria suggested by the paper is a sigma value threshold of 3 and 32 for the Deriche and Van Vliet filters respectively, which we apply on the larger of the two dimensions. Both the Deriche and Van Vliet filters are numerically unstable for high blur radius. So we decompose the Van Vliet filter into a parallel bank of smaller second order filters based on the method of partial fractions discussed in the book: Oppenheim, Alan V. Discrete-time signal processing. Pearson Education India, 1999. We leave the Deriche filter as is since it is only used for low radii anyways. Compared to the CPU implementation, this implementation is more accurate, but less numerically stable, since CPU uses doubles, which is not feasible for the GPU.
Omar Emara added the
Interest
Compositing
Module
VFX & Video
labels 2024-04-09 15:25:55 +02:00
Omar Emara added 1 commit 2024-04-09 15:26:05 +02:00
3d7770808a Compositor: Implement Fast Gaussian Blur for GPU
This patch implements the fast Gaussian blur for the GPU compositor.
Omar Emara changed title from Compositor: Implement Fast Gaussian Blur for GPU to WIP: Compositor: Implement Fast Gaussian Blur for GPU 2024-04-09 15:30:26 +02:00
Omar Emara added 2 commits 2024-04-16 11:39:51 +02:00
Omar Emara added 2 commits 2024-04-17 16:55:34 +02:00
Omar Emara added 1 commit 2024-04-17 17:00:45 +02:00
Omar Emara added 1 commit 2024-04-18 12:10:52 +02:00
Omar Emara added 2 commits 2024-04-18 15:16:35 +02:00
Omar Emara added 1 commit 2024-04-18 17:15:04 +02:00
Omar Emara added 2 commits 2024-04-19 18:57:12 +02:00
Omar Emara added 2 commits 2024-04-23 17:28:49 +02:00
Omar Emara added 2 commits 2024-04-23 22:53:00 +02:00
Omar Emara added 1 commit 2024-04-24 09:51:50 +02:00
Omar Emara added 1 commit 2024-04-24 09:57:22 +02:00
Omar Emara added 1 commit 2024-04-24 10:32:34 +02:00
Omar Emara added 3 commits 2024-04-25 14:47:24 +02:00
Omar Emara added 1 commit 2024-04-25 21:02:11 +02:00
Omar Emara added 1 commit 2024-04-26 19:54:03 +02:00
Omar Emara added 1 commit 2024-04-29 11:46:00 +02:00
Omar Emara changed title from WIP: Compositor: Implement Fast Gaussian Blur for GPU to Realtime Compositor: Implement Fast Gaussian blur 2024-04-29 12:06:00 +02:00
Omar Emara requested review from Sergey Sharybin 2024-04-29 12:06:16 +02:00
Omar Emara added 2 commits 2024-04-29 12:25:33 +02:00
Omar Emara added 1 commit 2024-04-29 12:28:51 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
4605d197e6
Merge branch 'main' into recursive-gaussian-blur
Author
Member

@blender-bot build

@blender-bot build
Sergey Sharybin approved these changes 2024-04-30 12:47:32 +02:00
Omar Emara added 2 commits 2024-05-01 09:47:45 +02:00
Omar Emara added 1 commit 2024-05-01 09:55:18 +02:00
Omar Emara merged commit 382131fef2 into main 2024-05-01 09:57:43 +02:00
Omar Emara deleted branch recursive-gaussian-blur 2024-05-01 09:57:46 +02: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#120431
No description provided.