myTexture = ResourceCache.GetGlobalInstance().CreateTextureFromFile(dev, "..\\..\\Textures\\myTexture.tga");
and
myTexture =
TextureLoader.FromFile(dev, "..\\..\\Textures\\\\myTexture.tga",1024,1024,0,0,Direct3D.Format.A8R8G8B8, Pool.Managed, Filter.Linear, Filter.Linear, 0);both give the same result. With the second form I have played around with mipmap levels and filters but nothing I've tried seems to fix it.
I've coded exactly the same kind of thing in openGL and never had this problem. I must be missing something.
Also, in general what are the best filters to use for textures (I know it will depend on use) and how can you tell what settings the first texture loading example above will set by default. It doesn't seem to be documented anywhere. Nor for the default version of the second statement.
Any help would be much appreciated.

Textures flickering
bibber
The other thing this might be is Z-fighting. As polygons get further from the viewer, the Z precision decreases, so you may be getting problems there. Try turning the Z buffer off (D3DRS_ZENABLE to false). IF that produces more consistent results (even if they're wrong!) then you need to start looking at your Z precision.
Arash Bannazadeh
Do you have any multi-pass or general blending involved any depth or stencil testing
Regarding the texture filtering parameters - they're D3DX specific. Basically, if the texture in your file is NOT the same size as you requested then D3DX will resize it accordingly, and in doing so will use the specified filter. It's nothing to do with rendering - that's handled by the sampler states.
The best rendering filter does depend on what you're using... LINEAR is generally a good all-rounder, but starts to fail (looks very blurry) when the scaling is greater than 2x. Anisotropic usually gives good results - but seems to be more dependent on the underlying hardware.
hth
Jack
Andrew Arnott - MSFT
As I mentioned in my previous post, changing the Filter.Linear part of the TextureLoader changes how *D3DX* will do stuff, not how the actual rendering works
I find it hard to get anywhere with the MDX documentation, but I think the following is what you want:
device.SetSamplerState( 0, SamplerStageStates.MinFilter, TextureFilter.Linear );
device.SetSamplerState( 0, SamplerStageStates.MagFilter, TextureFilter.Linear );
device.SetSamplerState( 0, SamplerStageStates.MipFilter, TextureFilter.Linear );
Looking in the docs, those will all be set to TextureFilter.None by default. Could well be that those three lines will solve the whole thing for you....
hth
Jack
rusha
I wish there was a managed directx text that was something like the awsome openGL super Bible (don't remember the author). Or even just adequate explanations of all the functions would be good.
Thanks again Jack
ivolved
device.RenderState.ZBufferEnable =
false;but I still have the same problem. When you suggest setting the MIPFILTER to LINEAR do you mean as in
myTexture =
TextureLoader.FromFile(dev, "..\\..\\Textures\\myTexture.tga",1024,1024,0,0,Direct3D.Format.A8R8G8B8, Pool.Managed, Filter.Linear, Filter.Linear, 0);or is there somewhere elase that I need to set this as well
I am using alpha blending and the scene is depth sorted which is why I don't really need the depth buffer for these sprites.
Here are the render states that I am using:
device.RenderState.CullMode =
Cull.None;device.RenderState.Lighting = true;
device.RenderState.ZBufferEnable = false;
device.RenderState.AlphaBlendEnable = true;
device.RenderState.SourceBlend = Blend.SourceAlpha;
device.RenderState.DestinationBlend = Blend.InvSourceAlpha;
The textures are stored as 32 bit tga files.