Original Post
hi , i just wrote a code to see if i understood the multi-texturing stuff. so i told directx to select the texture0 (fire_tex) into stage0 without changes , and then to select texture1(wall_tex) into stage1 without changes , so what i should get is texture1 rendered on the polygon , no? for some reason its corrupted, and the result looks like directx duplicated the first pixel of texture1(wall_tex) over the whole polygon istead of mapping the whole texture over the polygon... its strange... , coz it happens just when im selecting texture1 into stage 1 with D3DTSS_COLOROP = D3DTOP_SELECTARG1, however , when im selecting texture0 (D3DTSS_COLOROP = D3DTOP_SELECTARG2)into stage 1 its working probably.
thats the code that doesnt work:
display.SetRenderTexture(&fire_tex,0);
display.SetRenderTexture(&wall_tex,1);
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
display.ReturnDevice()->SetTextureStageState(2,D3DTSS_COLOROP,D3DTOP_DISABLE);
display.ReturnDevice()->SetTextureStageState(2,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
DWORD dwNumPasses = 2;
display.ReturnDevice()->ValidateDevice( &dwNumPasses );
and that one will work:
display.SetRenderTexture(&fire_tex,0);
display.SetRenderTexture(&wall_tex,1);
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
display.ReturnDevice()->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
display.ReturnDevice()->SetTextureStageState(2,D3DTSS_COLOROP,D3DTOP_DISABLE);
display.ReturnDevice()->SetTextureStageState(2,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
DWORD dwNumPasses = 2;
display.ReturnDevice()->ValidateDevice( &dwNumPasses );
anyone have any suggestions?
[edited by - xeno on March 13, 2003 9:04:58 PM]
[edited by - xeno on March 13, 2003 9:05:46 PM]