Archived

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

IndyJones

Problem with Multi-tex

Recommended Posts

IndyJones    298
Hi! I've a problem with my multi-texturing: I have one texture (tex) that is loaded from a dds (256x256 in size - snow look). Now I have a self-created shadow-texture (shadow_texture) that also contains alpha information to blend other terrain textures - the shadow-texture is created as follows: (shadowmap and blendmap are byte arrays, hm_size is the terrain widht/height)
shadow_texture = renderDevice->createTexture(256, 256, POOL_MANAGED, USAGE_DEFAULT, FORMAT_A8R8G8B8);


uint32 pitch_diff = 0;
D3DCOLOR *sm = (D3DCOLOR*)shadow_texture->lock(pitch_diff);

pitch_diff = (pitch_diff / 4) - shadow_texture->getWidth();

for(uint32 i = 0, k = 0; i < hm_size; i++, k+= pitch_diff)
	for(uint32 j = 0; j < hm_size; j++, k++)
		sm[k] = ARGB(blendmap[(i * hm_size) + j], shadowmap[(i * hm_size) + j], shadowmap[(i * hm_size) + j], shadowmap[(i * hm_size) + j]);

shadow_texture->unlockTexture();
  
and here are my setTextureSSs:
setTexture(0, shadow_texture);
setTextureSS(0, COLOROP, SELECTARG1);
setTextureSS(0, COLORARG1, TEXTURE);
setTextureSS(0, ALPHAOP, SELECTARG1);
setTextureSS(0, ALPHAARG1, TEXTURE);
	
setTexture(1, tex);
setTextureSS(1, TEXCOORDINDEX, 0);
setTextureSS(1, COLORARG1, TEXTURE);
setTextureSS(1, COLORARG2, CURRENT);
setTextureSS(1, COLOROP, MODULATE);
setTextureSS(1, ALPHAOP, BLENDCURRENTALPHA);
setTextureSS(1, ALPHAARG1, CURRENT);
setTextureSS(1, ALPHAARG2, TEXTURE);

setTextureSS(2, ALPHAOP, DISABLE);
setTextureSS(2, COLOROP, DISABLE);
  
Now the problem: All i can see is the shadow_texture texture ... nothing from the tex texture ... but i don't know why ... I checked the alpha-values from the shadow_texture and they are mostly 0xFF so I should see something from the 2nd texture ... but I do not ... maybe I'm just missing a SetRenderState?? Thx for any help! EDIT: ARGH!! Very very stupid mistake ... sorry for wasting your time guys! [edited by - BrooksWackerman on August 7, 2003 7:56:35 AM]

Share this post


Link to post
Share on other sites