VSE: Text shadow blur / outline #121478
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
Code Documentation
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#121478
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "aras_p/blender:vse_text_effects"
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?
Implements small part of #112698 and possibly other existing requests (from right-click select: https://blender.community/c/rightclickselect/dJfbbc/ and https://blender.community/c/rightclickselect/xTdbbc/):
Text got configurable shadow angle and offset (previously shadow location relative to text was fixed). Currently the shadow position is rounded to integer pixel locations (sub-pixel positioning might come later).
Text got optional shadow blur amount:
Shadow blur 0.1:
Shadow blur 0.4:
Shadow blur 0.8:
Text got optional outline option, with separate outline color and outline width. Outline is calculated using jump-flooding algorithm (similar to what compositor does for inpainting / double edge mask), which in my tests is faster than a blur based approach even at small outline widths. At some point it would allow even mapping a gradient or whatever across the outline.
Here's large font with 30px outline:
The same with 3px outline:
And a tiny (12pt) text with 2px outline:
TODO / Questions:
maybe or really i'm pushing too far , i'm dreaming having Shadows of the shadow meaning double outline ..(or more with custom color for each (color ramp ?))
@blender-bot build
Great feature! Just a remark: is it possible to smooth these jagged edges/artefacts and put some antialiasing?
@Mikamiel that "weird line" in the middle has nothing to do with shadow/outline (or even text), it's just that there was fractional scaling in the VSE preview window when I took the screenshots.
WIP: VSE: Text shadow blur / outlineto VSE: Text shadow blur / outlineThat's what it was!)
I was following the JFA, untill it got to AA part, which is bit blurry (HA!) to me. but I got the gist.
Technically both JFA and shadow can be optimized by only working on part of buffer, because you know the position and size of these elements.
Quite some time ago I wanted to add support for blending buffers of non-uniform size, as this would make using text strip much faster overall, but that would be bit more complicated.
While testing I've noticed that the shadow is only moved by integer pixels, so if you animate shadow rotation it kind of jumps rather than having smooth anti-aliased transition. It is not something that necessarily needs to be supported by this initial PR, but it worth stating it as a known limitation in the PR description.
I didn't look into details of what exactly is going wrong there, but it would be good if we the broken functionality got addressed separately. it'll make it easier to review.
@ -2706,0 +2801,4 @@
IMB_freeImBuf(tmp_out1);
IMB_freeImBuf(tmp_out2);
BLF_buffer(font,
out->float_buffer.data,
Can we pass
nullptr
instead ofout->float_buffer.data
?To me it will be much more clear indication of what we expect to be happening here: we only expect the text to operate o na byte buffers, and we only write to byte buffer. So when we pass float buffer somewhere it reads as if it is expected that it might be a valid buffer.
This seems to be general limitation of whole BLF system: the text effect code does pass floats to
BLF_position
, but then that one internally rounds them to nearest integer coordinate, and stores as integers for later rasterization. That is: all texts across whole blender are positioned at integer pixel coordinates, it seems.I guess with some additional work we could rasterize the text for shadow at non-offset-at-all position, then blur it, and then manually place it where needed, with bilinear interpolation. But perhaps better done separately indeed (including perf optimizations that would do outline/blurring only on text area, and not the whole image).
The BLF historically was done to draw UI texts indeed, where you do want to place it as pixel-perfect as possible. Is only much later when it started to be used for an effect type of a thing.
For the description I'd still suggest doing something like: