Sign in to follow this  
hserver

SetTextureStageState

Recommended Posts

hi i have a problem about blending these picture that have also alpha channel body.tga : 3 body.tga alpha : 1 effect.tga: Photobucket effect.tga alpha : Photobucket I want to blend them to reach this picture as a result( white color is actually transparent) : 2 I perform this TextureStageState Init_HelperPLane D3DDevice.SetTexture 0, bodytexture D3DDevice.SetTexture 1, effecttexture D3DDevice.SetVertexShader FVF_VERTEX D3DDevice.SetRenderState D3DRS_LIGHTING, False D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA D3DDevice.SetRenderState D3DRS_ALPHABLENDENABLE, 1 D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 'D3DTOP_SELECTARG1 D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG1, D3DTA_TEXTURE D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG2, D3DTA_CURRENT D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAOP, D3DTOP_MODULATE D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG2, D3DTA_CURRENT D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE D3DDevice.SetTextureStageState 1, D3DTSS_COLOROP, D3DTOP_SELECTARG2 D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG1, D3DTA_TEXTURE D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG2, D3DTA_CURRENT D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TestPlane(0), Len(TestPlane(0)) but i can't get proper result . what is my mistake?

Share this post


Link to post
Share on other sites
i have disabled it in my own code. i dont know how to explain my result (maybe that need another pic)

i'm wonder this code should only render "effect.tga" but it doesn't work either :

D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT
D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG2, D3DTA_CURRENT


D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG2, D3DTA_CURRENT
D3DDevice.SetTextureStageState 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG2, D3DTA_CURRENT

Share this post


Link to post
Share on other sites
Quote:
Original post by hserver
i'm wonder this code should only render "effect.tga" but it doesn't work either :

D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT
D3DDevice.SetTextureStageState 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 0, D3DTSS_COLORARG2, D3DTA_CURRENT


D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 1, D3DTSS_ALPHAARG2, D3DTA_CURRENT
D3DDevice.SetTextureStageState 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1
D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG1, D3DTA_TEXTURE
D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG2, D3DTA_CURRENT
It should I think, yes. What do you mean it "doesn't work"? Does it render incorrect results? If so, what? Does it fail to render anything? Does it crash? Does it set your PC aflame?

Share this post


Link to post
Share on other sites
it doesn't work means it render incorrect results
it doesn't work don't mean it fail to render anything
it doesn't work don't mean it crash
and finally it doesn't work don't mean it set my PC aflame
(sorry)

Namethatnobodyelsetook bingo! one line of code make my dream come ture
you are my man!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this