Help me with multitexturing

This topic is 4822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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!!!

Share on other sites
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.

Share on other sites
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

Share on other sites
i think the problem isn't the sampler. how can i eliminate the lines in the rendering?

Share on other sites
I'm not sure what you mean with "lines in the rendering". Maybe you could post a screenshot?

Share on other sites
i dont know how to post images...

Share on other sites
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

Share on other sites
Original post by Baf
ok i trie
>

[Edited by - Baf on August 31, 2005 10:30:42 AM]

Share on other sites
Quote:
 Original post by Bafok i trie>

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]

Share on other sites
thanks a lot

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

1. 1
Rutin
22
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• Forum Statistics

• Total Topics
633307
• Total Posts
3011290
• Who's Online (See full list)

There are no registered users currently online

×