YellowShadow

I have just compiled DeadJustice. It is a game using the catmother engine (http://www.sf.net/projects/catmother). From the forums I downloaded the version that supports Visual Studio 2005, once I compile and run it, it gives me an error and says that lightmap.fx is not compatible or something. I am using the version of DirectX before February 2007. Can anyone help me The shader code is below. If you want the exact error, I'll give it too you.

Thanks.

[code]
//
// lightmap shader without transparency
//
// diffuse texture * lightmap texture
//
// COLUMN MAJOR MATRICES
//


// --------------------------------------------
// Input parameters
// --------------------------------------------

// transforms
float4x4 mWorld; // model->world tm
float4x4 mTotal; // model->world->view->projection tm

// texture resources (from 3dsmax)
texture tDiffuse;
texture tLightMap;

// constants
float FRESNEL_R0 = 0.1;
//float FRESNEL_MIN = 0;
float FRESNEL_MIN = 0.2;
float FRESNEL_MAX = 0.5;
float3 AMBIENT_COLOR = float3(0.25,0.25,0.4);
float3 DIFFUSE_COLOR = float3(0.4,0.4,0.45);


// --------------------------------------------
// Data formats
// --------------------------------------------

struct VS_INPUT
{
float3 pos : POSITION;
float3 normal : NORMAL;
float2 tc0 : TEXCOORD0;
float2 tc1 : TEXCOORD1;
};

struct VS_OUTPUT
{
float4 pos : POSITION;
float2 tc0 : TEXCOORD0;
float2 tc1 : TEXCOORD1;
};

struct PS_OUTPUT
{
float4 col : COLOR0;
};


// --------------------------------------------
// Texture samplers
// --------------------------------------------

sampler diffuseSampler = sampler_state
{
Texture = (tDiffuse);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
};

sampler lightmapSampler = sampler_state
{
Texture = (tLightMap);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
};


// --------------------------------------------
// Vertex shaders
// --------------------------------------------

VS_OUTPUT lightmapVS( const VS_INPUT v )
{
VS_OUTPUT o = (VS_OUTPUT)0;

// transform vertex position
o.pos = mul( mTotal, float4(v.pos,1) );

o.tc0 = v.tc0;
o.tc1 = v.tc1;
return o;
}


// --------------------------------------------
// Pixel shaders
// --------------------------------------------

float4 lightmapPS( VS_OUTPUT p ) : COLOR
{
float4 texc = tex2D( diffuseSampler, p.tc0 );
float3 lmapc = tex2D( lightmapSampler, p.tc1 );
return float4( texc.xyz*lmapc, texc.w );
}


// --------------------------------------------
// Techniques
// --------------------------------------------

technique T0
{
pass P0
{
VertexShader = compile vs_1_1 lightmapVS();
PixelShader = compile ps_1_1 lightmapPS();
}
}
[/code]



Re: Game Technologies: DirectX 101 Need help running this game.

Jim Perry

Do you have a video card that supports Shader Model 1.1 (as that's what it's trying to use)




Re: Game Technologies: DirectX 101 Need help running this game.

YellowShadow

How can I check. I have a ATI Radeon 1300+. I think I have Shader Model 1.1

I think its a compiling issue becuase the version I download from the SF page works. I know that, that version was compiled with Summer 2003 (or 2004 ). Is that the problem





Re: Game Technologies: DirectX 101 Need help running this game.

ProfEclipse

The new HLSL compiler requires a special compatibility switch to support pre-2.0 shaders. I can't remember the option off the top of my head, but it's documented in the SDK.





Re: Game Technologies: DirectX 101 Need help running this game.

nordwindranger

I've got the x1300 graphics card as well. I've had no problem usin shader model 2.0, and I believe it also supports sm 3.0




Re: Game Technologies: DirectX 101 Need help running this game.

YellowShadow

So what should I do to get this to work





Re: Game Technologies: DirectX 101 Need help running this game.

ProfEclipse

Why don't you try posting in the catmother forums They may already have a solution for this.





Re: Game Technologies: DirectX 101 Need help running this game.

YellowShadow

The catmother forums are on the sf page, and it takes years for someone to reply. I'll try though.