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

Reply
 
Thread Tools Display Modes
Old 09-11-2022, 06:02 PM   #1
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 577
Default video processor: gfx_fillrect() erratic behavior in some transparency contexts(fixed)

gfx_fillrect() seems to be confusing the roles of gfx_a and gfx_a2. Let suppose we have a track with an image item and we gfx_fillrect() a rectangle with a gradual envelope on gfx_a (0->1) and gfx_a2=1. If we gfx_blit() this track on top of another one using mode 0x10000, the part covered by gfx_fillrect() will do weird jumps in transparency with a partial mix of gfx_a2 transparency. In non-transprency mode, there is no problem (obviously). I made a project to illustrate the problem which includes gfx_blit() and gfx_fillrect() emulations made with gfx_evalrect() which do behave correctly.

https://stash.reaper.fm/45284/fillrect_erratic.zip




p.s. I was using v6.66 on win10 but I have encountered this problem months ago before I understood properly how alpha works


*** UPDATE 2022-10-24: I confirm, it has been fixed in v6.69 ****

Last edited by papagirafe; 10-24-2022 at 05:13 PM. Reason: new Reaper v6.69 fix
papagirafe is offline   Reply With Quote
Old 09-14-2022, 07:43 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,346
Default

ah yes, there is a bug in the alpha handling of LICE_FillRect() which causes it to write the alpha value rather than the pixel's alpha value. Fixing, though this might be some time before it goes into a release because it could break appearances subtly. Thanks for the report!

Last edited by Justin; 09-14-2022 at 07:49 PM.
Justin is offline   Reply With Quote
Old 09-15-2022, 03:54 AM   #3
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 577
Default

Quote:
Originally Posted by Justin View Post
ah yes, there is a bug in the alpha handling of LICE_FillRect() which causes it to write the alpha value rather than the pixel's alpha value. Fixing, though this might be some time before it goes into a release because it could break appearances subtly. Thanks for the report!
Thanks for looking at it! I am sure there are lots video projects that have been patched around this bug (even in mines wihout inderstanding why). At least in contexts where it causes a problem, we can use its evalrect() emulation.

Code:
//gfx_fillrect() emulation for proper transparency behavior
gfx_set(r,g,b,a1,mode,dest,a2);
gfx_evalrect(x,y,w,h,"r=r*(1-gfx_a)+gfx_a*gfx_r*255;g=g*(1-gfx_a)+gfx_a*gfx_g*255;b=b*(1-gfx_a)+gfx_a*gfx_b*255;a=gfx_a2*255");

Last edited by papagirafe; 09-15-2022 at 03:38 PM. Reason: add mitigation code
papagirafe 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 12:01 AM.


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