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


copying texture data, excluding certain color values

Recommended Posts


Though if you''re trying to mask out colour components (such as R, G or B), a better way would be to use a sequence of DOTPRODUCT3 texture operation with render to texture. Or even the colour write/mask operations (where supported in hardware).

Share this post

Link to post
Share on other sites
1. Colour keys are very much depreciated. Most hardware never actually did them natively anyway.

2. If it''s just straight masking of pixels, use an alpha channel. Works great, works everywhere, and is actually what many cards were doing for colourkeys anyway.

3. Function, no. Though a renderstate, yes: D3DRS_COLORWRITEENABLE

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites
All a texture is, is a pile of DWORD values (assuming a 32-bit texture). You have to write your own function to mask out certain values, or do as Simon suggested with the render to texture.

Simon: How doues that work exactly anyway? I looked up the DotProduct3 sample, and from what i can gather it does a N.L with the normal in the texture and the light direction (from the cursor position)

Damn! Beat me by 3 seconds!

DirectX Programmer
Soon to be the new Bill Gates

[edited by - Evil Bill on July 18, 2002 1:50:28 PM]

[edited by - Evil Bill on July 19, 2002 1:00:23 PM]

Share this post

Link to post
Share on other sites