Realtime Compositor: Implement Inpaint node #111792
No reviewers
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111792
Loading…
Reference in New Issue
No description provided.
Delete Branch "OmarEmaraDev/blender:gpu-inpaint"
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?
This patch implements the Inpaint node for the Realtime Compositor. The
inpainting region is filled by sampling the closest pixel at the inpainting
boundary, which is done using the Jump Flooding algorithm. To smooth the
inpainting region, a lateral blur is applied in the direction tangent to the
inpainting boundary.
The implementation is not identical to the existing CPU implementation due to
technical infeasibility. In particular, the CPU implementation uses a Manhattan
distance transform, while the GPU implementation uses an Euclidean one, which is
a consequence of the use of the Jump Flooding algorithm. Furthermore, the CPU
uses a serial convolution starting from the boundary outwards, while the GPU
uses a lateral Gaussian blur in the direction tangent to the boundary.
Depends on #112223. For the Jump Flooding implementation.
WIP: Realtime Compositor: Implement Inpaint nodeto Realtime Compositor: Implement Inpaint nodeComparison between CPU and GPU implementations with a 30px inpainting distance. The weird shape of the CPU one is due to the use of Manhatten distance.
Looks very good and super useful! I was just wondering if the left tearing artifact is to be expected
@ -0,0 +48,4 @@
if (squared_distance < minimum_squared_distance) {
minimum_squared_distance = squared_distance;
closest_seed_position = position;
Fails on OSX
@fclem Not sure, looking into it.
Apparently, those banding effects are due to a sudden change of the tangent vector because two neighbouring pixels picks up two boundary pixels that are far way from each other, which in this case happens due to the aliasing at the cube edges, as can be seen in this illustration.
A possible workaround is to recompute the tangent at each integration step, at the cost of many more texture fetches, I could look into that.
The step artifact are indeed fixed! To me everything is good.
I think the difference in the algorithm is fine for the main purpose of the node. I don't think it was really designed to close large gaps.
That being said, do you think it feasible to use euclidean distance on CPU to align its result more closely to GPU?
@Sergey It is feasible to use euclidean distance for the CPU as well. I just haven't done my homework yet on what the best way to do that is. The 1+JFA algorithm we use on the GPU was chosen because it works well on massively parallel hardware, which might not be the best on CPUs.
@OmarEmaraDev I see. Well, for the main intended use-case I think the difference will be minimal. So don't think it is practical to consider the difference a stopper here.