FiniteSingularity / obs-stroke-glow-shadow

An OBS plugin to provide efficient Stroke, Glow, and Shadow effects on masked sources.
GNU General Public License v2.0
121 stars 11 forks source link

[BUG] - Incorrect Glow color in most OBS projectors displayed on 10 bpc color depth monitors #39

Open Maxlucid opened 8 months ago

Maxlucid commented 8 months ago

Describe the bug In OBS Source, Group, and Scene projectors displayed on 10 bpc color depth monitors, the following is inaccurately light (does not match OBS' built-in Preview):

  1. the color of glow SOURCES,
  2. the color of glow FILTERS, and
  3. the color of the sources to which glow FILTERS are applied.

To Reproduce Steps to reproduce the behavior:

Glow SOURCE

  1. To a scene, add a group.
  2. To the group, add a Text source. (Other sources should also work, though Color sources do NOT.)
  3. To the group, add a Glow source, setting the Source = the Text source, and the rest of the settings as follows:
    • Position: Outer Glow
    • Blur Type: Triangular
    • Infill: NO
    • Size: 50.00px
    • Intensity: 200.00%
    • Fill Type: Color
    • Color: #ffa200
  4. Right-click the glow Source, Group, or Scene, and select either a fullscreen or windowed projector from the resulting menu.
  5. If the resulting projector is not yet displayed on a monitor that is set to a 10 bpc color depth, either change the monitor's color depth to 10 bpc, or move the projector onto a monitor that is already set to a 10 bpc color depth.
  6. Notice that the color of the glow is lighter in the projector than it is in OBS' built-in Preview, even when they are both displayed on the same monitor.

Glow FILTER

  1. To a scene, add a group.
  2. To the group, add a Text source. (Other sources should also work, though Color sources do NOT.)
  3. To the Text source, add a Glow filter with the following settings:
    • Position: Outer Glow
    • Blur Type: Triangular
    • Infill: NO
    • Size: 50.00px
    • Intensity: 200.00%
    • Fill Type: Color
    • Color: #ffa200
  4. Right-click the text Source, Group, or Scene, and select either a fullscreen or windowed projector from the resulting menu.
  5. If the resulting projector is not yet displayed on a monitor that is set to a 10 bpc color depth, either change the monitor's color depth to 10 bpc, or move the projector onto a monitor that is already set to a 10 bpc color depth.
  6. Notice that the colors of the text and the glow are lighter in the projector than they are in OBS' built-in Preview, even when they are both displayed on the same monitor.

Expected behavior In OBS Source, Group, and Scene projectors displayed on 10 bpc color depth monitors, the following will be accurate (match OBS' built-in Preview):

  1. the color of glow SOURCES,
  2. the color of glow FILTERS, and
  3. the color of the sources to which glow FILTERS are applied.

Screenshots

  1. Table: OBS Projector Color Observations: https://drive.google.com/file/d/1IA7axsKJVkMPZLT5BRgv6DOsEqPuoX0X/
  2. 10 bpc Monitor | Glow Source: https://drive.google.com/file/d/19ud3uI0Bmt5CX5x_XuYst8_ctKs9p39-/
  3. 10 bpc Monitor | Glow Filter: https://drive.google.com/file/d/1ls-CFZvQDIMwuRJ4QHfJuU9butWAGIfb/
  4. 8 bpc Monitor | Glow Source: https://drive.google.com/file/d/1Bi-GtZmOAJhoUFdib2wV09Wr1lNAhAdi/
  5. 8 bpc Monitor | Glow Filter: https://drive.google.com/file/d/1q9iCY2TqMSWEw6bkKGlSV9iKosbY4MoG/

Environment

GPU

Additional context I hope that the following discoveries will assist in the swift resolution of this bug: 1) The issue does NOT occur on 8 bpc color depth monitors. (See images 4 and 5.) 2) The issue does NOT occur in OBS Preview projectors, even when they are displayed on 10 bpc color depth monitors. (See bottom right quadrant of images 2, 3, 4, and 5.) 3) Applying a crop transform to a Group containing the glow source/filter resolves the issue in OBS Scene projectors, but not in OBS Group or Source projectors. (Links to images demonstrating this can be found on this Google Sheet: https://docs.google.com/spreadsheets/d/1_dnKC-JnEzhSa8Pdup45AW591UdQ6WIaNiVWC9VGtr0/ ) 4) Applying a crop transform to the glow SOURCE or the source to which a glow FILTER is attached resolves the issue in OBS Scene AND Group projectors, but not in OBS Source projectors. However, this "workaround" has the unwanted side effect of shrinking the glow and adding what appears to be a drop shadow around it. So, one could argue that this "workaround" is, itself, bugged in that it results in unexpected, undesireable behavior. (Links to images demonstrating this can be found on this Google Sheet: https://docs.google.com/spreadsheets/d/1_dnKC-JnEzhSa8Pdup45AW591UdQ6WIaNiVWC9VGtr0/ )

FiniteSingularity commented 8 months ago

Hi Max. I just got back from some travel where I had no internet access. I’ll take a look at this over the next few days and get back to you.

FiniteSingularity commented 8 months ago

Hi @Maxlucid-

Thank you for the detailed bug report. This is fantastic!

I am hopeful that this is related to the rendering pipeline issues that are effecting color, blending, and alpha, which a fix is in progress for. Once I have a build with that fix (hopefully within a week) I'll post a link here, and I'd love if you can give it a test to see if it fixes what you're seeing. If not, we'll figure out some other options for fixes/testing. My one issue here is that I dont have a 10bpc color depth monitor, so it may be a bit hard for me to test/diagnose.

Maxlucid commented 8 months ago

I will gladly test it for you. I look forward to helping! Good luck!

Maxlucid commented 2 weeks ago

On 2024-09-11, mredodos added this post to the "Stroke Glow Shadow" OBS forum discussion to report that his webcam source appears brighter in the source filters preview window when a stroke filter is applied to it. His OBS log linked in this subsequent OBS forum post lists both of his monitors as having bits_per_color=10. This inspired me to conduct some additional tests, the results of which support my suspicion that mredodos' observed behavior appears to be another manifestation of this bug - that sources to which a stroke, glow, or shadow filter is applied are displayed brighter than their true brightness in OBS' many preview and projector windows when those windows are displayed on 10bpc color depth monitors.

FiniteSingularity commented 2 weeks ago

Hi @Maxlucid-

First off, apologies that it took me so long to get around to this. I just started working on the next version of Stroke/Glow/Shadow and am looking into this. The way 10bit color is handled in OBS can be quite tricky, and I'm hoping I can come up with something that will work. I'll keep this issue updated as I progress over the next couple of weeks.

Maxlucid commented 1 week ago

@FiniteSingularity,

No problem! Thank you for making these filters available for free. I post only to provide additional details that might be helpful. :)

Thankfully, my testing reveals that the correct brightness is - on my system - always displayed in:

  1. OBS preview and projector windows if I change my monitor's color depth to 8bpc,
  2. OBS' built-in Preview dock - even on 10bpc color depth monitors, and
  3. my streams & recordings.

So, despite this very specific previews&projectors-on-10bpc-monitors issue, I continue to use and recommend your filters with confidence that viewers of our streams & recordings already do see everything at the correct brightness.