Archived

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

Dirge

Texture + Vertex Color = Seperate

Recommended Posts

I''m trying to apply a texture to a 3d model that is made up of many different colored vertices. I want the colored vertices to remain their color (and not be textured) in the area''s where the texture has an alpha of 0. The problem is, with the normal texture states, it actually doesn''t draw parts of the model (with the low alpha). Anyone have suggestions on how to have it so it only doesn''t show the texture, but still shows the geometry when using textures with Alpha (I''ve tried a bunch of texture states with no luck. Is it possible to do it with texture states?). Thanks! "Love all, trust a few. Do wrong to none." - Shakespeare Dirge - Aurelio Reis www.CodeFortress.com Current Causes: Nissan sues Nissan

Share this post


Link to post
Share on other sites
You can use the D3DTOP_BLENDTEXTUREALPHA as D3DTSS_COLOROP. This will change between the texture and the diffuse according to the alpha of the texture.
However, I didn''t know whether you wanted the texture to be also modulated by the diffuse when alpha is not 0 or not. If so, you have to use two stages. Leave the first stage as D3DTOP_MODULATE and use D3DTOP_BLENDCURRENTALPHA for the second stage to blend between D3DTA_CURRENT and D3DTA_DIFFUSE.


My site

Share this post


Link to post
Share on other sites
Not totally clear on the exact effect you are looking for but I find when designing texture states to cause a certain affect that using the MFC Texture sample with the SDK helps a lot, it even generates the code for you.

Share this post


Link to post
Share on other sites