I've been using fx files with my models, but I decided to add a few more variables and now it won't load. I'm not using any shaders or HLSL, I just want to change a few render states. I think it's probably the variable names I've chosen, although I don't know what the correct ones would be. Most reference information just shows how to use shaders and the rest just recomends using FX composer, but it crashes because of some "Plugin Creation Error". I think that's to do with my driver or graphics gard being too old. Anyway, here's the effect file that works:
texture texture0;
float4 diffuse0;
technique ModelExObject
{
pass p0
{
Texture[0] = <texture0>;
MaterialDiffuse = <diffuse0>;
Lighting = TRUE;
ColorVertex = FALSE;
CullMode = NONE;
ZEnable = TRUE;
ZWriteEnable = TRUE;
DitherEnable = TRUE;
SpecularEnable = FALSE;
NormalizeNormals = TRUE;
AlphaTestEnable = TRUE;
AlphaFunc = GREATER;
AlphaRef = 0xA0;
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = CURRENT;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg2[0] = DIFFUSE;
MagFilter[0] = LINEAR;
MinFilter[0] = LINEAR;
AmbientMaterialSource = MATERIAL;
DiffuseMaterialSource = MATERIAL;
}
}
And here's the one that doesn't:
texture xTexture0;
float4 xDiffuse;
integer xLighting;
integer xColorVertex;
integer xColorOp;
integer xAmbientMaterialSource;
integer xDiffuseMaterialSource;
technique ModelExDefault
{
pass p0
{
Texture[0] = <xTexture0>;
MaterialDiffuse = <xDiffuse>;
Lighting = <xLighting>;
ColorVertex = <xColorVertex>;
CullMode = NONE;
ZEnable = TRUE;
ZWriteEnable = TRUE;
DitherEnable = TRUE;
SpecularEnable = FALSE;
NormalizeNormals = TRUE;
AlphaTestEnable = TRUE;
AlphaFunc = GREATER;
AlphaRef = 0xA0;
ColorOp[0] = <xColorOp>;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = CURRENT;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg2[0] = DIFFUSE;
MagFilter[0] = LINEAR;
MinFilter[0] = LINEAR;
AmbientMaterialSource = <xAmbientMaterialSource>;
DiffuseMaterialSource = <xDiffuseMaterialSource>;
}
}