I tried to convert the shader to HLSL but it doesn't work.... the engine starts and close without a message. => crash?

what's wrong?

here is my prototype shader:

Code:

//--------------------------------------------------------------
// Texture Projection Shader
//
// by zSteam
// -------------------------------------------------------------

float4x4 matWorldViewProj;
float4x4 matMtl;

float4 range = {0.01f, 0.5f, 0.05f, 0.0f};
float tps;

struct VS_OUTPUT
{
float4 oPos : POSITION;
float2 Tex0 : TEXCOORD0;
float2 Tex1 : TEXCOORD1;
};

VS_OUTPUT mainVS( float4 oPos : POSITION, float2 Tex0 : TEXCOORD0, float2 Tex1 : TEXCOORD1 )
{
VS_OUTPUT Out = (VS_OUTPUT) 0;

Out.oPos = mul(oPos, matWorldViewProj);

tps = mul(oPos, matMtl);
tps = tps * range.x;
tps = (tps * range.yyyy) + range.yyyy;

Out.Tex0.xy = tps.xy;
Out.Tex1.xy = Tex0.xy;

return Out;
}

texture entSkin1;
texture mtlSkin1;

sampler ColorMapSampler = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp; // don't wrap around edges
AddressV = Clamp; // don't wrap around edges
};

sampler ProjTex = sampler_state
{
Texture = <mtlSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp; // don't wrap around edges
AddressV = Clamp; // don't wrap around edges
};

float4 mainPS(float2 Tex : TEXCOORD0) : COLOR
{
Color = ColorMapSampler * ProjTex;
return Color;
}

technique projector
{
pass p0
{
zWriteEnable=true;
VertexShader = compile vs_1_1 mainVS();
PixelShader = compile ps_1_1 mainPS();
}
}




=> www.alrik-online.de
A7 Commercial