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
96 stars 7 forks source link

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

Open Maxlucid opened 3 months ago

Maxlucid commented 3 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 3 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 3 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 3 months ago

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