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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,310 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 6 1 2 3 4 5 6
Fixed Function water? #24670
03/26/04 03:48
03/26/04 03:48
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
anyone have an idea how to proceed with a fixed function water effect.. i would assume environmental bump mapping.... but i could never get it to work before..anyone figure that out?


Sphere Engine--the premier A6 graphics plugin.
Re: Fixed Function water? [Re: Matt_Aufderheide] #24671
03/26/04 04:09
03/26/04 04:09
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
yes, i think environment bump mapping and multitexturing with some scrolling textures would lead to quite good fixed function water effects. the vertices maybe could be moved per script to achieve some waves in the geometry aswell...

but i didn't get environment bumpmapping to work either when i experimented with it a few weeks ago. neither with a fixed function effect nor with a shader. did anyone get it to work?

Re: Fixed Function water? [Re: ventilator] #24672
03/26/04 04:28
03/26/04 04:28
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
there is an example in the directX9 sdk which could be the way. also, i just had a glimpse and will go for it. but as i am not the fastest one here you will find it:

directXsdk-->directX utilities--> effect edit
then go to file--> open and jump one folder up. find the water.fx file and go...

those files just need minimal ajustments from what i see at the moment.


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Fixed Function water? [Re: ello] #24673
03/27/04 18:02
03/27/04 18:02
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
ok .. yes tthat example looks useful.. theres something i dont understand tho-
it calls for two matrices:
matrix mID; // Identity transform
matrix mENV; // Environment map transform

how do i derive these matrices?


Sphere Engine--the premier A6 graphics plugin.
Re: Fixed Function water? [Re: Matt_Aufderheide] #24674
03/29/04 09:05
03/29/04 09:05
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i tried some other, like matWorldViewProj; and matView; also matMtl; somehow its going into the right direction.
maybe some userdefined skills including the entities orientation and talking about setting up matrixes how can i set BUMPENVMAT00/01/10/11 with some dynamic floatvalues? in the dx example there are values like F2DW(0.0f); how do i get this into the fixed function pipeline?


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Fixed Function water? [Re: ello] #24675
03/29/04 22:15
03/29/04 22:15
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
ok ive gotten environmental bump mapping to work.. here is the code:

Code:
function mtl_env_view()
{
mat_set(mtl.matrix,matViewInv);
// reset the translation part of the matrix
mtl.matrix41 = 0;
mtl.matrix42 = 0;
mtl.matrix43 = 0;

// mat_scale(mtl.matrix,0.5,0.5,0.5);
}

function mtl_water_init
{
vec_set(mtl.emissive_blue,mat_model.emissive_blue);
vec_set(mtl.ambient_blue,mat_model.ambient_blue);
vec_set(mtl.diffuse_blue,mat_model.diffuse_blue);
vec_set(mtl.specular_blue,mat_model.specular_blue);
mtl.power=mat_model.power;
mtl.albedo=mat_model.albedo;
bmap_to_cubemap(mtl.skin3);
mtl.enable_render=on;
mtl.event=mtl_env_view;
}

bmap water = <water_1.tga>;
bmap caustic = <water_1_caustic.tga>;
bmap enviromap = <envmap+6.tga>;

material mat_water
{
event=mtl_water_init;
skin1=water;
skin2=caustic;
skin3=enviromap;

effect=
"
texture mtlSkin1;
texture mtlSkin2;
texture mtlSkin3;
matrix matMtl;
matrix matWorld;

technique envcube
{
pass p0
{
Lighting = True;
SpecularEnable = True;

ADDRESSU[0]=wrap;
ADDRESSV[0]=wrap;
ADDRESSU[1]=wrap;
ADDRESSV[1]=wrap;
ADDRESSU[2]=wrap;
ADDRESSV[2]=wrap;


// Stage0
MinFilter[0] = Linear;
MagFilter[0] = Linear;
MipFilter[0] = Point;


Texture[0] = <mtlSkin1>;
//TextureTransform[0] = <matWorld>;
//TextureTransformFlags[0] = Count2;

ColorOp[0] = SelectArg1;
ColorArg1[0] = Texture;
AlphaOp[0] = SelectArg2;
AlphaArg2[0] = Current;

// Stage1
MinFilter[1] = Linear;
MagFilter[1] = Linear;
MipFilter[1] = Point;

Texture[1] = <mtlSkin2>;
// TextureTransform[1] = <matWorld>;
// TextureTransformFlags[1] = Count2;

ColorOp[1] = bumpenvmap;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
AlphaOp[1] = SelectArg2;
AlphaArg2[1] = Current;


// Stage2
MinFilter[2] = Linear;
MagFilter[2] = Linear;
MipFilter[2] = Point;

Texture[2] = <mtlSkin3>;
TextureTransform[2] = <matMtl>;
TextureTransformFlags[2] = Count3;
TexCoordIndex[2] = cameraspacereflectionvector;

ColorOp[2] = modulate;
ColorArg1[2] = Texture;
ColorArg2[2] = Current;
AlphaOp[2] = SelectArg2;
AlphaArg2[2] = Current;


}
}
";
}




