Jump to content
  • Advertisement
Sign in to follow this  
Baf

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.

If you intended to correct an error in the post then please contact us.

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 this post


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

Share this post


Link to post
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 this post


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

Share this post


Link to post
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 this post


Link to post
Share on other sites
Original post by Baf
ok i trie
lines6ed.jpg>

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!