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
0 registered members (), 17,758 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
Page 8 of 9 1 2 3 4 5 6 7 8 9
Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Bright] #30318
05/29/05 21:29
05/29/05 21:29
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Quote:

The tutorial link is broken for me




I may upload a dx9 version of the tutorial with a small demo even if I never get the little problem that it has fixed.
I'll also include the dx8 version.

Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Drew] #30319
06/16/05 02:15
06/16/05 02:15
Joined: Jun 2003
Posts: 51
Ohio
Mantis1967 Offline
Junior Member
Mantis1967  Offline
Junior Member

Joined: Jun 2003
Posts: 51
Ohio
I emailed Drew for this tutorial and he said he didn't have it anymore, if any one still has it I would be very grateful I you could share. Thanks in advance.

Mantis


Imagination is more important than knowledge...
Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Mantis1967] #30320
06/16/05 02:21
06/16/05 02:21
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Quote:

I emailed Drew for this tutorial and he said he didn't have it anymore, if any one still has it I would be very grateful I you could share. Thanks in advance.

Mantis




I have it and I have converted it to dx9... it has a prob though.

If you want the dx8 version you can contact me through msn messenger.
My msn address is humansandbag@hotmail.com

Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Josh_Arldt] #30321
06/19/05 21:00
06/19/05 21:00
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Could you please post your code, the DX9 adapted version??
I've had similar problems with adding fog and that's almost fixed now, maybe I can be of some use?


Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: PHeMoX] #30322
06/20/05 06:59
06/20/05 06:59
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
I seem to have lost the code do to a system restore.
No worries though. I'll just convert it again and have it posted here soon enough.

Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Josh_Arldt] #30323
06/21/05 12:22
06/21/05 12:22
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Josh, I guess you will stick to ASM anyways, but I've found this one somewhere on my harddisk. It should work too...

Code:
 /**************************************************************/

// HLSL NormalMapping Shader

// -------------------------

// By: Daniel "Rhuarc" Niezgocki

// Requires: []VS 1.1

// []PS 1.4

// Skin1: Texture

// Skin2: Normal Map

//

// Usage: Free to use, credit is nice, but not required.

/**************************************************************/





function normalMap_init

{

mat_inverse(mtl.matrix, matWorld);

}





material normalMap_fx {

flags=tangent;

event = normalMap_init;





effect="

// VertexShader ------------------


float4x4 matWorldViewProj;

float4x4 matWorld;

float4 vecSunPos;

float4 vecViewPos;

float4x4 matMtl;


texture entSkin1;

texture entSkin2;


sampler base_map = sampler_state

{

texture = (entSkin1);

};


sampler bump_map = sampler_state

{

texture = (entSkin2);

};


struct VS_INPUT_STRUCT

{

float4 position : POSITION;

float3 normal : NORMAL;

float3 texcoord0 : TEXCOORD0;

float3 tangent : TEXCOORD2;

};


struct VS_OUTPUT_STRUCT

{

float4 position : POSITION;

float2 bump_map : TEXCOORD0;

float3 light_angle : TEXCOORD1;

};


VS_OUTPUT_STRUCT mainVS( VS_INPUT_STRUCT vsInStruct )

{

VS_OUTPUT_STRUCT vsOutStruct;

vsOutStruct.position = mul( vsInStruct.position, matWorldViewProj );


float3 position = mul( matWorld, vsInStruct.position );


vsOutStruct.bump_map = vsInStruct.texcoord0;


float3 light_normal_vector = mul( vsInStruct.normal, matWorld );


vsOutStruct.light_angle = light_normal_vector;


return vsOutStruct;

};


// PixelShader -------------------


float bumpiness = 0.5;

float specular = 0.5;

float4 vecAmbient;

float4 vecDiffuse;

float4 vecSpecular;

float vecViewDir;

struct PS_INPUT_STRUCT

{

float2 bump_map : TEXCOORD0;

float3 light_angle : TEXCOORD1;

};


struct PS_OUTPUT_STRUCT

{

float4 color0 : COLOR0;

};


PS_OUTPUT_STRUCT mainPS( PS_INPUT_STRUCT psInStruct )

{

PS_OUTPUT_STRUCT psOutStruct;


float3 base = tex2D( base_map, psInStruct.bump_map );

float3 bump = tex2D( bump_map, psInStruct.bump_map );


// Uncompress vectors ([0, 1] -> [-1, 1])

float3 lightVectorFinal = (psInStruct.light_angle - 0.5);

float3 bumpNormalVectorFinal = bumpiness * (bump - 0.5);


// Compute diffuse factor

float diffuse = dot(bumpNormalVectorFinal, lightVectorFinal);


psOutStruct.color0.rgb = ( diffuse * base + + max(diffuse-specular,0));

psOutStruct.color0.a = 1.0f;

return psOutStruct;

};


technique normalMap

{

pass P0

{

VertexShader = compile vs_1_1 mainVS();

PixelShader = compile ps_1_4 mainPS();

}

}

";

}



action normalMap_ent

{

my.material = normalMap_fx;

}




PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: PHeMoX] #30324
06/23/05 06:26
06/23/05 06:26
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Thanks PHeMoX.
This could be usefull.

Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Josh_Arldt] #30325
06/23/05 08:55
06/23/05 08:55
Joined: Jan 2003
Posts: 1,142
California
Daedelus Offline
Senior Developer
Daedelus  Offline
Senior Developer

Joined: Jan 2003
Posts: 1,142
California
Phemox, That NormalMapping Shader is cool w/DX9?
Didn't appear so after a quick test.

Last edited by Daedelus; 06/23/05 09:37.

Formula Games - A place to buy and sell Indie games.
Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Daedelus] #30326
06/23/05 19:16
06/23/05 19:16
Joined: Sep 2004
Posts: 1,214
Austin, Texas
Josh_Arldt Offline
Senior Developer
Josh_Arldt  Offline
Senior Developer

Joined: Sep 2004
Posts: 1,214
Austin, Texas
Quote:

Phemox, That NormalMapping Shader is cool w/DX9?
Didn't appear so after a quick test.




That's an old normal mapping shader that Rhuarc wrote.
It doesn't have dynamic lighting or static lighting, so it may not be usefull to you.

Re: Per Pixel / Normal Mapping Tutorial v1.1.. [Re: Josh_Arldt] #30327
07/01/05 07:56
07/01/05 07:56
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
I have the tutorial from Drew , the original one , If anyone needs it let me know

Edit: Just saw steempipe's link to it , lol , btw , I'm getting the all black models error as well , Geforce FX 5200 Ultra Vid Card, DirectX9 , did anyone figure out how to fix this ?

Last edited by Why_Do_I_Die; 07/01/05 08:17.
Page 8 of 9 1 2 3 4 5 6 7 8 9

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