Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, ozgur), 1,240 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Env Bump Mapping + Alpha Mask? Or something... #40826
02/08/05 16:38
02/08/05 16:38
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline OP
Senior Member
Zio  Offline OP
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State
I'm a complete shader newbie here, so bear with me..

I noticed the effects.wdl in 3DGS's work folder now has a nice env bump mapping (I'm assuming thats what its called) shader, but it doesn't show the original objects texture at all. Showing it some would be nice, but I'd really like to have it use an alpha mask.

I took the cubic env mapping shader from the wiki, which uses an alpha mask, and started fiddling around trying to mix the code in order to get the env bump mapping to be alpha masked. I have NO idea what I'm doing, and I got close, but it just wont work.

I was hoping someone with a little more (aka: any ) shader experience could whip something together for me, or at least point me in the right direction.

Re: Env Bump Mapping + Alpha Mask? Or something... [Re: Zio] #40827
02/10/05 16:33
02/10/05 16:33
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline OP
Senior Member
Zio  Offline OP
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State


Okay lets try this.

This is the original code. What needs to be done in order to make it use the entSkin1's alpha channel to control how strong the effect is where?

Code:

material mtl_envcube // environment cube
{
skin4 = bmp_envcube;
event = mtl_env_init;
effect = "
texture mtlSkin4;
texture entSkin2;
matrix matMtl;

technique envcube
{
pass p0
{
BumpEnvMat00[0] = 0.5f;
BumpEnvMat01[0] = 0.0f;
BumpEnvMat10[0] = 0.0f;
BumpEnvMat11[0] = 0.5f;

Texture[0] = <entSkin2>;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[0] = BumpEnvMap;

// TextureFactor = 0xFFFF0000;
// ColorArg1[0] = Tfactor;
// ColorOp[0] = SelectArg1;

AddressU[1] = Clamp; // don't wrap around edges
AddressV[1] = Clamp;

TexCoordIndex[1] = CameraSpaceReflectionVector;
TextureTransformFlags[1] = Count3;
TextureTransform[1] = <matMtl>; // transform camera space back to world space

Texture[1] = <mtlSkin4>;
ColorArg1[1] = Texture;
ColorArg2[1] = Current;
ColorOp[1] = Add;

}
}

technique fallback { pass p0 { } } // empty fallback causes normal rendering without effect
";
}




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