Stroke Glow Shadow

Stroke Glow Shadow 1.0.2

First of all, awesome plugin!
Unfortunately it seems that it has problems with sources that need "SRGB Off" blending method. One such source is a browser source.
If you create a browser source which has white text and no background, and place it over white "colour source", the text will have a thin dark outline with default blending method - this is solved by using "SRGB Off". However, if you use "Glow" set to "Outer Glow", with white color, the dark outline is back, no matter the blending method.

Also, it doesn't matter if you use "glow" as a filter or glow as a source off that browser, this is what you get:
View attachment 100954
(browser source with white text on transparent background + white color source + white glow)

Just discovered that with "Text (GDI+)" source which itself doesn't need SRGB Off, it works ok as a filter, but this is what you get if you use glow source for that text:
View attachment 100955
Again, changing blending method for the glow source, does not help.

--
btw +1 for auto padding ^^
There were some blending bugs indeed with this first release (specifically related to SRGB). I've built a new rendering pipeline that I added to both the Composite Blur and Advanced Masks plugin (as well as Exeldro's shaderfilter plugin) that should fix these issues. I'm currently working on adding it to the SGS plugin, and it will be in the next release (along with auto-padding). So stay tuned! :)
 

misterener

New Member
Hi, I'm new here... every time I add the plugin to a source it disappears. What am I doing wrong?

plugin off
Screenshot 2024-01-17 180803.jpg


plugin on
Screenshot 2024-01-17 180825.jpg
 
Hi, I'm new here... every time I add the plugin to a source it disappears. What am I doing wrong?
Hi misterener-

From your screenshots, it looks like your plugin isn't finding the data directory that gets installed (and thus it can not load the shader files, or the translation files, causing the strange labels for the sliders).

Did you install the files using the windows installer? Or manually with the zip file? I'm happy to help you get it up and running.
 

misterener

New Member
Hi misterener-

From your screenshots, it looks like your plugin isn't finding the data directory that gets installed (and thus it can not load the shader files, or the translation files, causing the strange labels for the sliders).

Did you install the files using the windows installer? Or manually with the zip file? I'm happy to help you get it up and running.
Hi, FiniteSingularity, thanks for the quick answer. I reinstalled it and now my source doesn't disappear anymore but I have no effect at all.
No glow, no shadow, no stroke. I tried to crop them as suggested and still nothing happens. I'm using windows 10, OBS 30.0.2.
 
You're welcome! The first thing to test- try setting the stroke, glow, or shadow to "inner" just to test if anything is happening. If you do see the inner effect, then it is likely some sort of issue with how the cropping is happening (the whole cropping thing can be quite tricky, and I'm working to simplify it with an auto-crop feature in the next release). Let me know if you see the inner glow/shadow/stroke or not, and we can go from there.
 

misterener

New Member
You're welcome! The first thing to test- try setting the stroke, glow, or shadow to "inner" just to test if anything is happening. If you do see the inner effect, then it is likely some sort of issue with how the cropping is happening (the whole cropping thing can be quite tricky, and I'm working to simplify it with an auto-crop feature in the next release). Let me know if you see the inner glow/shadow/stroke or not, and we can go from there.
All of a sudden, it starts to work. I don't know why; maybe there was a bug. As soon as I changed to inner and back to the outer effect, it started to work in both states. Now everything is fine. Here you can see stroke, shadow and glow at the same time. Thanks for the support.
 

Attachments

  • Screenshot 2024-01-18 164531.jpg
    Screenshot 2024-01-18 164531.jpg
    26.7 KB · Views: 22
Awesome! I'm glad it is working for you- enjoy the plugin. And if you run into any issues, please feel free to reach out here or open an issue on the project GitHub.
 

Rediflow

New Member
First of all: I heard just today about this awesome Plugin and tried it imeadeatly.
It does what it says it does, and this, as far as I reached, very well.

1 thing for the nice to have Wishlist: Instead of make just single color, give us the option for a gradient (Center to out and / or left to right) , without using a workaround through a source with a Gradient on it.
 

Calico Skye

New Member
I recently started using the glow filter, and on both triangular and duel my OBS gpu usage is tripled, from about 5% to 18-22% consistently. As soon as I turn the filter off on every source in the scene it drops. The same happens for shadow. I'm running a 3070ti and while my logs might be helpful, I have so many plugins old and half working plugins installed they might not be the most helpful. Let me know if there's any way I can help and thank you for making these plugins!
 
