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 (AndrewAMD), 16,038 guests, and 5 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
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 | 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