Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 01-10-2020, 04:02 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default WDL/swell on OSX: BitBlt and StretchBlt: SRCCOPY_USEALPHACHAN not working

(Cross-posting from the WDL Users subforum, since I'm not sure if the devs regularly check that subforum.)

On my Windows 64bit, Linux 32bit and OSX High Sierra systems [EDIT: Since the bug seems to be related to Apple's Metal graphics, it can probably occur in any macOS version from El Capitan or later, and in REAPER v6.0 or later.], StretchBlt with SRCCOPY_USEALPHACHAN works fine, and transparent graphics can be drawn on top of REAPER's windows, such as:




On some users' OSX systems, however, per-pixel alpha blending doesn't seem to work, and graphics are drawn fully opaque:




* Since the script works fine on all three my systems, I don't think there is a bug in the script itself.

* The black background is created by LICE_Clear(bitmap, 0), so the order of R, G, B and A isn't relevant -- it should just be fully transparent.

Last edited by juliansader; 02-22-2020 at 03:54 AM.
juliansader is offline   Reply With Quote
Old 01-10-2020, 05:18 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Hmm SRCCOPY_USEALPHACHAN shouldn't work on win32. Or on macOS when Metal is enabled for the window in question.
Justin is offline   Reply With Quote
Old 01-10-2020, 05:38 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Oops, I should have written that on Windows, the script uses the Win32 function AlphaBlend, not the WDL/swell function StretchBlt.

I am relieved that the source of the problem was so easy to spot. Would it be possible to update REAPER's built-in BitBlt and StretchBlt to apply per-pixel alpha in Metal?
juliansader is offline   Reply With Quote
Old 01-10-2020, 06:17 AM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by juliansader View Post
Oops, I should have written that on Windows, the script uses the Win32 function AlphaBlend, not the WDL/swell function StretchBlt.

I am relieved that the source of the problem was so easy to spot. Would it be possible to update REAPER's built-in BitBlt and StretchBlt to apply per-pixel alpha in Metal?
I’ll look to see if it is possible, it might be extremely difficult though.
Justin is offline   Reply With Quote
Old 01-16-2020, 12:55 PM   #5
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I really hope that it will be possible for WDL/swell blitting to work with Metal.

The ability to draw inside REAPER's windows is supposed to be one of the highlights of the ReaScriptAPI extension, and is essential for making scripts seem seamlessly integrated into REAPER' UI.

Besides my own scripts, two other examples of WIP scripts that use these functions are Sexan's Area51 script, and an as-yet unnamed script by lb0:



juliansader is offline   Reply With Quote
Old 01-16-2020, 01:02 PM   #6
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I should point out, however, that WDL/swell blitting is only a means to an end, namely drawing inside REAPER's windows -- and is a bit of a hack.

If REAPER could implement a native function for linking LICE bitmaps with REAPER windows *before* they are drawn in Metal, such a function might work better, with less flickering -- and might even be easier to code -- than updating swell to work with Metal.

This idea was originally discussed in the FR Extension API: Link LICE bitmap to REAPER window, for seamless integration into UI.
juliansader is offline   Reply With Quote
Old 01-29-2020, 11:52 AM   #7
o_e
Human being with feelings
 
o_e's Avatar
 
Join Date: May 2016
Posts: 681
Default

Quote:
Originally Posted by juliansader View Post
I should point out, however, that WDL/swell blitting is only a means to an end, namely drawing inside REAPER's windows -- and is a bit of a hack.

If REAPER could implement a native function for linking LICE bitmaps with REAPER windows *before* they are drawn in Metal, such a function might work better, with less flickering -- and might even be easier to code -- than updating swell to work with Metal.

This idea was originally discussed in the FR Extension API: Link LICE bitmap to REAPER window, for seamless integration into UI.
May I ask if there any progress in this topic?
o_e is offline   Reply With Quote
Old 01-31-2020, 12:34 AM   #8
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Sadly, not that I am aware of.

The first mention of Metal that I could find in the changelogs, is from v6.0, so I assume that the problem arose only recently:
Quote:
v6.0 - December 3 2019
+ macOS: use Metal display output on 10.11+ for various windows
juliansader is offline   Reply With Quote
Old 02-01-2020, 05:26 AM   #9
o_e
Human being with feelings
 
o_e's Avatar
 
Join Date: May 2016
Posts: 681
Default

Quote:
Originally Posted by juliansader View Post
Sadly, not that I am aware of.

The first mention of Metal that I could find in the changelogs, is from v6.0, so I assume that the problem arose only recently:
Just reread the whole thread, so on macOS 10.13, 'High Sierra' everything works fine? Then I would consider upgrading my OS..?
o_e is offline   Reply With Quote
Old 02-01-2020, 05:41 AM   #10
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I will update the first post to point out that, AFAIK, the problem isn't caused by specific versions of macOS. Instead, as another user found, it seems to be triggered by a setting in REAPER that activates Metal:

Quote:
Originally Posted by tmmmmm View Post
Same "bug" on my mac os 10.4-system. Setting "Display Updates" in the "Advanced UI/system tweaks..."-Settings to "Force Classic" fixes it for now - not sure of all downsides of that, though.
juliansader is offline   Reply With Quote
Old 02-01-2020, 10:04 AM   #11
o_e
Human being with feelings
 
o_e's Avatar
 
Join Date: May 2016
Posts: 681
Default

Quote:
Originally Posted by juliansader View Post
I will update the first post to point out that, AFAIK, the problem isn't caused by specific versions of macOS. Instead, as another user found, it seems to be triggered by a setting in REAPER that activates Metal:
But does it work on your 'High Sierra' System? So maybe it is worth a try to upgrade the OS (as a temporarily workaround until it gets fixed in Reaper)..?

Last edited by o_e; 02-01-2020 at 10:24 AM.
o_e is offline   Reply With Quote
Old 02-01-2020, 12:46 PM   #12
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

I'm not very knowledgeable about Apple stuff, but I think my virtual macOS test system is not powerful enough to run Metal, even if it's enabled in REAPER, so I never encountered the bug.

On your system, do you still see the bug if you disable Metal in REAPER's settings?
juliansader is offline   Reply With Quote
Old 02-12-2020, 08:11 PM   #13
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Yes please.... please fix this Cockos. Having this issue in OSX as well:



Thanks for all your hard work Julian!!!

And the Cockos Dev eam!!

Cheers,

Andrew K
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 02-22-2020, 05:30 AM   #14
todd_r
Human being with feelings
 
todd_r's Avatar
 
Join Date: Nov 2006
Posts: 855
Default

This is a pretty huge deal for the people writing the most advanced scripts, which is a big part of the attraction to reaper. Hoping we get some news soon?
todd_r is offline   Reply With Quote
Old 04-03-2020, 04:44 AM   #15
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Hope this gets fixed soon, I want to be able to use sexan's LUA : Area(51) Selection Alpha on mac (with metal/dark mode enabled). Currently, you have to select 'force classic drawing mode' in the prefs for the script to work.

However then you can't use dark mode since using the older, classic drawing mode is not smooth enough. If this got fixed then you should be able to use the newer metal drawing mode with dark mode (which can only work using the metal mode) and people's scripts will work as intended.
Ideosound is offline   Reply With Quote
Old 04-09-2020, 02:01 AM   #16
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by Justin View Post
I’ll look to see if it is possible, it might be extremely difficult though.
Pleaseeeeeeee
Ideosound is offline   Reply With Quote
Old 04-15-2020, 05:29 AM   #17
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

Adding an Aussie voice to the MacOS chorus for resolving this.

The work that is going on with these extensions, coupled with the fantastic shape Reaper is in on MacOS is a highly compelling motivation to jump-ship from other established DAW's.
tdc is offline   Reply With Quote
Old 04-24-2020, 02:56 AM   #18
Stroudy
Human being with feelings
 
Stroudy's Avatar
 
Join Date: Jul 2014
Location: London
Posts: 733
Default

I'm on Mojave - there's little point upgrading is there?
Metal is the issue, right?

I've disabled Metal in the Reaper advanced UI tweaks for now. I'm hoping I won't see much in the way of a performance decrease
Stroudy is offline   Reply With Quote
Old 04-24-2020, 04:55 AM   #19
tdc
Human being with feelings
 
Join Date: Oct 2019
Location: Sydney
Posts: 471
Default

I have seen a number of new innovative scripts being broken by Metal, and am wondering what the drawback is by regressing to Classic?
tdc is offline   Reply With Quote
Old 04-24-2020, 08:38 AM   #20
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by Stroudy View Post
I'm on Mojave - there's little point upgrading is there?
Metal is the issue, right?

I've disabled Metal in the Reaper advanced UI tweaks for now. I'm hoping I won't see much in the way of a performance decrease
Mojave is the best IMO since it supports metal (the newer gui graphics engine) and still supports 32 bit apps.
Ideosound is offline   Reply With Quote
Old 04-24-2020, 08:50 AM   #21
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by tdc View Post
I have seen a number of new innovative scripts being broken by Metal, and am wondering what the drawback is by regressing to Classic?
Hence why this should be getting fixed as further development on porting over code that means we can use the newer metal drawing mode BUT without it breaking scripts. I'm no expert myself. Or maybe for scripts to be able to work and be updated so they can take advantage of metal. Metal was part of Mojave I believe so it's been out since Sept 2018.

For example

You can't use Reaper in dark mode (which I absolutely love and there really isn't any going back for me) without metal. So if you are having to use the classic drawing mode then this limits the options, since now you can't use dark mode. I've been firmly pushing dark mode features in Reaper along with a few others since I truly think it makes it look a ton slicker and more professional. Some people don't care about the design and UI UX of software, but I do. It helps make the experience better IMO.
Ideosound is offline   Reply With Quote
Old 05-14-2020, 02:38 PM   #22
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Metal fix for this is coming in a +dev build soon!
Justin is offline   Reply With Quote
Old 05-15-2020, 03:43 AM   #23
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by Justin View Post
Metal fix for this is coming in a +dev build soon!
I bow down to your greatness! thank you thank you thank you
Ideosound is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.