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 (TipmyPip), 18,388 guests, and 6 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
How to convert .FX files to GameStudio? #24012
03/07/04 20:25
03/07/04 20:25
Joined: Oct 2003
Posts: 23
Shurik Offline OP
Newbie
Shurik  Offline OP
Newbie

Joined: Oct 2003
Posts: 23
I try using codes from .fx files unsuccessfully, can anybody explain how to convert it for GameStudio?
I'm not programmer, what good beginner tutorials for understanding it?


technique ToonShade
{
pass p0
{
VertexShaderConstant[0] = <wvp>;
VertexShaderConstant[4] = <worldIT>;
VertexShaderConstant[8] = <world>;
VertexShaderConstant[12] = <lightPos>;
VertexShaderConstant[13] = {1.0,0.0,0.0,0.0};

VertexShaderConstant[11] = {1.1,1.1,0.6,0.0};

VertexShaderConstant[14] = <diffuseMaterial>;

VertexShaderConstant[16] = <viewInvTrans>;

VertexShader =
asm
{
vs.1.1

dcl_position v0
dcl_normal v3
dcl_texcoord0 v7
dcl_tangent0 v8
dcl_binormal0 v9
dcl_color0 v5

// Transform pos to screen space.
m4x4 oPos, v0, c0

// Normal to world space:
dp3 r0.x, v3, c4
dp3 r0.y, v3, c5
dp3 r0.z, v3, c6

// normalize normal
dp3 r0.w, r0, r0
rsq r0.w, r0.w
mul r0, r0, r0.w // r0 has normalized normal.

// vpos to world space.
dp4 r1.x, v0, c8
dp4 r1.y, v0, c9
dp4 r1.z, v0, c10
dp4 r1.w, v0, c11 // r1 has position in world space.

// eye vector, normalize.
add r2, c19, -r1

//mul r2, r2, c11 - temp fix for ogl.

dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w // r2 has normalized eye vector.

add r3, c12, -r1
dp3 r3.w, r3, r3
rsq r3.w, r3.w
mul r3, r3, r3.w

// L dot N.
dp3 oT0.y, r3, -r0

// E dot N
dp3 oT0.x, r2, r0

mov oD0, c14
};

ZEnable = true;
ZWriteEnable = true;
AlphaBlendEnable = false;
CullMode = None;
Lighting = false;

Texture[0] = <toonshade>;
MinFilter[0] = Linear;
MagFilter[0] = Linear;
MipFilter[0] = Linear;
AddressU[0] = Clamp;
AddressV[0] = Clamp;

ColorOp[0] = Modulate;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;

AlphaOp[0] = SelectArg1;
AlphaArg1[0] = Texture;
AlphaArg2[0] = Diffuse;

}
}


Re: How to convert .FX files to GameStudio? [Re: Shurik] #24013
03/08/04 01:30
03/08/04 01:30
Joined: Aug 2003
Posts: 183
BionicHero Offline
Member
BionicHero  Offline
Member

Joined: Aug 2003
Posts: 183
I'm not really familiar with this whole shader stuff but does it make a difference if you move the fixed function stuff in front of the shader code?

Re: How to convert .FX files to GameStudio? [Re: Shurik] #24014
03/08/04 16:39
03/08/04 16:39
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
have a look at the examples! you will find out whats wrong. for example dcl_... -dont use this. u need a stream . and did you define matrixes and vectors before the technique? you have to do so and you have to do it in the needed way. like matrix matWorldViewProj; look into the latest manual at the very beginning there are all informations about this.


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.

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