Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SikCiv

Alpha blending MMX problem

This topic is 6890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im using the MMX alpha blending code supplied in the GameDev code vault, it works on small sprites fine, but when I wanna alpha say two 640x160 surfaces its VERY slow. Ive also tried to fade out the screen using the MMX function on my P2/350 with 128MB and an i740 8MB card with the FPS resulting in around 4FPS ... VERY SLOW! (im using 16bit color) How on earth does games like Abe''s odyssey fade out so FAST????????????????????????????

Share this post


Link to post
Share on other sites
Advertisement
Some games use a palleted display mode which makes it easy.

Some games (Including non-3d games) Will use D3D to do alphablitting and fades, which means it''s usually done in the card itself, which is much faster.

Some other games will use a modified version of alphablending which eliminates the multiplications, which is just for fading 16-bit surfaces.

I would suggest looking at the "Enhanced MMX Alhpa blending" article in the programming section. IT''s very good, and I get 60 fps (Well it always say 59) in every mode that he uses, then again I''m running a PIII 533 w/ Voodoo 3 3000, so I''m not sure how much faster mine is then yours, but even if your computer was have of mine you should still be able to achieve 30fps which is great asuming the thresh-hold of animation is 26 fps. And if you make a modified version of the alpha blending specially for fading you may be able to squeze out a few more fps!

Hope this helps!
See ya,
Ben

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
SikCiv -

I am the Author of the MMX Alpha Blending article on GameDev.net. I''ll bet the reason you get such a low FPS is because you have one or both of your surfaces in video memory. This means the code is ready from Video Memory and this is one of the slowest operations that you can do.

By the way that code has one or two bugs in it. I think one of them has to do with 5-5-5 16bpp mode cards and the other is the calculate of the ALPHA value which causes jitter in the fade.

If you want more help e-mail me at john.hebert@az.rmci.net and I''ll see if I can find the fixed code for you.

Later,
John

Share this post


Link to post
Share on other sites

It would be very cool if you had the time to fix those bugs.....



-- There IS something rotten in the state of Denmark --

Share this post


Link to post
Share on other sites
Thankx John, your''e right, my surfaces were in video memory! Ive set them to load into System memory and the alpha blending is up to scratch but with a few bugs...
1) Some alpha blits are missing the bottom left corner, as if a black triangle has chopped the corner off.
2) Vertical lines appear when the alpha value is low.

John, have u managed to fix these problems yet?
And does this mean the CDX library is buggy as well or have u fixed it?
My game runs in 640x480x16.

Share this post


Link to post
Share on other sites
Hey John - your Alpha-code is really cool, but the TransAlphaMMX-Function does not work on every machine The colors are messed up.
(I hate ATI cards!!!!!)

Edited by - Melo on May 11, 2000 9:38:14 AM

Share this post


Link to post
Share on other sites
CDX does not suffer from these proplems because I used a les s optimized version in that code. Some day I''ll change it to the faster code. I am aware of the problems that some video cards have, it''s a 5-5-5 vs. 5-6-5 problem. When I wrote the code all I had was a 5-6-5 card. Since then I have accuired an ATI 5-5-5 card and debugged that issue. I''ll see if I can polish off the fixed code an post it somewhere. I''ll post a note here when I do.

Later,
John

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

YEAHH!! DO THAT!!!!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

YEAHH!! DO THAT!!!!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!