Archived

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

copying texture data, excluding certain color values

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

LockRect().

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
is there a function to handle masked/color-keyed writing to a texture? i can''t seem to find it in the sdk.. i''m using copyrects now, its made for just copying the entire data.

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
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Nope.
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)

[edit]
Damn! Beat me by 3 seconds!
[/edit]

Steve
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