Original Post
I''m having some problems with using multiple texture stages. I created two textures. In stage 0, I am modulating the first texture with the diffuse color of the verticies. That part works fine, but then I want to use stage 1 to modulate the color with the color of another texture. That''s where I get stuck. The second texture has not effect.
Here''s a list of all of the troubleshooting that I did.
Both of my textures were created ok, because they both work when tested individually in stage 0.
I checked the device caps
MaxTextureBlendStages is 8
MaxSimultaneousTextures is 2
My custom vertex definition looks like this
D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE|D3DFVF_TEX2|
D3DFVF_TEXCOORDSIZE2(0)|D3DFVF_TEXCOORDSIZE2(1)
I have added the 2nd set of texture coordinates and given them values for each point of my triangle. I used the values (0,0) (1,0) and (1,1).
I made sure that the textures are on input 1 of each texture stage (because some cards require this)
I used SetTexture to load my first texture into stage 0 and my second one into stage 1.
I set input 1 of texture stage 1 to D3DTA_TEXTURE and input 2 of texture stage 1 to D3DTA_CURRENT. Then I selected D3DTOP_SELECTARG1 for the color op on stage 1 (just to test to see if my texture is making it into texture stage 1)
This is where the problem comes up. When I use SELECTARG1, the output is just white. Obviously my texture didn''t make it into texture stage 1, but I don''t know why. If I set texture stage1 to D3DTOP_SELECTARG2, the first texture that is being modulated by the diffuse color is "passed through" correctly.
I am using the alpha values from the textures.
I disabled the color and alpha for texture stage 2 (since I am only using stages 0 and 1)
I tested my textures in MFCTex and it works.
I tested my app with the reference device and it still doesn''t work.
Can anyone else think of anything that I missed?