Jump to content
  • Advertisement
Sign in to follow this  
Zmax

Texture effects

This topic is 4815 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

It is possible somehow to blend 2 textures without using a .fx file?How?Can you pls give me some good tutorials about this topic?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

this tutorial may help you:
Multitexturing in DX6
The things written there can be used in dx9 too, so don't worry ;)

Anyway, have a look at the SetTextureStageState() function in the SDK docs, and read this section of the SDK docs:
dx graphics / programming guide / getting started / d3d textures / texture blending

kp

Share this post


Link to post
Share on other sites
Hi i don't know what to write in the last parameter of the
dev->SetTextureStageState( i, D3DTSS_COLOROP, WHAT IS THIS?); ...
this is how i use 2 textures trying to blend them:

device.SetTexture(0, VertexCls.Texture(0))
device.SetTextureStageState(0, TextureStageStates.ColorOperation, 1)
device.SetTextureStageState(0, TextureStageStates.ColorArgument1, 2)
device.SetTextureStageState(0, TextureStageStates.ColorArgument2, 3)

device.SetTexture(1, VertexCls.Texture(1))
device.SetTextureStageState(1, TextureStageStates.AlphaOperation, 1)
device.SetTextureStageState(1, TextureStageStates.AlphaArgument1, 2)
device.SetTextureStageState(1, TextureStageStates.AlphaArgument2, 3)
do i have to use a special material in on the vertxes, what type ? normaltextured,coloredtextured,positiontextured...i use now positiontextured,..it works for texture blending?

A,...actuly now my shape is complete white...hmm, why?

I want to texturate it only in some specific places with blend, and in the rest normal textured with one texture...


P.S I used this too but no positive effect:

Dim x As TextureArgument
Dim y As TextureOperation

device.SetTexture(0, VertexCls.Texture(0))
device.SetTextureStageState(0, TextureStageStates.ColorOperation, y.Add)
device.SetTextureStageState(0, TextureStageStates.ColorArgument1, x.TextureColor)
device.SetTextureStageState(0, TextureStageStates.ColorArgument2, x.Diffuse)

device.SetTexture(1, VertexCls.Texture(1))
device.SetTextureStageState(1, TextureStageStates.AlphaOperation, y.AddSmooth)
device.SetTextureStageState(1, TextureStageStates.AlphaArgument1, x.TextureColor)
device.SetTextureStageState(1, TextureStageStates.AlphaArgument2, x.Diffuse

[Edited by - Zmax on September 12, 2005 3:59:09 PM]

Share this post


Link to post
Share on other sites
ok, im a bit hazy on this, but i think its how you want the textures to blend( or not to blend ). in fact to quote to docs:

Quote:

D3DTSS_COLOROP
Texture-stage state is a texture color blending operation identified by one member of the D3DTEXTUREOP enumerated type. The default value for the first texture stage (stage 0) is D3DTOP_MODULATE; for all other stages the default is D3DTOP_DISABLE.


it really depends on how you want the textures to blend together. do a serch for D3DTEXTUREOP in the DX help file to find out what they all do.

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!