Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,426 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
water shader with physics - Acknex Resources pg #65530
03/04/06 05:18
03/04/06 05:18
Joined: Jan 2005
Posts: 229
Atlantis Offline OP
Member
Atlantis  Offline OP
Member

Joined: Jan 2005
Posts: 229
A6 engine - commercial release V6.31.4 - Nov 18 2004

This is from the Acknex Resource site pages. It is the water shader with physics. I installed the Newton from the A6 downloads page.

After inserting include <ffpwater2.wdl>; into my main script, I get these errors when I build.

Loading demo.wdl.................
<(my.density==0.0)> ffpwater2.wdl 154:0 Error(50): Parameter unknown density Parameter

<(my.density=1.0)> ffpwater2.wdl 155:0 Error(50): Parameter unknown density Parameter

<my.water_entity=0;> ffpwater2.wdl 158:0 Error(29): Keyword unknown my.water_entity

<body=NewtonAddMapEntity (my,0);> ffpwater2.wdl 159:0 Error(29): Keyword unknown body

I tried defining density: var density; but that didn't work. How do you handle errors such as this - keyword unknown and parameter unknown.

Code:
 
// Altered by Matthew Coles
// LiveWire Entertainment

// Compatible With Newton Bouyancy

////////////////////////////////////////////////////////
// Environment Mapping Bump Mapping Water
//
// Version 2
//
// Eric Hendrickson-Lambert (Steempipe)
//
////////////////////////////////////////////////////////

////////////////////////////////////////////////////////
// Since at this time I cannot get a cubic Env Map
// to work. I have taken out most references to it
// and used a basic sky texture because it needs
// the cloud noise for the specular
///////////////////////////////////////////////////////

bmap waterbump2 = <waterbump.bmp>;
bmap envspec2 = <sky.tga>;
bmap base2 = <gradient.bmp>;

function mtl_ffpwater2_1()
{

///////////////////////////////////////////////
// Lets make it scroll in some direction
//

mtl.skill1 += time;
mtl.matrix41 = floatd(mtl.skill1,4000);


}

function mtl_ffpwater2_init()
{

mtl.matrix11 = float(1.6);
mtl.matrix22 = float(0.8);

bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);
bmap_to_mipmap(mtl.skin3);

bmap_to_normals(mtl.skin1,0.5);

//bmap_to_cubemap(mtl.Skin2);

mtl.event = mtl_ffpwater2_1;

mtl.enable_view = on;

}


material mtl_ffpwater2
{
skin1=waterbump2;
skin2=envspec2;
skin3=base2;

event = mtl_ffpwater2_init;

effect = "

matrix matMtl;

texture mtlSkin1;
texture mtlSkin2;
texture mtlSkin3;

technique makewater2
{

pass p0
{

Texture[0] = <mtlSkin3>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

AddressU[0]=Clamp;
AddressV[0]=Clamp;

ColorArg1[0] = Texture;
ColorOp[0] = modulate;
ColorArg2[0] = diffuse;

alphaop[0]=selectarg1;
alphaarg1[0]=texture;

texcoordindex[0]=1;


Texture[1] = <mtlSkin1>;

magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;

ColorArg1[1] = Texture;
ColorOp[1] = bumpenvmap;
ColorArg2[1] = current;

TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
Texcoordindex[1]=1;


Texture[2] = <mtlSkin2>;

magFilter[2]=linear;
minFilter[2]=linear;
mipFilter[2]=linear;

AddressU[2]=Clamp;
AddressV[2]=Clamp;

ColorArg1[2] = Texture;
ColorOp[2] = Add;
ColorArg2[2] = Current;


TextureTransformFlags[2] =count3 | projected;

texcoordindex[2]= cameraspaceposition | 1; // For cubemap use: cameraspacereflectionvector

}

}

technique fallback { pass p0 { } }

";
}



action Shader_water2 {

var body;

dll_handle = newtonHandle;

if (my.density == 0.0) {
my.density = 1.0;
}

my.water_entity = 0;
body = NewtonAddMapEntity (my, 0);
NewtonSetBodyMass (body, 0);

NewtonSetBodyMaterial (body, water_material);


my.material = mtl_ffpwater2;

}



Re: water shader with physics - Acknex Resources pg [Re: Atlantis] #65531
03/04/06 13:38
03/04/06 13:38
Joined: Aug 2005
Posts: 343
Germany
HPW Offline
Senior Member
HPW  Offline
Senior Member

Joined: Aug 2005
Posts: 343
Germany
If you use "my" or "you", than it isn't a variable. It's a skill and must be defined:

define density, skill99;
define water_entity, skill100;

Last edited by HPW; 03/04/06 13:38.
Re: water shader with physics - Acknex Resources pg [Re: HPW] #65532
05/12/06 06:39
05/12/06 06:39
Joined: Apr 2006
Posts: 36
India
G
gamespider Offline
Newbie
gamespider  Offline
Newbie
G

Joined: Apr 2006
Posts: 36
India
This error happens because u do not have Newton game dynamics...

just install it, or comment out the lines..


Moderated by  Blink, Hummel, Superku 

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