flat assembler
Message board for the users of flat assembler.
Index
> MenuetOS > Alpha blend 32 |
Author |
|
Bondy 29 Nov 2005, 03:26
Created a raw image with an Alpha channel i.e. 32bpp had to do this by hand unfortunately.
using the same equation subroutine this is the result Corrected a mistake new source & binary sorry
Last edited by Bondy on 29 Nov 2005, 21:29; edited 2 times in total |
|||||||||||
29 Nov 2005, 03:26 |
|
Bondy 29 Nov 2005, 21:36
Madis731
tried your code couldnt get it to work with any colour but blue dont know why but I did find a problem with my stuff while I was checking so Ive posted new code above. hope you can see what the problem is |
|||
29 Nov 2005, 21:36 |
|
Bondy 30 Nov 2005, 02:49
Madis731 sorry Dude fixed it myself and saved two movq's
Code: AlphaBlendMMX: movd mm0,eax ; 0RGB movd mm1,ebx ; 0RGB movd mm2,ecx ; 000A punpcklwd mm2,mm2 ; 00000A0A punpcklwd mm2,mm2 ; 0A0A0A0A pxor mm3,mm3 ; 00000000 punpcklbw mm0,mm3 ; 000R0G0B punpcklbw mm1,mm3 ; 000R0G0B psubw mm0,mm1 ; Fore-Back pmullw mm0,mm2 ; (Fore-Back)*A psraw mm0,8 ; (Fore-Back)*A/256 paddw mm0,mm1 ; (Fore-Back)*A/256+Back ; 000R0G0B packuswb mm0,mm0 ; 0RGB0RGB movd eax,mm0 ; 0RGB ret See Attached I call it Alpha on the move |
|||
30 Nov 2005, 02:49 |
|
Madis731 30 Nov 2005, 07:45
I'm glad to hear you got it working. I can't get the first one working under 64-bit version, but later I will test it on a 32-bit one. The second attachment is dead (I don't know why)
|
|||
30 Nov 2005, 07:45 |
|
Bondy 01 Dec 2005, 06:57
Here it is again
|
|||||||||||
01 Dec 2005, 06:57 |
|
Madis731 01 Dec 2005, 09:48
Nice implementation!
I love that it is about two times shorter (the blending code), but did it give any speed advantages? I'm sorry, but I still haven't reached testing it. Weekend is coming, though EDIT: Ok, hmm, seems rather optimal to me. 18MHz on a 3Gig machine, I saw from the code that the delay is 50ms so (20FPS) 1 pass takes about 900kHz (just under million clocks). I expect even lower values from Pentium III - I'll let you know. |
|||
01 Dec 2005, 09:48 |
|
Bondy 01 Dec 2005, 15:06
Sorry found another problem with MMX code because the maths is done in 16bpp it causes errors if you increase the alpha value above a certain point.
try an alpha value of 255 to see what I mean. original code works but I agree it would be nice to have an optimized version. |
|||
01 Dec 2005, 15:06 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.