texture quality

could anyone point me to a good tutorial on HLSL texturing. i have a *slight* problem:

sd

[102 byte] By [RalphMorton] at [2007-12-24]
# 1

sorry didnt realise that img tags dont work!

http://www.bout.co.zw/images/texquality.jpg

RalphMorton at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 2
Looks like you are not doing any filtering.

In your shader you will want to setup a sampler state.

Example:

uniform extern float4x4 WorldViewProj : WORLDVIEWPROJECTION;
uniform extern texture UserTexture;

struct VS_OUTPUT
{
float4 position : POSITION;
float4 textureCoordinate : TEXCOORD0;
};

sampler textureSampler = sampler_state
{
Texture = <UserTexture>;
mipfilter = LINEAR;
magfilter = LINEAR;
minfilter = LINEAR;
};
VS_OUTPUT Transform(
float4 Position : POSITION,
float4 TextureCoordinate : TEXCOORD0 )
{
VS_OUTPUT Out = (VS_OUTPUT)0;

Out.position = mul(Position, WorldViewProj);
Out.textureCoordinate = TextureCoordinate;

return Out;
}

float4 ApplyTexture(float2 textureCoordinate : TEXCOORD0) : COLOR
{
return tex2D(textureSampler, textureCoordinate).rgba;
}

technique TransformAndTexture
{
pass P0
{
AlphaBlendEnable = TRUE;
SrcBlend = SRCALPHA;
DestBlend = INVSRCALPHA;
vertexShader = compile vs_2_0 Transform();
pixelShader = compile ps_2_0 ApplyTexture();
}
}

Deis at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...