• Advertisement

Archived

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

Direct3D IM Transparency

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

G''day all, I''m trying to put water over certain tiles. I have managed to do this with blending, but the deal is, I want to make the water MORE transparent in places. Anyone have a code snippet, using d3d IM, that lets me adjust how much I blend my new texture in? I would love to say, like, 10%, 20%, 30% transparency, y''know? THanks in advance. (BTW, here''s what I do to set blend mode right now: LPINSTRUCTION->bOpcode=D3DOP_STATERENDER; LPINSTRUCTION->bSize=sizeof(D3DSTATE); LPINSTRUCTION->wCount=3; .. LPSTATE->drstRenderStateType= D3DRENDERSTATE_ALPHABLENDENABLE; LPSTATE->dwArg[0]=TRUE; ... LPSTATE->drstRenderStateType=D3DRENDERSTATE_SRCBLEND; LPSTATE->dwArg[0]=D3DBLEND_ZERO; ... LPSTATE->drstRenderStateType=D3DRENDERSTATE_DESTBLEND; LPSTATE->dwArg[0]=D3DBLEND_SRCCOLOR; This gives me good blending, but to vary the blending I have to lighten or darken the source image (I.E. blacker pixels in the source image are more transparent, whiter pixels are less). So, without having dozens of unnecessary textures, how could I set it up to give me a variable blend?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement