• Advertisement

Archived

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

Color keying, help anyone??

This topic is 6005 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

Does color keying only work for back buffer formats with an alpha channel? The DX8 caps viewer says my video card only supports R5G6B5, and X8R8G8B8. When I use D3DXLoadSurfaceFromSurface for example, and use color keying, my color keyed color comes out opaque black, not transparent black! Is there a way so that perhaps I could write to a temporary surface made with A8R8G8B8 and then copy to my back buffer to get the transparency effect? Some insight would be Greatly appreciated, thanks! - Shane

Share this post


Link to post
Share on other sites
Advertisement
I think it is possible to load the bitmap, create a A8R8G8B8-Texture of the same size, lock it and copy the pixels manually, while testing them. If they match your colorkey, make alpha 0x00, else make it 0xFF. Then you can get rid of the original texture and use the new one, which should be transparent at the pixels with alpha 0x00

Share this post


Link to post
Share on other sites
Thanks for your help. Yeah my image is coming from a surface, so I guess I can get a pointer to the data and do some manual copying, though that is unfamiliar territory for me... I''ll see how it goes.

I was just wondering, I thought that setting the alpha testing state was optional, just a speed optimization because it did a pre-emptive test to see if it needed to calculate the alpha-blending per pixel.

Well, if anyone has had success with color keying (in DX8), perhaps you could reply to this post and also include what backbuffer format you were using (A8R8G8B8, etc.)

Thanks!

- Shane

Share this post


Link to post
Share on other sites

  • Advertisement