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
2 registered members (TipmyPip, AndrewAMD), 1,151 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
Help with material effect #129771
05/14/07 13:39
05/14/07 13:39
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
I am making a simple effect, a texture is on top of other texture/shader and blending in with them multiply mode.
I have tried by fail .. Could anyone have done it please help. I have try to find in the manual but the effect manual is too bad!

Re: Help with material effect [Re: fusukery] #129772
05/14/07 15:03
05/14/07 15:03
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Please post your code

Re: Help with material effect [Re: Claus_N] #129773
05/14/07 15:50
05/14/07 15:50
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
Code:

bmap bcube=<cube+6.tga>;

function mtl_envmap_view()
{
mat_set(mtl.matrix,matViewInv);
mtl.matrix41=0;
mtl.matrix42=0;
mtl.matrix43=0;
}

function mtl_envmap_init()
{
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmap_view;
mtl.enable_view=on;
}

material mtl_envmap
{
skin1=bcube;
event=mtl_envmap_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
Texture[0] = <entSkin1>;
ColorArg1[0] = Texture; // stage 0 = skin texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Diffuse; // modulate by lighting
}
pass p1
{
texture[0]=<entSkin1>;
texture[1]=<mtlSkin1>;

zWriteEnable=true;
alphaBlendEnable=false;

colorArg1[0]=Texture;
colorOp[0]=Modulate2x;
colorArg2[0]=Diffuse;

colorArg1[1]=Texture;
colorOp[1]=blendCurrentAlpha;


addressU[1]=Clamp;
addressV[1]=Clamp;
texCoordIndex[1]=cameraSpaceReflectionVector;
textureTransformFlags[1]=Count3;
textureTransform[1]=<matMtl>; // transform camera space back to world space
}
}
";
}


This is the code of an enviroment cube map.. Now, I want to make a texture blend over the shader. I think I must write a new pass, blend with the existing pass, but do not know how to do

Re: Help with material effect [Re: fusukery] #129774
05/14/07 15:57
05/14/07 15:57
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Maybe have a look at this site: http://www.coniserver.net/wiki/index.php/Color_Op

This should have been in the shader forum =)

I am sorry, but I am too much shader-newbie to help you with this... :/

Re: Help with material effect [Re: Claus_N] #129775
05/14/07 16:04
05/14/07 16:04
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
I do not think this is call shader, , just a simple material script for blending texture or pass
Could anyone post a code snippet, I still can not figure it out . I know must use a blending mode ColorOp[n] = Modulate; but do not know how to declare it in a new pass

Last edited by fusukery; 05/14/07 16:05.
Re: Help with material effect [Re: fusukery] #129776
05/14/07 20:08
05/14/07 20:08
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
I found that the ColorOp seems only blend mode for texture , how about the pass??
In my case, pass 1 has been used for environment mapping, so I need another pass with texture and blend down with pass 1

Re: Help with material effect [Re: fusukery] #129777
05/15/07 00:03
05/15/07 00:03
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
technically, it's not a shader. It's a fixed function effect. But it still belongs in the shader section


xXxGuitar511
- Programmer
Re: Help with material effect [Re: xXxGuitar511] #129778
05/15/07 02:22
05/15/07 02:22
Joined: May 2007
Posts: 30
F
fusukery Offline OP
Newbie
fusukery  Offline OP
Newbie
F

Joined: May 2007
Posts: 30
Could anyone delete this post, I post I again in shader section


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