# Why i can not load a simple pixel shader effect (. fx) file in xna?

I just want to load a simple *.fx file into my project to make a (pixel shader) effect.

But whenever I try to compile my project, I get the following error in visual studio Error List:

Errors compiling ..
ID3DXEffectCompiler: There were no techniques
ID3DXEffectCompiler: Compilation failed


I already searched on google and found many people with the same problem. And I realized that it was a problem of encoding. With the return lines unrecognized '\ n' .

I tried to copy and paste to notepad and save as with ASCII or UTF8 encoding. But the result is always the same.

Do you have an idea please ? Thanks a looot :-)

Here is my [.fx] file :

sampler BaseTexture : register(s0);
{
};

//All of these variables are pixel values
//Feel free to replace with float2 variables
float BaseTextureLocationX;  //This is where your texture is to be drawn
float BaseTextureLocationY;  //texCoord is different, it is the current pixel
float BaseTextureWidth;
float BaseTextureHeight;

float4 main(float2 texCoord : TEXCOORD0) : COLOR0
{
//We need to calculate where in terms of percentage to sample from the MaskTexture
float maskPixelX = texCoord.x * BaseTextureWidth + BaseTextureLocationX;
float maskPixelY = texCoord.y * BaseTextureHeight + BaseTextureLocationY;

float4 tex = tex2D(BaseTexture, texCoord);

//It is a good idea to avoid conditional statements in a pixel shader if you can use math instead.
//Alternate calculation to invert the mask, you could make this a parameter too if you wanted
//return tex * (1.0 - bitMask.a);
}