Sphere Engine--the premier A6 graphics plugin.
Re: Fixed Function water? [Re: Matt_Aufderheide] #24676
03/29/04 23:06
03/29/04 23:06
Joined: Jun 2001
Posts: 2,006
USA
Darkstorm Offline
Senior Expert
Darkstorm  Offline
Senior Expert

Joined: Jun 2001
Posts: 2,006
USA
What shader version do you need to use this? I get an unsupported error on my GeForce3 but then again I am fairly clueless about shaders.

Re: Fixed Function water? [Re: Darkstorm] #24677
03/29/04 23:45
03/29/04 23:45
Joined: Mar 2004
Posts: 102
T
Taros Offline
Member
Taros  Offline
Member
T

Joined: Mar 2004
Posts: 102
If anyone think this will help them then here you go (it's a combination of dot3 bumpmapping and enviromental mapping:

Code:
    	

bmap bumpmap = <waves.tga>; // add some bumpmap
bmap enviromentmap = <cubecloudy+6.tga>; // cubemap

material mat_bump
{
skin2 = bumpmap; // set the bumpmap
skin3 = enviromentmap;
scale1 = 0.2; // factor for the skin scale at stage 0
// define a material effect string
effect = "
// declare the used textures and variables
texture entSkin1; // the entity skin
texture mtlSkin2; // the bump map
texture mtlSkin3; // the enviroment map
dword mtlSkill1; // the light vector
// default technique
technique bump_dot3
{
pass P0
{
// set texture stage states
Texture[0] = <mtlSkin2>;
Texture[1] = <entSkin1>;
Texture[2] = <mtlSkin3>;
TextureFactor = <mtlSkill1>;
ColorArg1[0] = Texture; // stage 0 = bumpmap
ColorOp[0] = DotProduct3;
ColorArg2[0] = TFactor;
ColorArg1[1] = Texture; // stage 1 - skin texture
ColorOp[1] = AddSigned;
ColorArg2[1] = Current;
texCoordIndex[2]=cameraSpaceReflectionVector;
ColorOp[2] = AddSigned;
ColorArg1[2] = Texture;
ColorArg2[2] = Current;
ColorArg1[3] = Diffuse; // stage 2 - lighting
ColorOp[3] = Modulate2x;
ColorArg2[3] = Current;
}
}

// fallback technique for devices that do not support bumpmapping
technique fallback
{
pass P0
{
// set texture stage states
Texture[0] = <entSkin1>;
ColorArg1[0] = Texture; // stage 0 = skin texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Diffuse; // modulate by lighting
}
}
"; // end of the effect string
}

starter mat_bump_init {
// initialize the material properties
vec_set(mat_bump.ambient_blue,mat_model.ambient_blue);
vec_set(mat_bump.diffuse_blue,mat_model.diffuse_blue);
vec_set(mat_bump.specular_blue,mat_model.specular_blue);
mat_bump.power = mat_model.power;
// create the normals map for DOT3 bumpmapping
bmap_to_normals(mat_bump.skin2,2);
// set a lighting vector for DOT3 bumpmapping
mat_bump.skill1 = pixel_for_vec(vector(200,200,200),100,8888);
bmap_to_cubemap(mat_bump.skin3);
}

action envbump
{
my.material = mat_bump;
}



Also, if you want to have env. mapping in ps1.1 you can fake it using texbem or texbeml instructions. I almost got it to work (but it lacks color, for now )

Re: Fixed Function water? [Re: Taros] #24678
03/30/04 01:18
03/30/04 01:18
Joined: Aug 2003
Posts: 52
Netherlands
VoodooFactory Offline
Junior Member
VoodooFactory  Offline
Junior Member

Joined: Aug 2003
Posts: 52
Netherlands
Would it also be possible to slide the bumpmap over the model? Just normal UV-shifting I mean.

Re: Fixed Function water? [Re: VoodooFactory] #24679
03/30/04 04:58
03/30/04 04:58
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
yeah sure.. just shift the UV values in script by using my.u and my.v


Sphere Engine--the premier A6 graphics plugin.
Page 1 of 6 1 2 3 4 5 6

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