Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Shader in Lite-C #176288
01/04/08 00:50
01/04/08 00:50
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
TripleX Offline OP
Expert
TripleX  Offline OP
Expert

Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
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

Re: Shader in Lite-C [Re: TripleX] #176289
01/07/08 22:17
01/07/08 22:17
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
TripleX Offline OP
Expert
TripleX  Offline OP
Expert

Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
no one ever had problems with shaders in lite-c?

Re: Shader in Lite-C [Re: TripleX] #176290
01/07/08 22:29
01/07/08 22:29
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
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.


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: Shader in Lite-C [Re: Trooper119] #176291
01/10/08 15:22
01/10/08 15:22
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
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;


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1