Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Shader help plllllllz #42654
03/15/05 04:57
03/15/05 04:57
Joined: Jan 2003
Posts: 798
New Zealand
Bright Offline OP
User
Bright  Offline OP
User

Joined: Jan 2003
Posts: 798
New Zealand
Hi all,
Ive made my first pixal shader.
But I have a question.

I cannot upload a picture at this current time but heres the code that ive programmed from a tutorial:
Code:
 
Material ShinyTiles
{
Skin1 = AlphaMap;
Skin2 = EffectMap;
Effect"
Texture entSkin1;
Texture entSkin2;
Texture mtlSkin1;
Texture mtlSkin2;

Technique Test
{
Pass P0
{
Texture[0] = <entSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <mtlSkin1>;
Texture[3] = <mtlSkin2>;

TexCoordIndex[0] = 1;
TexCoordIndex[1] = 0;
TexCoordIndex[2] = 1;
TexCoordIndex[3] = 1 ;
PixelShader = asm
{
ps_1_2

tex t0
texdp3tex t1,t0

dp3 r0,t1,t0
};
}
}
";
}



What I want to do is have the shiny floor move with the camera when the camera looks at it in another position. Could I do this by adding something like CAMERA_POSITION somewhere?

Thanks
-Bright



KAIN - Coming soon...
Re: Shader help plllllllz [Re: Bright] #42655
03/16/05 03:27
03/16/05 03:27
Joined: May 2003
Posts: 609
Rattenfängerstadt
Rigoletto Offline
Developer
Rigoletto  Offline
Developer

Joined: May 2003
Posts: 609
Rattenfängerstadt
Do you mean this?

material ShinyTiles
{
skin1 = alphamap;
skin2 = effectmap;

effect
"
texture entSkin1; // block texture
texture entSkin2; // shadow texture
texture mtlSkin1; // alpha texture (not used)
texture mtlSkin2; // shiny texture

matrix matMtl;



technique test
{
pass p0
{
Texture[0] = <entSkin1>;
Texture[1] = <entSkin2>;
Texture[2] = <mtlSkin1>;
Texture[3] = <mtlSkin2>;

TexCoordIndex[0] = 1; //
TexCoordIndex[1] = 0; // For shadow must be 0 (i don´t know why, can anyone explain)
TexCoordIndex[2] = 1; //
TexCoordIndex[3] = 1; //

PixelShader = asm
{
ps_1_2

tex t0
tex t1

texdp3tex t3,t0

dp3 r0,t3,t0
mul r0, r0, t1
};

texCoordIndex[3]=cameraSpaceReflectionVector;
textureTransform[3]=<matMtl>;
}
}
";
}

Re: Shader help plllllllz [Re: Rigoletto] #42656
03/16/05 07:58
03/16/05 07:58
Joined: Jan 2003
Posts: 798
New Zealand
Bright Offline OP
User
Bright  Offline OP
User

Joined: Jan 2003
Posts: 798
New Zealand
WOW, that looks great on the shader, thanks mate

But I was wondering, since im still learning shaders, are there any more functions that I can add that are similar to cameraSpaceReflectionVector?
Like making a texture always move along a surface (like for water and waterfalls).

Thanks


KAIN - Coming soon...

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