Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
3 registered members (AndrewAMD, VoroneTZ, dpn), 1,346 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Alpha Transparent Cube Maps??? #38645
01/02/05 08:23
01/02/05 08:23
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline OP
Senior Developer
Josh_Arldt  Offline OP
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Does anybody know how i could get this cube map to have alpha transparency so that i can still see the surface that it is masked over?

/////
//// A6 Shader , Developed By Unknot
/// For ice floor, or Wet paviments
/// Use a terrain with skin1 base map with alpha map
bmap bmp_envplane = <sky+6.tga>; //cube image


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

function mtl_envplane_ini()
{
//...maybe you should copy the mat_model properties here...
bmap_to_cubemap(mtl.skin1);
mtl.event=mtl_envplane;
mtl.enable_view=on;
}
material mtl_envcube2plane // environment cube
{
skin1 = bmp_envplane; //cube plane
event = mtl_envplane_ini;

effect=
"
texture mtlSkin1;
texture entSkin1;
matrix matMtl;
technique cubic_environment
{
pass p0
{

Texture[1]=<mtlSkin1>;











zWriteEnable=true;
alphaBlendEnable=false;



//colorArg1[1]=diffuse;
//colorArg1[1]=texture;


colorOp[1]=blendCurrentAlpha;
addressU[1]=Clamp;
addressV[1]=Clamp;





TextureTransformFlags[1] =count3 ;
texcoordindex[1]= cameraspaceposition ; // For cubemap use: cameraspacereflectionvector
//texcoordindex[1]= cameraspacereflectionvector | 1; // For cubemap use: cameraspacereflectionvector

TextureTransform[1]=<matMtl>;


}
}
";

}


action shaders_plane
{
my.material = mtl_envcube2plane;
}


//////////////////////////////////////////////////////////////////
//
// Use alpha transparency with Envmap
//
//
// By: Eric Hendrickson-Lambert (Steempipe)
//
// If it whacks you computer.... Sorry.
//
// 8-30-04: Updated to help ensure it runs on geforce2(?)
//

//bmap transenvmap_cube= <desertsm+6.tga>; // CubicEnvMap


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


function transenv_init()
{

// Best to approach mipmapping this way with cubemap, I think.
bmap_to_cubemap(bmap_to_mipmap(mtl.skin1));

mtl.event=transenv_view;
mtl.enable_view=on;

}


material transenv
{
skin1=bmp_envplane;

event=transenv_init;

effect=
"

texture mtlSkin1;

matrix matMtl;

vector vecAmbient; //<<---------
vector vecSpecular; //<<---------
vector vecDiffuse; //<<---------
vector vecEmissive; //<<---------

Technique envmap
{

Pass p0
{

Texture[0]=<mtlSkin1>;

AddressU[0]=Clamp;
AddressV[0]=Clamp;

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

///////////////////////////////////
// Never trust any card's defaults
AlphaBlendEnable=True;
Zenable = True;
ZwriteEnable = True;

SrcBlend=srcAlpha; //<<---------
DestBlend=InvSrcAlpha; //<<---------
BlendOp=Add; //<<---------
Lighting=True; //<<---------

AmbientMaterialSource=<vecAmbient>; //<<---------
DiffuseMaterialSource=<vecDiffuse>; //<<---------
SpecularMaterialSource=<vecSpecular>; //<<---------
EmissiveMaterialSource=<vecEmissive>; //<<---------
//////////////////////////////////

TexCoordIndex[0]=CameraSpaceReflectionVector;
TextureTransformFlags[0]=Count3;
TextureTransform[0]=<matMtl>;



ColorArg1[0]=Texture;
ColorOp[0]=SelectArg1;

Alphaop[0]=SelectArg1; //<<---------
AlphaArg1[0]=Diffuse; //<<---------


ColorOp[1]=Disable;
AlphaOp[1]=Disable;



}

}
";
}



action ffp_TransEnvMap
{

my.transparent=on;
my.alpha=60;
my.material = transenv;

}

Re: Alpha Transparent Cube Maps??? [Re: Josh_Arldt] #38646
01/02/05 22:28
01/02/05 22:28
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
You are thinknig on assigning that to a Plane surface??? I hope not..

I did not see the script , but does it works on plane surface or Curved ones?
HSanbag, ho ho ho I don't know.. but i guess you have the wrong script.. You can talk with me, cause i have the one you want, You could ask it when we talk about this..

Re: Alpha Transparent Cube Maps??? [Re: MMike] #38647
01/03/05 13:14
01/03/05 13:14
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline OP
Senior Developer
Josh_Arldt  Offline OP
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
It works great on curved surfaces.
I just want the cube map to be alpha transparent so I can get things like wet eye effects or metalic guns ect...

Re: Alpha Transparent Cube Maps??? [Re: Josh_Arldt] #38648
01/04/05 03:31
01/04/05 03:31
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
oh .. so all you need to do .. is set the alpha factor..

hihi.. Please somebody tell him how to do this:

Re: Alpha Transparent Cube Maps??? [Re: MMike] #38649
01/04/05 07:50
01/04/05 07:50
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
HSB: This thread has (2) different scripts. You may be able to decipher the 2nd code snip enough to apply the effect, or get an idea in the right direction. There is no reason I can think of as to why we could not put the alpha mask in your CEM tex.

Re: Alpha Transparent Cube Maps??? [Re: Steempipe] #38650
01/05/05 11:51
01/05/05 11:51
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline OP
Senior Developer
Josh_Arldt  Offline OP
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
It's kinda hard to explain what I want but...
The second snippet can do what I want but PaintShopPro 7 can't do the alpha mask right...
It can't seem to make them transparent like yours. It always ends up as a completely white mask...
The only way that I can really make transparent masks is if I make them in 2bit colors.

Last edited by HSB; 01/05/05 11:53.
Re: Alpha Transparent Cube Maps??? [Re: Josh_Arldt] #38651
01/06/05 17:56
01/06/05 17:56
Joined: Dec 2003
Posts: 1,097
Maryland, USA
Steempipe Offline
Serious User
Steempipe  Offline
Serious User

Joined: Dec 2003
Posts: 1,097
Maryland, USA
Quote:

It's kinda hard to explain what I want but...
The second snippet can do what I want but PaintShopPro 7 can't do the alpha mask right...
It can't seem to make them transparent like yours. It always ends up as a completely white mask...
The only way that I can really make transparent masks is if I make them in 2bit colors.




Ahhh.... I see.

Download Imagemagick (free) and then use the following in a BAT file:

Code:
 @echo off
cls

rem ###############################################
rem ## Here we will cram the RGB and Alpha data
rem ## into a single file. Ready for use in effect
rem ###############################################

convert alpha.bmp -channel R -negate -separate tempalpha.tga
composite -compose CopyOpacity tempalpha.tga rgb.bmp finalimage.tga


pause



In that code "alpha.bmp" is the image you want to stick in the alpha channel. "rgb.bmp" is the image that will live in RGB channels. The (2) are combined into "finalimage.tga".

Re: Alpha Transparent Cube Maps??? [Re: Steempipe] #38652
01/07/05 23:52
01/07/05 23:52
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline OP
Senior Developer
Josh_Arldt  Offline OP
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Thanks.
I'll try it.


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