Oct 6, 2014 at 6:12 PM
Edited Oct 6, 2014 at 6:16 PM
Color-keying is an old-school technology, so the modern API doesn't support it with specific APIs.
You can convert color-keyed images to images with an alpha channel, and then you use the standard alpha-blending techniques to do the blending/transparency at runtime. I have a
to include functionality like this in
, but it's also a fairly easy operation to do yourself.
Ideally you do this conversion at build time and not at load time (i.e. only ship textures with alpha and not with color-keying).
DirectX Tool Kit uses premultiplied-alpha by default, but you can use 'straight-alpha' as well. See
for some details on this.
You can also do color-keying with a custom pixel shader, but there's not a lot of value in doing this way unless you have to deal with color-keyed images coming from a user or other source you can't convert ahead of time.