 |
|
|
01-10-2020, 04:02 AM
|
#1
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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.
|
|
|
01-10-2020, 05:18 AM
|
#2
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,221
|
Hmm SRCCOPY_USEALPHACHAN shouldn't work on win32. Or on macOS when Metal is enabled for the window in question.
|
|
|
01-10-2020, 05:38 AM
|
#3
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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?
|
|
|
01-10-2020, 06:17 AM
|
#4
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,221
|
Quote:
Originally Posted by juliansader
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.
|
|
|
01-16-2020, 12:55 PM
|
#5
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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:
|
|
|
01-16-2020, 01:02 PM
|
#6
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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.
|
|
|
01-29-2020, 11:52 AM
|
#7
|
Human being with feelings
Join Date: May 2016
Posts: 668
|
Quote:
Originally Posted by juliansader
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?
|
|
|
01-31-2020, 12:34 AM
|
#8
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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
|
|
|
|
02-01-2020, 05:26 AM
|
#9
|
Human being with feelings
Join Date: May 2016
Posts: 668
|
Quote:
Originally Posted by juliansader
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..?
|
|
|
02-01-2020, 05:41 AM
|
#10
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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
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.
|
|
|
|
02-01-2020, 10:04 AM
|
#11
|
Human being with feelings
Join Date: May 2016
Posts: 668
|
Quote:
Originally Posted by juliansader
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.
|
|
|
02-01-2020, 12:46 PM
|
#12
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,714
|
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?
|
|
|
02-12-2020, 08:11 PM
|
#13
|
Human being with feelings
Join Date: May 2018
Location: Los Angeles
Posts: 1,661
|
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.61 Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
|
|
|
02-22-2020, 05:30 AM
|
#14
|
Human being with feelings
Join Date: Nov 2006
Posts: 819
|
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?
|
|
|
04-03-2020, 04:44 AM
|
#15
|
Human being with feelings
Join Date: Oct 2017
Location: U.K
Posts: 513
|
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.
|
|
|
04-09-2020, 02:01 AM
|
#16
|
Human being with feelings
Join Date: Oct 2017
Location: U.K
Posts: 513
|
Quote:
Originally Posted by Justin
I’ll look to see if it is possible, it might be extremely difficult though.
|
Pleaseeeeeeee
|
|
|
04-15-2020, 05:29 AM
|
#17
|
Human being with feelings
Join Date: Oct 2019
Location: Sydney
Posts: 470
|
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.
|
|
|
04-24-2020, 02:56 AM
|
#18
|
Human being with feelings
Join Date: Jul 2014
Location: London
Posts: 615
|
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
|
|
|
04-24-2020, 04:55 AM
|
#19
|
Human being with feelings
Join Date: Oct 2019
Location: Sydney
Posts: 470
|
I have seen a number of new innovative scripts being broken by Metal, and am wondering what the drawback is by regressing to Classic?
|
|
|
04-24-2020, 08:38 AM
|
#20
|
Human being with feelings
Join Date: Oct 2017
Location: U.K
Posts: 513
|
Quote:
Originally Posted by Stroudy
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.
|
|
|
04-24-2020, 08:50 AM
|
#21
|
Human being with feelings
Join Date: Oct 2017
Location: U.K
Posts: 513
|
Quote:
Originally Posted by tdc
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.
|
|
|
05-14-2020, 02:38 PM
|
#22
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,221
|
Metal fix for this is coming in a +dev build soon!
|
|
|
05-15-2020, 03:43 AM
|
#23
|
Human being with feelings
Join Date: Oct 2017
Location: U.K
Posts: 513
|
Quote:
Originally Posted by Justin
Metal fix for this is coming in a +dev build soon!
|
I bow down to your greatness! thank you thank you thank you
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:36 PM.
|