Hi folks,

I'm having a bit of trouble with that shader from wiki, but it's not really about the shader it's about the code in Lite-C. Having two problems, the first is usage of float(..), which just generates an error. The second is, the water just jiggles back and forth extremely fast, and I'm not sure why.
Here's my converted code:

Code:
#define WATER_X skill4
#define WATER_Y skill5
function mtl_ffpwater_event()
{
while(1)
{
//Lets make it scroll in some direction
mtl_ffpwater.WATER_X += 0.1*time_step; //Move the water along the x axis with the given speed
mtl_ffpwater.WATER_Y += 0.1*time_step; //Move the water along the y axis with the given speed
mtl_ffpwater.matrix31 = floatd(sin(mtl_ffpwater.WATER_X)*100000,40000);
mtl_ffpwater.matrix32 = floatd(cos(mtl_ffpwater.WATER_Y)*100000,40000);
wait(1);
}
}

function fx_mirror()
{
if (bmap_mirrortarget) { return; }
bmap_mirrortarget = bmap_createblack(512,512,888);
mtl_ffpwater.skin2 = bmap_mirrortarget;
view_mirror.bmap = bmap_mirrortarget;
view_mirror.size_x = bmap_width(bmap_mirrortarget);
view_mirror.size_y = bmap_height(bmap_mirrortarget);

vec_set(view_mirror.portal_x,my.x);
vec_add(view_mirror.portal_x,vector(0,0,0));
vec_set(view_mirror.pnormal_x,vector(0,0,1.0)); // reflect upwards
view_mirror.flags |= NOSHADOW | NOPARTICLE | VISIBLE | NOCULL | PORTALCLIP;

while (bmap_mirrortarget)
{
proc_mode = PROC_LATE; // camera must be moved and mtlfx_mirrorvisible set before
view_mirror.aspect = 1;//1024/768; // screen aspect, independent of render target
view_mirror.arc = camera.arc;
view_mirror.fog_start = camera.fog_start;
view_mirror.fog_end = camera.fog_end;
view_mirror.clip_far = camera.clip_far;
view_mirror.clip_near = camera.clip_near;
view_mirror.x = camera.x;
view_mirror.y = camera.y;
view_mirror.z = 2*water_height-camera.z;//view_mirror.portal_z-camera.z; // move the camera at its mirror position
view_mirror.pan = camera.pan;
view_mirror.tilt = -camera.tilt; // flip the vertical camera angle
view_mirror.roll = -camera.roll;
wait(1);
}
}

action water()
{
water_height=my.z;
set (my, TRANSLUCENT);
my.alpha = 50;
mtl_ffpwater.matrix11 = float(100); //<--- error here, ive tried floatv as well
mtl_ffpwater.matrix22 = float(100);//<--- and here
bmap_to_mipmap(mtl_ffpwater.skin1);
bmap_to_mipmap(mtl_ffpwater.skin2);
my.material = mtl_ffpwater;
fx_mirror();
}



TY for the help!


you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe. __________________________________ yours truly