Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
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
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
2 registered members (AndrewAMD, 7th_zorro), 1,285 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
material matrices and lite-c #171805
12/08/07 11:51
12/08/07 11:51
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
Hello

I have this code that worked perfectly in c-sript(with c-script syntax of course...) but doesent under lite-c (latest public beta). Are material matrices handeled differently? I would appreciate any help...thanks!

with this code I get a fast flickering of the texture...instead of a constant uv-shifting.

Code:

function init_mat_ffe_river()
{
bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);
bmap_to_normals(mtl.skin1,my.riv_wav_height);

vec_set(mtl.ambient_blue,vector(clamp((d3d_fogcolor1.blue*my.riv_fogcol_fac)+(my.riv_add_blue*clamp(sun_angle.tilt/30,0.2,1))+(lightning),0,255),clamp((d3d_fogcolor1.green*my.riv_fogcol_fac)+(my.riv_add_green*clamp(sun_angle.tilt/30,0.2,1))+(lightning),0,255),clamp((d3d_fogcolor1.red*my.riv_fogcol_fac)+(my.riv_add_red*clamp(sun_angle.tilt/30,0.2,1))+(lightning),0,255)));

mat_identity(mtl.matrix);

mtl.matrix31 = floatd(my.riv_wav_speed_x*total_ticks,256);//u-speed
mtl.matrix32 = floatd(my.riv_wav_speed_y*total_ticks,256);//v-speed

mtl.matrix11 = floatv(my.riv_wav_scale/2); // waterbump_size
mtl.matrix22 = floatv(my.riv_wav_scale); // waterbump_size

set(mtl,ENABLE_RENDER);
}

MATERIAL* mat_ffe_river =
{
skin1 = bmp_river_bump_ffe;
skin2 = bmp_river_ffe;

event = init_mat_ffe_river;

effect =
"

texture mtlSkin1;
texture mtlSkin2;
texture mtlSkin3;//alpha in this texture indicates transparancy
texture mtlSkin4;//dummy texture to mix-in material setup

matrix matMtl;

technique reflecting_water
{
pass p0
{
Texture[1] = <mtlSkin1>;

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

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


Texture[2] = <mtlSkin2>;

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

TextureTransformFlags[2] = count2;

TextureTransform[2] = {
3.0, 0.0, 0.0, 0.0,//u-scale of lake rgb texture CHANGE THIS TO YOUR NEEDS!
0.0, 3.0, 0.0, 0.0,//v-scale of lake rgb texture CHANGE THIS TO YOUR NEEDS!
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};

texcoordindex[2]= 1;

Texture[3] = <mtlSkin3>;// alpha in this texture makes entSkin1-texture transparent

TexCoordIndex[3] = 1;


ColorArg1[3] = Current;
ColorOp[3] = modulate;
AlphaOp[3] = Modulate;


Texture[4] = <mtlSkin4>;

TexCoordIndex[4] = 0;

ColorArg1[4] = 0.5;
ColorOp[4] = Modulate2x;
ColorArg2[4] = Current;

alphablendenable = true;
alphatestenable = false;//true;
zenable = true;
zwriteenable=true;

CullMode=none;

}
}

technique fallback { pass p0 { } }";

}



Re: material matrices and lite-c [Re: Loopix] #171806
12/11/07 00:28
12/11/07 00:28
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
Pleeeeeeeeease! I'm really stuck with that
Two yet unreleased nice trees for the one who comes up with a solution

Re: material matrices and lite-c [Re: Loopix] #171807
12/12/07 00:15
12/12/07 00:15
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Did you try to move only with the u-scale or the v-scale (one at a time)?

I had to play with these to get it to work for me.

Ottawa.


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