Archived

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

IndyJones

Muti-Tex and Rendering passes

Recommended Posts

Hi! Following problem in my terrain rendering: I have a Bitmap that contains my shadow-map and alpha-information (blend-map). Now I have 2 other terrain textures (let''s say one snow texture and one grass texture). The alpha-values are 0 at the hill tops and FF in flat areas so I have to render the grass texture with this alpha info and the snow-texture with the inverted alpha info. Now comes my question - is it possible with a maximum of 4 setTextureSS to render this in one pass? Also - in case there are only 2 Texture-Units present I render the terrain in 2 passes but that decreases my fps from around 95 to 50 fps ... is that ok or is there something wrong? Here are my current setTextureSS'':
// set texture stages

setTexture(0, shadow_texture);
setTextureSS(0, COLOROP, SELECTARG1);
setTextureSS(0, COLORARG1, TEXTURE);
setTextureSS(0, ALPHAOP, SELECTARG1);
setTextureSS(0, ALPHAARG1, TEXTURE);

setTexture(1, terrain_texture_green);
setTextureSS(1, COLORARG1, TEXTURE);
setTextureSS(1, COLORARG2, CURRENT);
setTextureSS(1, COLOROP, MODULATE);
setTextureSS(1, ALPHAOP, SUBTRACT);
setTextureSS(1, ALPHAARG1, DIFFUSE);
setTextureSS(1, ALPHAARG2, TEXTURE);

setTexture(2, terrain_texture_snow);
setTextureSS(2, TEXCOORDINDEX, 1);
setTextureSS(2, COLORARG1, TEXTURE);
setTextureSS(2, COLORARG2, CURRENT);
setTextureSS(2, COLOROP, BLENDCURRENTALPHA);
With this code i see the green-texture with the shadow but the snow is not blended in on the top of the hills ... thx for any help!

Share this post


Link to post
Share on other sites