Jump to content
  • Advertisement
Sign in to follow this  
strahan

Texture Blending Problem (with screenshots)

This topic is 5237 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 am experimenting with how to blend textures together. Using the DirectX MFCTex tool I get this result: When I copy the source they generate and try it out myself the resulting image appears "blocky" and not smooth: Any ideas why my blending does not come out smooth like it does in the MFCTex tool? My vertices are defined as and the block I texture is a simple quad:
public struct MyVertex
{
	public float    X,Y,Z;
	public Int32	dwDiffuse;
	public float    Tu1,Tv1;
	public float    Tu2,Tv2;
}

Thanks in advanced.

Share this post


Link to post
Share on other sites
Advertisement
You need to enable bilienear filtering for that stage:

pDevice->SetTextureStageState(stage with that texture, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
pDevice->SetTextureStageState(stage with that texture, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);

You probably don't need it for minification, but magnification definitely.

edit: Oops, I didn't notice you were using C#. I don't know C#, but search for the filtering properties in the managed documentation.

Share this post


Link to post
Share on other sites
Ah, great!!

I found in C# you have to call SetSamplerState() instead of SetTextureStateStage():

_DXDevice.SetSamplerState(0, SamplerStageStates.MinFilter, (int)TextureFilter.Linear);
_DXDevice.SetSamplerState(1, SamplerStageStates.MagFilter, (int)TextureFilter.Linear);

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!