DX9 vertexshader error X3000: Illegal character in shader file

1.3k views Asked by At

I got an error while compiling my vertexshader.

loadfilefrommemory(water.vs)(44,2): error X3000: Illegal character in shader file

The file is ANSI codec and I created new files many times. And I still get these error with Illegal character. I read much questions but the error just appears on (1, 1) on other questions. So what am I doing wrong?

Here is my File:

//------- Constants --------
float4x4 xView;
float4x4 xProjection;
float4x4 xWorld;
float4x4 xReflectionView;
float4x4 xWindDirection;
float xWaveLength;
float xTime;
float xWindForce;

//------- Technique: Water --------

struct WaterVertexToPixel
{
    float4 Position                 : POSITION;    
    float4 ReflectionMapSamplingPos    : TEXCOORD1;
    float2 BumpMapSamplingPos        : TEXCOORD2;
    float4 RefractionMapSamplingPos : TEXCOORD3;
    float4 Position3D                : TEXCOORD4;
};

WaterVertexToPixel main(float4 inPos : POSITION, float2 inTex: TEXCOORD)
{
    WaterVertexToPixel Output = (WaterVertexToPixel)0;
    float4x4 preViewProjection = mul (xView, xProjection);
    float4x4 preWorldViewProjection = mul (xWorld, preViewProjection);
    float4x4 preReflectionViewProjection = mul (xReflectionView, xProjection);
    float4x4 preWorldReflectionViewProjection = mul (xWorld, preReflectionViewProjection);

    Output.Position = mul(inPos, preWorldViewProjection);
    Output.ReflectionMapSamplingPos = mul(inPos, preWorldReflectionViewProjection);
    Output.RefractionMapSamplingPos = mul(inPos, preWorldViewProjection);
    Output.Position3D = inPos;


     float4 absoluteTexCoords = float4(inTex, 0, 1);
     float4 rotatedTexCoords = mul(absoluteTexCoords, xWindDirection);
     float2 moveVector = float2(0, 1);

     // moving the water
     Output.BumpMapSamplingPos = rotatedTexCoords.xy/xWaveLength + xTime*xWindForce*moveVector.xy;

    return Output;    
}
0

There are 0 answers