Help me with multitexturing

Started by
13 comments, last by Baf 18 years, 7 months ago
I have two textures at stages 0 and 1. one is a jpg and the other is a greyscale created texture that represents the shadows. I want to blend them togheter to have colors and shadows at the same time. I dont know how to set the stage state... Help me!!!
Baffo"role-game needs a table"
Advertisement
Hi there Baf,
How are you doing?

The Problem
Setting texture stages to modulate between the 2 textures that you have loaded into different stages.

The Solution
pDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);pDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);pDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);pDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);pDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);


Basically what thise does is gets the color from each texture and modulates between them. Modulate meaning, adapt, alter, change, transform or revise.

I hope this helps a bit. If anyone has some other suggestions or a little more insight as to the operation of TextureStageStates this will be a great opportunity to explain them in detail.
Thank you very much Armadon it works very well!!
Now i need to filter with setting sampler state...
Which is the best way?
i tried with

Device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
Device->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);

but i see to many lines on the screen
Baffo"role-game needs a table"
i think the problem isn't the sampler. how can i eliminate the lines in the rendering?
Baffo"role-game needs a table"
I'm not sure what you mean with "lines in the rendering". Maybe you could post a screenshot?
i dont know how to post images...
Baffo"role-game needs a table"
Upload a screenshot(taken with the printscreen button) in Imageshack.us and then post that picture here with the <*img src="the internet adress of the image wich you got from imageshack"*> Without the *'s of course
Hope I was helpful. And thank you if you were!
Original post by Baf
ok i trie
lines6ed.jpg>

[Edited by - Baf on August 31, 2005 10:30:42 AM]
Baffo"role-game needs a table"
Quote:Original post by Baf
ok i trie
lines6ed.jpg>

Good attempt, but like Samsonite pointed out, you only need:

<img src="http://img256.imageshack.us/img256/1552/lines6ed.jpg">

which should lead to this result:



[smile]
thanks a lot

hi there, i ask help for the two dark lines that appear after
the tex blending... someone could?

Baffo"role-game needs a table"

This topic is closed to new replies.

Advertisement