Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (3run, AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip), 605 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem with Steempipes' CubicEnvMap w alpha mask #52807
08/21/05 01:42
08/21/05 01:42
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil


I am trying to use this shader with an alpha mask channel and this is what I am getting. The refletions areas are ok, but the parts where I donīt want to be refleted are wierd.

Here is the code with a few changes that I made (Trying to remove the Dot3 NOrmapMap parts):
Code:
 
//////////////////////////////////////////////////////////
// This effect will take a texture and bumpmap it.
// Then it will display the cubicenv map based
// on a mask that is in the A channel of skintex.
//
// By: Eric Hendrickson-Lambert (Steempipe)


bmap maskedenvmap_cube= <sk_free2_256+6.tga>; // CubicEnvMap
bmap maskedenvmap_skintex=<AuditTexture.tga>; // Colormap + mask in alpha


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

function MaskedEnvMap_init()
{

bmap_to_cubemap(bmap_to_mipmap(mtl.skin1));

mtl.event=MaskedEnvMap_view;
mtl.enable_view=on;
}

material MaskedEnvMap
{
skin1=maskedenvmap_cube;
skin2=maskedenvmap_skintex;
//skin3=maskedenvmap_bumptex;

event=MaskedEnvMap_init;

effect=
"
texture mtlSkin2;
texture mtlSkin1;
//texture mtlSkin3;

matrix matMtl;

//dword mtlSkill4; // the light vector

vector vecAmbient; // Ambient Light Vector

technique envmap
{
pass p0
/////////////////////////////////////////////////
//This pass will do DOT3 Bumpmapping

{
Texture[0]=<mtlSkin1>; // The Normalmap
Texture[1]=<mtlSkin2>; // The Colormap + the mask in alpha

AlphaBlendEnable=False;

MagFilter[0]=linear;
MinFilter[0]=linear;
MipFilter[0]=linear;

MagFilter[1]=linear;
MinFilter[1]=linear;
MipFilter[1]=linear;

ColorArg1[0] = Texture; // stage 0 = DOT3 Normalmap
ColorOp[0] = AddSigned;
ColorArg2[0] = Current;

ColorArg1[1] = Texture; // stage 1 - Colormap
ColorOp[1] = AddSigned;
ColorArg2[1] = Current;

ColorOp[2]=disable;
AlphaOp[2]=disable;

}


pass p0
///////////////////////////////////////
// This pass will apply the Cubemap to a mask
//
{

Texture[0]=<mtlSkin2>; // The blendmap in Alpha
Texture[1]=<mtlSkin1>; // The cubemap

MagFilter[0]=linear;
MinFilter[0]=linear;
MipFilter[0]=linear;

MagFilter[1]=linear;
MinFilter[1]=linear;
MipFilter[1]=linear;

AlphaBlendEnable=True;
SrcBlend=SrcAlpha;
DestBlend=InvSrcAlpha;

Zenable=True;
ZwriteEnable=True;

TextureTransformFlags[0] = disable;
TexCoordIndex[0]=0;

ColorArg1[0] = current;
ColorOp[0] = selectarg1;


AddressU[1]=Clamp;
AddressV[1]=Clamp;
TexCoordIndex[1]=CameraSpaceReflectionVector;
TextureTransformFlags[1]=Count3;
TextureTransform[1]=<matMtl>;

colorArg1[1]=Texture;
textureFactor=0x40FFFFFF; // -> C0=75%, 80=50%, 40=25%
colorOp[1]=blendFactorAlpha;

}



}
";
}


action ffp_MaskedEnvMap
{

sun_angle.pan=80;
sun_angle.tilt=30;

my.material = MaskedEnvMap;

}



Re: Problem with Steempipes' CubicEnvMap w alpha mask [Re: XNASorcerer] #52808
08/22/05 07:13
08/22/05 07:13
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
Anyone?

Re: Problem with Steempipes' CubicEnvMap w alpha m [Re: XNASorcerer] #52809
08/22/05 16:35
08/22/05 16:35
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Shouldn't be the second pass p1 instead of p0?

Re: Problem with Steempipes' CubicEnvMap w alpha m [Re: Pappenheimer] #52810
08/22/05 17:07
08/22/05 17:07
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
Yes, you are right, but that didn't change anything.
And I decided to try to eliminate the first pass and to leave only with one. Now, this is what I am getting:


Re: Problem with Steempipes' CubicEnvMap w alpha mask [Re: XNASorcerer] #52811
08/22/05 18:51
08/22/05 18:51
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
No problem anymore! It is working now!

Re: Problem with Steempipes' CubicEnvMap w alpha m [Re: XNASorcerer] #52812
08/22/05 19:16
08/22/05 19:16
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
What did you change?

Re: Problem with Steempipes' CubicEnvMap w alpha m [Re: Pappenheimer] #52813
08/22/05 19:38
08/22/05 19:38
Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
XNASorcerer Offline OP
Expert
XNASorcerer  Offline OP
Expert

Joined: Dec 2001
Posts: 2,172
Portugal - Brazil
I will post the code.


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