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
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,055 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 4 of 6 1 2 3 4 5 6
Re: Normalmapping (in development) [Re: Matt_Aufderheide] #117180
03/17/07 10:30
03/17/07 10:30
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
Yeah, alternative shader code would solve this, at least, that's how I set up my game. Water for example, starts at 2.0, then goes to 1.1. The 2.0 takes more resources, but you can change quality settings in the menus if you need.

But I guess A7 will be released this year, and possibly the 2.0 version of this code as well. I'm looking forward to this shader code; JCL's past shaders worked great.

@Frank - I don't see any reason why that scene wont eventually be possible with the new FBX importer. Basically you'd just save your lightwave scene as FBX, import that scene in WED, and put your lights in. Hopefully though, the importer will also import omni lights from such programs as Max and Lightwave, then you can set your lights in your modeling program and just use WED for building and setting paths.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: Normalmapping (in development) [Re: Matt_Aufderheide] #117181
03/19/07 15:27
03/19/07 15:27
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Quote:

And who has a pixel shader 1.0 only card? that's ONLY geForce 3 ( all other shader-capable cards supported higher versions like 1.3, 1.4 etc).




Yes, I meant 1.3/1.4 of course. A lot of systems are still below 2.0.

Re: Normalmapping (in development) [Re: jcl] #117182
03/21/07 10:50
03/21/07 10:50
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
This is the promised specular bumpmapping:

Code:
 MATERIAL mtl_bumpspecular
{
effect=
"
#include <transform>
#include <fog>
#include <pos>
#include <normal>
#include <tangent>

float4 vecSunDir;
float4 vecColor;

texture entSkin1; // texture
texture entSkin2; // normal map

sampler sBaseTex = sampler_state { Texture = <entSkin1>; };
sampler sBump = sampler_state { Texture = <entSkin2>; };

struct out_specular
{
float4 Pos: POSITION;
float Fog: FOG;
float4 Color: COLOR;
float2 Tex: TEXCOORD0;
float2 Bump: TEXCOORD1;
float3 Normal: TEXCOORD2;
float3 Halfway:TEXCOORD3;
};

out_specular vs_specular(
in float4 inPos: POSITION,
in float3 inNormal: NORMAL,
in float2 inTex: TEXCOORD0,
in float3 inTangent: TEXCOORD2)
{
out_specular Out;

Out.Pos = DoTransform(inPos);
Out.Tex = inTex;
Out.Bump = inTex; // different coordinates required for ps_1_1
Out.Color = float4(1.0,1.0,1.0,1.0);
Out.Fog = DoFog(inPos);

CreateTangents(inNormal,inTangent);
float3 N = matTangent[2];
Out.Normal = DoTangent(N) * 0.5 + 0.5;

float3 P = DoPos(inPos);
float3 EyeDir = normalize(vecViewPos - P) - vecSunDir;
Out.Halfway = DoTangent(EyeDir) * 0.5 + 0.5;

return Out;
}


float4 ps_specular(out_specular In): COLOR
{
float4 base = tex2D(sBaseTex,In.Tex);
float3 bumpNormal = tex2D(sBump,In.Bump);
float light = saturate(dot(In.Halfway*2 - 1,bumpNormal*2 - 1));
light *= light;
light *= light;
light *= light;
light *= light;
return base *2*light;
}

technique specular
{
pass One
{
VertexShader = compile vs_1_1 vs_specular();
PixelShader = compile ps_1_1 ps_specular();
}
}

";
}



However, here's indeed the shader 2.0 model a better solution - either that, or two passes. Due to the limitation to 4 texture coordinate sets under 1.1, I can not transfer the light coordinates to the pixel shader, which limits the specular shading to a "metal" effect.

You can play with the "2" factor in the pixel shader, or return base + (0.1 + 2*light) for brightening the dark parts of the model.

Re: Normalmapping (in development) [Re: jcl] #117183
03/21/07 11:16
03/21/07 11:16
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Thank you very much. I appreciate that.


Models, Textures and Games from Dexsoft
Re: Normalmapping (in development) [Re: Machinery_Frank] #117184
03/21/07 11:43
03/21/07 11:43
Joined: Aug 2003
Posts: 511
Hilden in Germany
RobH Offline
User
RobH  Offline
User

Joined: Aug 2003
Posts: 511
Hilden in Germany
Thanks for 1000 times JCL. That all makes GS better and better. Everything works great!

Re: Normalmapping (in development) [Re: jcl] #117185
03/21/07 14:17
03/21/07 14:17
Joined: Jul 2002
Posts: 1,364
Minbar
M
MaxF Offline OP
Serious User
MaxF  Offline OP
Serious User
M

Joined: Jul 2002
Posts: 1,364
Minbar
Thanks VERY much JCL, you are the best


Re: Normalmapping (in development) [Re: MaxF] #117186
03/22/07 18:16
03/22/07 18:16
Joined: Jul 2002
Posts: 1,364
Minbar
M
MaxF Offline OP
Serious User
MaxF  Offline OP
Serious User
M

Joined: Jul 2002
Posts: 1,364
Minbar
Thanks JCL it looks and works so GOOD


Re: Normalmapping (in development) [Re: MaxF] #117187
03/24/07 02:25
03/24/07 02:25
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Sweet thanks!

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: Normalmapping (in development) [Re: jcl] #117188
03/24/07 11:40
03/24/07 11:40
Joined: Oct 2006
Posts: 91
G
Ghost Offline
Junior Member
Ghost  Offline
Junior Member
G

Joined: Oct 2006
Posts: 91
Thank you.

Re: Normalmapping (in development) [Re: Ghost] #117189
03/24/07 15:40
03/24/07 15:40
Joined: Jul 2002
Posts: 1,364
Minbar
M
MaxF Offline OP
Serious User
MaxF  Offline OP
Serious User
M

Joined: Jul 2002
Posts: 1,364
Minbar
Well after more testing the shader does not react to any lights. Can you change it so it does, if my level is blue and the model with the shader is white just looks wrong.


Page 4 of 6 1 2 3 4 5 6

Moderated by  old_bill, Tobias 

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