VSE: make Glow effect 6x-10x faster #115818
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115818
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "aras_p/blender:vse-glow-opt"
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?
Glow effect was doing the correct thing algorithmically (separable gaussian blur), but it was 1) completely single-threaded, and 2) did operations in several passes over the source images, instead of doing them in one go. This PR:
IMB_buffer_float_from_byte
followed byIMB_buffer_float_premultiply
, doIMB_colormanagement_transform_from_byte_threaded
which achieves the same, but more efficiently.float4
vector type for more compact code; useArray
classes instead of manual memory allocation, etc.IMB_buffer_float_unpremultiply
andIMB_buffer_float_premultiply
since they are no longer used by anything whatsoever.Applying Glow to 4K UHD sequencer output, on Windows Ryzen 5950X:
Same on Mac M1 Max:
While doing all this, I noticed that Glow could also get fixes/improvements perhaps, but these are best discussed as a separate PR (this one is supposed to not change anything, just speed it up):
WIP: VSE: speedup Glow effectto WIP: VSE: make Glow effect 10x faster@blender-bot build
WIP: VSE: make Glow effect 10x fasterto VSE: make Glow effect 10x fasterVSE: make Glow effect 10x fasterto VSE: make Glow effect 6x-10x fasterThis code looks very like
Blur Attribute
node (just with specific an neighbor set providing function).Hmm not sure I see immediate similarity. From what I can tell, Blur Attribute node works by repeatedly smoothing the data. Which, given high enough iteration count, indeed approaches the gaussian distribution.
This code (and several other places inside Blender that apply gaussian kernel filtering to images) works by implementing gaussian blur more directly - in two 1D convolution passes (gaussian kernel is separable, that's why it can be done).
I could have tried to share more code between this and e.g. Gaussian Blur VSE effect that is in the same file even, but as mentioned in PR description, that would have been a (slight) behavior change which I wanted to avoid.
Just a style nitpick: Comments should end with full stop.
As for another mentioned improvements, I would welcome these. Not sure how proper luminosity would affect output. If it is too much there could be concern about existing files - people are using glow for text outline for example. If it is minor change, it is question, whether it is worth fixing...