@Buch: I didn't call anyone stupid. But just because many people use a certain technique, it does not mean that it's still meaningful or the best possible technique.
It can also mean that people simply see how it has been done and do it the same way without questioning. This is often the case in the real world. For example, how many people learn "C++ programming" from gruesome Win32 API Tutorials?
It may be true that there are still platforms around where color-keying can make sense (certainly not any smartphone, tablet and PC, however), but I would be surprised if that percentage is as high as is the percentage of pink backgrounds here.
Which platform EXACTLY does not support hardware-accelerated alpha transparency? Using a color key is a technique from the 1980s, where no such hardware was available.
If you program a color-key shader today, it needs to discard pixels based on what color you looked up in the texture. This is not only slower than simply using alpha-blending, it also has its own set of problems when the texture is being filtered (you get a mixed color with half magenta in it). No such problems arise when you use alpha-blending.
I don't see how anyone can reasonably argue that color-keying is faster or otherwise superior in some circumstances. If your favorite graphics library doesn't support hardware-accelerated alpha-blending, it has to be out-dated since a long time, plain and simple.
Leaving aside that I cannot really see how minor additional "crispiness" would be noticed in a game with moving graphics - it is largely canceled out by the fact that the rotation is not as smooth as when being able to rotate to any angle, and doing that with filtering.
I don't know SDL, but it seems OpenGL or a higher-level wrapper would be a superior tool then. It is practically available everywhere (also on smartphones) and it is really easy to draw 2D stuff. (I use libgdx on android, which even comes with a sprite renderer).
Very beautiful, thank you.
Very nice, thank you!
@Buch: I didn't call anyone stupid. But just because many people use a certain technique, it does not mean that it's still meaningful or the best possible technique.
It can also mean that people simply see how it has been done and do it the same way without questioning. This is often the case in the real world. For example, how many people learn "C++ programming" from gruesome Win32 API Tutorials?
It may be true that there are still platforms around where color-keying can make sense (certainly not any smartphone, tablet and PC, however), but I would be surprised if that percentage is as high as is the percentage of pink backgrounds here.
Which platform EXACTLY does not support hardware-accelerated alpha transparency? Using a color key is a technique from the 1980s, where no such hardware was available.
If you program a color-key shader today, it needs to discard pixels based on what color you looked up in the texture. This is not only slower than simply using alpha-blending, it also has its own set of problems when the texture is being filtered (you get a mixed color with half magenta in it). No such problems arise when you use alpha-blending.
I don't see how anyone can reasonably argue that color-keying is faster or otherwise superior in some circumstances. If your favorite graphics library doesn't support hardware-accelerated alpha-blending, it has to be out-dated since a long time, plain and simple.
Leaving aside that I cannot really see how minor additional "crispiness" would be noticed in a game with moving graphics - it is largely canceled out by the fact that the rotation is not as smooth as when being able to rotate to any angle, and doing that with filtering.
I don't know SDL, but it seems OpenGL or a higher-level wrapper would be a superior tool then. It is practically available everywhere (also on smartphones) and it is really easy to draw 2D stuff. (I use libgdx on android, which even comes with a sprite renderer).
Of course, everything I say is just my opinion.