Nothing happens!?

Posted By: Claus_N

Nothing happens!? - 02/12/06 12:59

Hi,

Just started to learn HLSL... I tried this code on the cbabe.mdl, but nothing happens...
Why?

my_shader1.fx
Code:
float4x4 matWorldViewProj;
struct VS_OUTPUT
{
float4 Pos : POSITION;
};
VS_OUTPUT vs_main(float4 inPos: POSITION)
{
VS_OUTPUT Out = (VS_OUTPUT) 0;
Out.Pos = mul(inPos,matWorldViewProj);
return(Out);
}
float4 ps_main() : COLOR
{
float4 Col = float4(1,1,0,1);
return(Col);
}
technique tech1
{
pass pass0
{
VertexShader = compile vs_2_0 vs_main();
PixelShader = compile ps_2_0 ps_main();
}
}



Level c-script code
Code:
// level.wdl
var video_mode = 7;
var video_depth = 32;
var video_screen = 2;

function main()
{
freeze_mode = 1;

level_load("level.wmb");

wait(3);

freeze_mode = 0;

while(1)
{
camera.pan -= mouse_force.x * 15 * time;
camera.tilt += mouse_force.y * 15 * time;
camera.tilt = clamp(camera.tilt,-80,80);
wait(1);
}
}

material my_shader1
{
effect = "my_shader1.fx";
}

action shader_ent1
{
my.material = my_shader1;
}


Posted By: Steempipe

Re: Nothing happens!? - 02/12/06 13:28

It should work, but it will color cBabe one solid color. Any errors??
Posted By: Claus_N

Re: Nothing happens!? - 02/12/06 14:28

Nope, no errors.. :/

EDIT: That's how she just looks :/

Posted By: Matt_Aufderheide

Re: Nothing happens!? - 02/12/06 15:54

I think you may need to make sure you have the fx file in the right directory.. A6 cant load fx files unless they are your game ROOT directory.. this is annoying.

If this doesnt work still, try using the effect_load command instead of doing like you do: effect="blahblah.fx"

that might work, although i had never seen it done that way, I dont know.
Posted By: Claus_N

Re: Nothing happens!? - 02/12/06 19:01

The .fx file is in the same directory as all the other files in that "game project". I've also tried to put the shader code directly into the effect = "blablabla", instead of putting it in a .fx file..

I'll try the effect_load..
Posted By: Claus_N

Re: Nothing happens!? - 02/14/06 19:24

Well, I've got both good and bad news..

Good: I published the level, and tried it on my mother's computer; it worked!
Bad: Then it must be MY computer there's something wrong with

I'm using a GeForce Ti 4200, and the newest driver from NVidia

But... Almost the same shader works fine in RenderMonkey...
But since I reinstalled my computer two weeks ago, I haven't used RenderMonkey...
I'll try this shader in RenderMonkey, and if it won't work there too...............

I'll post here again, if I can't get it working

EDIT:
RENDERMONKEY I LOVE YOU!!!
My hardware only supports vs1.1 and ps1.3 :S
© 2024 lite-C Forums