Shader in Lite-C

Posted By: TripleX

Shader in Lite-C - 01/04/08 00:50

Hey,

The following code worked perfectly in C-Script (I'm not sure if this material is very senseful. just a testmaterial i found - so don't check for correct working, but for crashs on startup)

Code:

MATERIAL* GEdit_targabitmap_shader =
{
effect =
" texture entskin1;
dword mtlskill1;

technique vegetation
{
pass p0
{
texture[0]=<entskin1>;
zwriteenable=true;
alphablendenable=false;
alphatestenable=true;
alpharef=<mtlskill1>;
alphafunc=greater;
cullmode=ccw;// ccw or none

colorarg1[0]=texture;
colorop[0]=modulate2x;
colorarg2[0]=diffuse;
}
}
technique fallback{pass p0{}}
";
}



When I run this code in C-Script everythings works fine. With Lite-C i get the error message:

"Error in effect: GEdit_targabitmap_shader (16): ID3DXEffectCompiler: State 'COLORARG1' accepts only dwords and ids. ID3DXEffectCompiler: There was an error initalizing the compiler".
This is the case with EVERY effect-material, that worked perfectly with C-Script.

I'm a bit irritated why I have to change anything? (as I said, every material with an effect here crashs).

Anyone have an idea?

Thanks,
Timo
Posted By: TripleX

Re: Shader in Lite-C - 01/07/08 22:17

no one ever had problems with shaders in lite-c?
Posted By: Trooper119

Re: Shader in Lite-C - 01/07/08 22:29

Sorry, its not a problem about people not having problems, its that everyone is having problems, no one I know converts C to C-lite, and very few in the community mess with shaders expertly enough to be able to explain it to others. I'm sorry that I can't help, but perhaps you should adopting another shader pre-built in C-light, I admit I can barely understand those as it is. So I can't explain you code at all. If I had to make a guess, it sounds like your error message is telling you it doesn't recognize the values your giving it. There are predetermined values that must be set, and retrieved for and from the engine. I haven't seen practically any of your code before so I suggest searching for these keyterms, but I could be way off.
Posted By: Fenriswolf

Re: Shader in Lite-C - 01/10/08 15:22

Hello,

replace
colorarg1[0]=texture;
with
ColorArg1[0]=Texture;

Obviously 'Texture' is case sensitive.

Perhaps 'alpharef=<mtlskill1>' will cause problems, too (black screen).
In this case you could just replace it with the following code:
AlphaRef=128;
© 2024 lite-C Forums