Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,574 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to attach different materials..? #31020
07/23/04 09:54
07/23/04 09:54
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
I was wondering how to assign different materials to a model..
Like the image bellow.. i just want it to have a shader environment reflection on the middle shape .. is this done with alpha channel?? i have tryed it already but seems to don't work... .. Can someone tell me how can i do that... and if possible write a simple script??


Thanx... sorry english

Re: How to attach different materials..? [Re: MMike] #31021
07/24/04 00:07
07/24/04 00:07
Joined: Jul 2004
Posts: 23
Houston, Tx
D
Digifuse Offline
Newbie
Digifuse  Offline
Newbie
D

Joined: Jul 2004
Posts: 23
Houston, Tx
I'm looking to do the same. To take it a step further I'd like to be able to cycle alpha maps at runtime. Is there a way to point to a variable in a .wdl from the .fx file so I can assign the alpha cycle to a button? So all in all there would be 3 images; material, alpha map and the cubic environment map.

To expand it even further, could you have an environment map and texture map for each alpha seperation? So the layout would be

alpha ---> texture 1 <split> texture 2
|
---------> environment map1 <split> environment map2

Basically, I want to be able to take a model and apply a basic texture to it. Then the player can cycle through different patterns or logos and apply them to the model via the alpha maps. Also, the player would be able to change the RGB values for only one of the alpha splits. Thinking in black and white, the white part of the mask can change the materials color.

I'm not looking for a full written shader. If someone could just point me in the right direction or give me something to work off of that would be fantastic. I hope I made everything as clear as possible. Any help would be greatly appreciated, thanks!


-Digifuse-
Re: How to attach different materials..? [Re: Digifuse] #31022
07/24/04 10:25
07/24/04 10:25
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
What i want to do is a knife! which the metal part reflect the environment... and the rest (non metal) not!!!
Just that..
I have the knife skin, and the 2nd skin is a grayscale pic where the metal part is poited to the white part of the 2nd skin..
I have the cubic environment shader script i just want to know where the alpha map is used!! where i put it.. and how to control it like 100% or 0% ... Cause only the metal reflect environment..
PLease help me!

Last edited by Unknot; 07/24/04 14:41.
Re: How to attach different materials..? [Re: MMike] #31023
07/25/04 04:51
07/25/04 04:51
Joined: Jul 2002
Posts: 5,181
Austria
Blattsalat Offline
Senior Expert
Blattsalat  Offline
Senior Expert

Joined: Jul 2002
Posts: 5,181
Austria
your alphamap will refract the white parts 100% and the black ones 0% (usual, might be different in your shader though). so, first skin= metal, second one = the rest, third = the alpha map that blends the environment reflection into it depending on its color white-->black

the wiki offers a refraction mapping shader with alphamap setting...also the shader forum here has some sollutions for it.

Re: How to attach different materials..? [Re: Blattsalat] #31024
07/25/04 09:31
07/25/04 09:31
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
This is the shader effect i have:
Code:
 ////// Shader Alpha reflect
bmap bcube=<skycubesun+6.tga>;

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

function mtl_envmapreflect_init()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envmapreflect_view;
mtl.enable_view=on;
}

material shadet_metalreflect
{
skin1=bcube;
event=mtl_envmapreflect_init;

effect=
"
texture entSkin1;
texture mtlSkin1;
matrix matMtl;
technique envmap
{
pass p0
{
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
}
}
";
}

action Shader_metal
{
my.material=shadet_metalreflect;
}





The model Skin2 :



The final result is(what's wrong?? the alpha didn't work!!) :



Re: How to attach different materials..? [Re: MMike] #31025
07/25/04 10:09
07/25/04 10:09
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Quote:


texture entSkin1;
texture mtlSkin1;

[snip]

The model Skin2





Could it be that your second model skin isnt being used anywhere, for starters?


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: How to attach different materials..? [Re: qwerty823] #31026
07/25/04 10:47
07/25/04 10:47
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
But i tryed so appy the alpha skin as skin1 as well and the same problem!

Re: How to attach different materials..? [Re: MMike] #31027
07/25/04 11:30
07/25/04 11:30
Joined: Jul 2002
Posts: 5,181
Austria
Blattsalat Offline
Senior Expert
Blattsalat  Offline
Senior Expert

Joined: Jul 2002
Posts: 5,181
Austria
..... --->.... alphaBlendEnable=false; ?????????????

Re: How to attach different materials..? [Re: Blattsalat] #31028
07/25/04 12:13
07/25/04 12:13
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
doen't matter!! The effect is the same!!
i turned it true and nothing!!
I'm getting so mad!!!

Re: How to attach different materials..? [Re: MMike] #31029
07/26/04 12:48
07/26/04 12:48
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Another thing i noticed..is if i point the player cam to the flare lens effect the shader become transparent by 50% !! and then if i turn the camera to the ground so to the lower part of the torus..the transparency is gone... Thats weird?? does it happen to other ppl??

My card is :
nVidea GForce 4 FX 5600 256Mb

Last edited by Unknot; 07/26/04 21:38.
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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