Sign in to follow this  
FortisVenaliter

fxc looking for main()?

Recommended Posts

When compiling my shader, I get the following error when compiling with fxc.exe: error X3501: 'main': entrypoint not found When even google failed me n this topic, I decided to post here. Anyone know how to fix this? What causes it?
int numLights;

float  lengths[32];
float2 positions[32];

bool perPixelLighting = false;

float2 camPos;

texture tex : Diffuse
<
    string ResourceName = "rgbcheck.bmp";
>;
sampler TextureSampler = sampler_state
{
    Texture = (tex);
    MinFilter = linear;
    MagFilter = linear;
    MipFilter = linear;
    AddressU = mirror; 
    AddressV = mirror;
};

struct VertexIn
{
    float2 pos : POSITION;
    float2 texCoord : TEXCOORD0;
    float4 color : COLOR0;
};
struct VertexOut
{
    float4 pos : POSITION;
    float2 texCoord : TEXCOORD0;
    float2 wPos : TEXCOORD1;
    float4 color : COLOR0;
};
struct PixelIn
{
    float2 texCoord : TEXCOORD0;
    float2 wPos : TEXCOORD1;
    float4 color : COLOR0;
};

VertexOut VertexShaderFunction(VertexIn inval)
{
	VertexOut outval = (VertexOut)0;
	outval.wPos = inval.pos;
	outval.pos = float4((inval.pos-camPos).xy,0,0);
	outval.texCoord = inval.texCoord;
	outval.color = inval.color;
}

float4 PixelShaderFunction(PixelIn inval) : COLOR0
{
    float4 color = tex2D(TextureSampler, inval.texCoord);
    float litval = 1;
    return float4(color.rgb*litval,color.a);
}

technique Lighter
{
    pass pass0
    {
	VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}

Share this post


Link to post
Share on other sites
You need to specify what you want compiled. For example:

fxc /T fx_2_0 file.fx
Will compile the entire file with vs and ps 2.0.

fxc /T ps_2_0 /E PixelShaderFunction file.fx
Will compile PixelShaderFunction with ps 2.0.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this