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
2 registered members (OptimusPrime, AndrewAMD), 14,580 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
These Shaders Don't Work!!! #39831
01/20/05 04:14
01/20/05 04:14
Joined: Nov 2004
Posts: 35
C:\Earth\United States\Texas (...
Helmet_man Offline OP
Newbie
Helmet_man  Offline OP
Newbie

Joined: Nov 2004
Posts: 35
C:\Earth\United States\Texas (...
I am an artist and don't know anything about shaders.
Please help me.
Why don't these shaders work with the current version of gamestudio A6?
Can somebody fix them for me?

Code:
 var d3d_automaterial=1;



bmap b_luminosity1=<luminosity1.tga>;

material checker1 // material name = level surface texture name
{
skin1=b_luminosity1;

effect=
"

texture mtlSkin1;
texture entSkin1;

technique luminosity_mapping
{
pass p0
{
texture[2]=<entSkin1>;
texture[3]=<mtlSkin1>;


colorarg1[0]=texture; // shadow map
colorarg2[0]=diffuse; // vertex lighting
colorop[0]=add; // add vertex lighting to shadow map


colorarg1[1]=texture; // color map
colorarg2[1]=current; // (shadow map + vertex lighting)
colorop[1]=modulate2x; // modulate color map with (shadow map + vertex lighting)
resultarg[1]=temp; // output to temp register


colorarg1[2]=texture; // color map
colorop[2]=selectarg1;

magfilter[2]=linear;
minfilter[2]=linear;
mipfilter[2]=linear;
texcoordindex[2]=1;


colorarg1[3]=current; // unshaded color map
colorarg2[3]=temp; // shaded color map
colorarg0[3]=texture; // luminosity map
colorop[3]=lerp; // interpolate between shaded color map and unshaded color map depending on luminosity map

magfilter[3]=linear;
minfilter[3]=linear;
mipfilter[3]=linear;
texcoordindex[3]=1;
}
}
";
}
if you want to apply the effect to several different level textures you could do it this way:

bmap b_luminosity2=<luminosity2.tga>;
material groundtexture2
{
skin1=b_luminosity2;
}

bmap b_luminosity3=<luminosity3.tga>;
material metaltexture_tga
{
skin1=b_luminosity3;
}
...

starter copy_effects()
{
wait(1);
groundtexture2.effect=checker1.effect;
metaltexture.effect=checker1.effect;
...
}



Code:
 var d3d_automaterial=1;

bmap b_detail1=<detail1.tga>;

function init_detail_mapping
{
bmap_to_mipmap(mtl.skin1);
}

material checker1 // material name = level surface texture name
{
event=init_detail_mapping;
skin1=b_detail1;
effect=
"
texture mtlSkin1;
technique detail_mapping
{
pass p0
{
texture[2]=<mtlSkin1>;


colorarg1[0]=texture; // shadow map
colorarg2[0]=diffuse; // vertex lighting
colorop[0]=add; // add vertex lighting to shadow map
resultarg[0]=temp; // output to temp register


colorarg1[1]=texture; // color map
colorop[1]=selectarg1;


colorarg1[2]=texture; // detail map
colorarg2[2]=current; // color map
colorop[2]=addsigned; // add detail map to color map
texcoordindex[2]=1;
texturetransformflags[2]=count2;
texturetransform[2]={8.0,0.0,0.0,0.0, // detail map u scale
0.0,8.0,0.0,0.0, // detail map v scale
0.0,0.0,0.0,0.0,
0.0,0.0,0.0,0.0};
magfilter[2]=linear;
minfilter[2]=linear;
mipfilter[2]=linear;


colorarg1[3]=temp; // (shadow map + vertex lighting)
colorarg2[3]=current; // (color map + detail map)
colorop[3]=modulate2x; // modulate (color map + detail map) with (shadow map + vertex lighting)
magfilter[3]=linear;
minfilter[3]=linear;
mipfilter[3]=linear;
}
}
";
}




Re: These Shaders Don't Work!!! [Re: Helmet_man] #39832
01/20/05 04:53
01/20/05 04:53
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
How don't they work? what errors are generated? Btw since these aren't shaders but fixed function effects they ought ot work on most any card.

Re: These Shaders Don't Work!!! [Re: Matt_Aufderheide] #39833
01/20/05 05:01
01/20/05 05:01
Joined: Nov 2004
Posts: 35
C:\Earth\United States\Texas (...
Helmet_man Offline OP
Newbie
Helmet_man  Offline OP
Newbie

Joined: Nov 2004
Posts: 35
C:\Earth\United States\Texas (...
I get something like this for both of them:




Re: These Shaders Don't Work!!! [Re: Helmet_man] #39834
01/20/05 05:58
01/20/05 05:58
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
The code is i believe for the Dx8 version of the engine, to convert this Dx9 you may need to make some simple changes, unfortunately i don't what changes are needed for fixed function effects. Maybe someone else


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