FiniteSingularity / obs-advanced-masks

Advanced Masking Plugin for OBS
GNU General Public License v2.0
146 stars 10 forks source link

[BUG] - Ellipse masks disappear when ellipse height is equal to ellipse width. #46

Closed FiniteSingularity closed 9 months ago

FiniteSingularity commented 9 months ago

Describe the bug If the ellipse height and width are equal, the ellipse mask vanishes.

To Reproduce Steps to reproduce the behavior:

  1. Create an ellipse mask.
  2. Set the width and the height to the same size.
  3. Witness the ellipse mask disappear.

Expected behavior Ellipse masks with an equal height and width should render as a circle.

Additional context This is due to the SDF function used, which divides by the difference between the width squared and height squared. If width equals height, this causes a divide by zero. Easy fix is to check before calling the render function, and if width == height, call the circle shader instead, after setting the circle radius to the ellipse width/height value.

FiniteSingularity commented 9 months ago

This issue is fixed with PR #44 .