I recently started using the glow filter, and on both triangular and duel my OBS gpu usage is tripled, from about 5% to 18-22% consistently. As soon as I turn the filter off on every source in the scene it drops. The same happens for shadow. I'm running a 3070ti and while my logs might be helpful, I have so many plugins old and half working plugins installed they might not be the most helpful. Let me know if there's any way I can help and thank you for making these plugins!
Hi Calico-

Thank you for letting me know of the resource usage you are seeing. Getting a log file could be useful, so if you can upload the log file and send me a link (feel free to DM me the link if you don't want it public), that would be appreciated.

A couple of thoughts:

1. Do you happen to know if you are using any other plugins that use GPU shaders? As a point of reference, I have an RTX 3080, and as soon as I add any plugins that use shaders, I have a similar jump in GPU usage to around 20%, but then additional plugins with shaders add very little overhead.
2. How are you measuring GPU usage? I've run into issues with my RTX3080 where at very low usage, due to how the GPU scales down its clock and memory speeds, it shows 40 or 50% GPU utilization in the Task Manager (its utilizing 40-50% of the way-down-scaled clock speed, but would only be a few percent of the card at full-speed, if that makes sense?)
3. How many sources are you applying the filter to, and at what resolution is your camera? A 20-30px glow/shadow on a 1080p60 source uses 3-5% of my 3080 for triangular blurring, so 4 or 5 sources could easily be 20% of the GPU. That said, the Dual Kawase algorithm uses *very* little GPU, so if you're seeing that increase with both, its probably not this.

One thing you could do for troubleshooting:
1. Create a new scene collection, and make it active.
2. restart OBS (this should give you a clean slate- dont worry, you can just switch back to your actual scene collection when done testing)
3. Create a single source (say a chroma-keyed face cam).
4. Add a shadow or blur filter.
5. Toggle it off and on and see if you're still seeing a similar change in GPU utilization.

If you are not seeing the same change in GPU utilization with the fresh scene collection, it is likely that there is something going on between the stroke/glow/shadow plugin and some other plugin.
 

TMBGeeks

New Member
I'm not sure how much of this is under your control Finite but the best Stroke method for Text (GDI+) also cuts off the Stroke.

For this example I turned off anti-aliasing for both the text and the stroke (including the Photoshop example). The problem is compounded after anti-aliasing so I'm trying to get to the source.

Notice in the bottom example, when you just apply the Stroke to the Text (GDI+), it gets cut off. The only solution I've found is to nest the Text (GDI+) inside a Scene and apply the Stroke to the Scene. The problem here is that the Stroke renders differently (and worse) as you can see in the middle two examples. You can see when the Stroke is applied to the Text (GDI+) source, it renders better rounded corners noticeably on the T, :, k, li, and d versus the blocky corners when applied to the Scene. So you have to trade off between cut off edges and better Stroke rounding or the full Stroke but at a worse render.

Also, the Stroke Size is very different when applied to the Text versus the Scene. It was something like 4-7 on the Text but on the Scene it had to be around 25 to match what's shown in my example.

Lastly, and this is the part that may be out of your control, even the best options don't render as well as Photoshop. It's hard to tell if it's the Stroke itself or the differences in OBS and Photoshop's rendering of the font before it even gets to the Stroke. The comparison for this would be the 1st and 3rd examples, ignoring the cut off edges of the 3rd.
 

Attachments

  • example.png
    example.png
    23.7 KB · Views: 20
Last edited:
Hi TMBGeeks-

Thank you for the feedback on the stroke plugin. Comments inline...
I'm not sure how much of this is under your control Finite but the best Stroke method for Text (GDI+) also cuts off the Stroke.

For this example I turned off anti-aliasing for both the text and the stroke (including the Photoshop example). The problem is compounded after anti-aliasing so I'm trying to get to the source.

Notice in the bottom example, when you just apply the Stroke to the Text (GDI+), it gets cut off. The only solution I've found is to nest the Text (GDI+) inside a Scene and apply the Stroke to the Scene. The problem here is that the Stroke renders differently (and worse) as you can see in the middle two examples. You can see when the Stroke is applied to the Text (GDI+) source, it renders better rounded corners noticeably on the T, :, k, li, and d versus the blocky corners when applied to the Scene. So you have to trade off between cut off edges and better Stroke rounding or the full Stroke but at a worse render.

The good news is that you can fix the stroke being cut off. Essentially what is happening- text (and all sources) have a bounding box, that when we pass through a filter, will cut off anything outside the bounding box (the bounding box can be visualized by the blue border around the source when your mouse hovers over it in the sources list). I only recently learned that I can have my filters expand that bounding box, and so I am working on an "auto-padding" checkbox that will do just this. In the meantime there are 2 different workarounds:
  1. For text sources specifically, there is a "Use Custom Text Extents" checkbox that when checked lets you specify the size of the bounding box. If you set it larger than the text + stroke, and set the Alignment and Vertical Alignment to center, you should be able to avoid the cropping of the stroke.
  2. An easier way (as it works for all sources, doesn't require you to change the text alignment, and will resize automatically if your text changes) is to use the crop/pad filter (built into OBS) in the filter chain *before* the stroke filter, and give it negative padding:
    1709387155366.png
Additionally- for text sources in particular, if you need a 20px or smaller stroke, I'd recommend using the text source's outline option instead, as it will render a better quality stroke for reasons I'll explain further down.

Also, the Stroke Size is very different when applied to the Text versus the Scene. It was something like 4-7 on the Text but on the Scene it had to be around 25 to match what's shown in my example.

That sounds like a bug, and I'll look into it. I have a feeling it has to do with how I layer/render the effects- I found some flaws in how I was doing things, and fixed them in my other plugins, but due to a few difficulties in the code, I haven't yet been able to implement the new rendering pipeline for Stroke/Glow/Shadow. I'm about to release 2 new plugins, and once those are done, I'll be putting some time into fixing some of the bugs in this plugin.

Lastly, and this is the part that may be out of your control, even the best options don't render as well as Photoshop. It's hard to tell if it's the Stroke itself or the differences in OBS and Photoshop's rendering of the font before it even gets to the Stroke. The comparison for this would be the 1st and 3rd examples, ignoring the cut off edges of the 3rd.

Some of this might be due to the rendering bug I mention above- it renders some things strange with alpha blending, which makes the edges on things like text look a bit funny. I'm hopeful that this will be fixed in the next release.

The point about how it renders differently than Photoshop (and from the text source's built-in outline) is absolutely true. When photoshop (and for that matter the GDI text source) renders text, it has (or builds) a mathematical description of where the edges of the text are. If you're familiar with graphics terminology, it is like using a vector format, that describes the shapes on the canvas, which lets them be resized without any loss. It also lets you mathematically describe what the stroke should be around the text.

Unfortunately, by the time the text gets to the stroke/glow/shadow filter, it has been rasterized, so now it is more like working with a jpeg or png- I dont have access to the description of how the text shape was made- I only have the resulting pixels. The way the plugin works is to use a fuzzy circular sampling to see what neighboring pixel alpha values are, and construct the stroke, glow, or shadow from that. This means that for complex shapes like text, inside corners especially will become a bit "thicker" or more blobby than a perfect stroke.

I hope this was all helpful. Please let me know if you have any other questions.

Cheers!
 

TMBGeeks

New Member
Thanks for the detailed reply, that explains just what I wanted to know. I'll play around with the padding and I guess we can only do so well with a stroke until someone is able to incorporate vector fonts into OBS which may not be possible. Keep it up, looking forward to future versions.
 

Calico Skye

New Member
Hi Calico-

Thank you for letting me know of the resource usage you are seeing. Getting a log file could be useful, so if you can upload the log file and send me a link (feel free to DM me the link if you don't want it public), that would be appreciated.

A couple of thoughts:

1. Do you happen to know if you are using any other plugins that use GPU shaders? As a point of reference, I have an RTX 3080, and as soon as I add any plugins that use shaders, I have a similar jump in GPU usage to around 20%, but then additional plugins with shaders add very little overhead.
2. How are you measuring GPU usage? I've run into issues with my RTX3080 where at very low usage, due to how the GPU scales down its clock and memory speeds, it shows 40 or 50% GPU utilization in the Task Manager (its utilizing 40-50% of the way-down-scaled clock speed, but would only be a few percent of the card at full-speed, if that makes sense?)
3. How many sources are you applying the filter to, and at what resolution is your camera? A 20-30px glow/shadow on a 1080p60 source uses 3-5% of my 3080 for triangular blurring, so 4 or 5 sources could easily be 20% of the GPU. That said, the Dual Kawase algorithm uses *very* little GPU, so if you're seeing that increase with both, its probably not this.

One thing you could do for troubleshooting:
1. Create a new scene collection, and make it active.
2. restart OBS (this should give you a clean slate- dont worry, you can just switch back to your actual scene collection when done testing)
3. Create a single source (say a chroma-keyed face cam).
4. Add a shadow or blur filter.
5. Toggle it off and on and see if you're still seeing a similar change in GPU utilization.

If you are not seeing the same change in GPU utilization with the fresh scene collection, it is likely that there is something going on between the stroke/glow/shadow plugin and some other plugin.
Thank you so much for the help and sorry I took so long to get back to you! I haven't had the time to try some of this testing until now. I think you're right, it only takes up a decent amount of gpu percentage when it's idle. I'm having to do a fresh install of OBS to figure out what's going on with all my other issues, and I don't think glow has anything to do with it. Thanks again for making wonderful tools for us to use! ^_^
 

Kuckoo_Kaiju

New Member
Wondering if you may be able to offer some guidance. I cannot get the Outer Shadow or Dual Kawase setting to function as either a Source or a Filter on a Source. Tried reinstalling OBS and the Plugin using the Installer, and the issue has remained consistent. Tested a few different options at this point but most of the resources show that the shadows just apply as soon as the filter is enabled, is there something I am missing?
 
Wondering if you may be able to offer some guidance. I cannot get the Outer Shadow or Dual Kawase setting to function as either a Source or a Filter on a Source. Tried reinstalling OBS and the Plugin using the Installer, and the issue has remained consistent. Tested a few different options at this point but most of the resources show that the shadows just apply as soon as the filter is enabled, is there something I am missing
Hi,
If the problem is with "outer" shadows, the most likely issue is that the source has non-transparent pixels all the way out to the edge. Unfortunately, the filter/source cant draw outside of the bounds of the source. However, there is a workaround. If you're using the filter, BEFORE the filter add a "crop/pad" filter, and add negative padding to all sides (e.g.- 20px for all sides). This should give some padding around the content of the source where the shadow can render. Please let me know if that helps, otherwise we can dive deeper into figuring out what is wrong.
 

Kuckoo_Kaiju

New Member
Hi,
If the problem is with "outer" shadows, the most likely issue is that the source has non-transparent pixels all the way out to the edge. Unfortunately, the filter/source cant draw outside of the bounds of the source. However, there is a workaround. If you're using the filter, BEFORE the filter add a "crop/pad" filter, and add negative padding to all sides (e.g.- 20px for all sides). This should give some padding around the content of the source where the shadow can render. Please let me know if that helps, otherwise we can dive deeper into figuring out what is wrong.
This worked! Thanks for the fast reply and quick solution.
 

DIY Locals

New Member
Having an issue with installing "obs-stroke-glow-shadow" plugin on Linux Mint.

OBS Studio running very well on Linux Mint, everything works great out the box. However, there's no sign of a plugins folder (doesn't exist in ~/.cofig/obs-studio), so I manually created it. Downloaded "obs-stroke-glow-shadow-1.0.2-linux" version, unzipped "obs-stroke-glow-shadow-1.0.2-ubuntu-20.04.tar.gz" and placed it manually in the plugins folder.

Scrolling through OBS menus, but I see no reference to plugin location or how to install these. Any ideas on what to do now?
 
Having an issue with installing "obs-stroke-glow-shadow" plugin on Linux Mint.

OBS Studio running very well on Linux Mint, everything works great out the box. However, there's no sign of a plugins folder (doesn't exist in ~/.cofig/obs-studio), so I manually created it. Downloaded "obs-stroke-glow-shadow-1.0.2-linux" version, unzipped "obs-stroke-glow-shadow-1.0.2-ubuntu-20.04.tar.gz" and placed it manually in the plugins folder.

Scrolling through OBS menus, but I see no reference to plugin location or how to install these. Any ideas on what to do now?
The linux package includes ubuntu installer files. Unfortunately, I dont have a linux machine to test installs on. I'll try to find some info for you and get back to you in this thread.
 
Top