Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
normal maps #59565
11/25/05 17:50
11/25/05 17:50
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
Hi All

Done a few searchs but can't find any.

Does anyone have a good normal maps for models script.

Thanks


Re: normal maps [Re: MaxF] #59566
11/25/05 17:55
11/25/05 17:55
Joined: Nov 2005
Posts: 15
R
RaSTaFaRi_87 Offline
Newbie
RaSTaFaRi_87  Offline
Newbie
R

Joined: Nov 2005
Posts: 15
I'm also searching for this shader


VISIT CYBRAS AT www.cybras.de.tt
Re: normal maps [Re: RaSTaFaRi_87] #59567
11/25/05 18:28
11/25/05 18:28
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Try the Sphere Engine! It does all this automatically.


Sphere Engine--the premier A6 graphics plugin.
Re: normal maps [Re: Matt_Aufderheide] #59568
11/26/05 00:07
11/26/05 00:07
Joined: Aug 2005
Posts: 34
AAO Offline
Newbie
AAO  Offline
Newbie

Joined: Aug 2005
Posts: 34
Is there one besides sphere engines?

Re: normal maps [Re: AAO] #59569
11/26/05 17:26
11/26/05 17:26
Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
S
Sebe Offline
Serious User
Sebe  Offline
Serious User
S

Joined: Nov 2003
Posts: 1,380
Switzerland; Zurich
Yes, use the search function - I can't believe that you don't find one o_O

Re: normal maps [Re: Sebe] #59570
11/27/05 09:34
11/27/05 09:34
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline
Serious User
indiGLOW  Offline
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
In all honesty I have had similiar problems locating a normal shader here, I found a few older ones that worked, I had to expand my search and what I did find was full of bugs anyway.

I have noticed a lot of people asking this question and being given the same answer...search for it! lol

I think you can find a Normal shader in the Wiki, so If I was you, and you are having the same problems finding any others, use the one in the Wiki

Hope thats a little more helpful to ya!


The Art of Conversation is dead : Discuss
Re: normal maps [Re: indiGLOW] #59571
11/27/05 19:16
11/27/05 19:16
Joined: Aug 2005
Posts: 34
AAO Offline
Newbie
AAO  Offline
Newbie

Joined: Aug 2005
Posts: 34
Hey I found a specular bump mapping shader on the search here it is

float bumpiness = { 1.0f }; //Stärke des Bumpmappings
float specular_power = { 128.0f }; //Stärke des Lichts (1 = sehr stark, über 1 schwächer)
float Ka = { 1.0f }; //Gesamthelligkeit
float4 specular = { 1.0f, 0.956737f, 0.670380f, 1.0f }; //Specular Farbe
float4 ambient = { 0.37647f, 0.37647f, 0.24314f, 1.0f }; //Ambient Farbe alt: alles 1.0f
float4 diffuse = { 0.37647f, 0.37647f, 0.24314f, 1.0f }; //Diffuse Farbe alt: 0.839216f, 0.862341f, 0.890411f, 1.0f


float Kd = { 1.0f };
float Ks = { 1.0f };
float4 light_position = { -100.0f, 100.0f, -100.0f, 1.0f };
float4 eye_position = { 0.0f, 0.0f, -10.0f, 1.0f };
float4 vecViewPos;
float4 vecSunDir;
float4 vecAmbient;

float4x4 matWorldViewProj: register(c0);
float4x4 matMtl;

texture entSkin1;
texture entSkin2;

struct VS_INPUT_STRUCT
{
float4 position: POSITION;
float3 normal: NORMAL;
float2 texcoord0: TEXCOORD0;
float3 binormal: TEXCOORD1;
float3 tangent: TEXCOORD2;
};

struct VS_OUTPUT_STRUCT
{
float4 position: POSITION;
float2 bump_map: TEXCOORD0;
float3 light_vector: TEXCOORD1;
float3 half_angle: TEXCOORD2;
};

VS_OUTPUT_STRUCT VS( VS_INPUT_STRUCT vsInStruct )
{
VS_OUTPUT_STRUCT vsOutStruct; //** Declare the output struct

//**-----------------------------------------------------------
//** Calculate the pixel position using the perspective matrix.
//**-----------------------------------------------------------
vsOutStruct.position = mul(vsInStruct.position, matWorldViewProj );

//**----------------------------------------------
//** Pass the bump and base texture coords through
//**----------------------------------------------
vsOutStruct.bump_map = vsInStruct.texcoord0;

//**--------------------------------------------
//** Calculate the light vector in object space,
//** and then transform it into texture space.
//**--------------------------------------------
float3 temp_light_position = mul( vecAmbient, matMtl );
float3 temp_light_vector = temp_light_position - vsInStruct.position;
vsOutStruct.light_vector.x = dot( temp_light_vector, vsInStruct.tangent );
vsOutStruct.light_vector.y = dot( temp_light_vector, vsInStruct.binormal );
vsOutStruct.light_vector.z = dot( temp_light_vector, vsInStruct.normal );

//**-------------------------------------------
//** Calculate the view vector in object space,
//** and then transform it into texture space.
//**-------------------------------------------
float3 temp_eye_position = mul( vecViewPos, matMtl );
float3 temp_view_vector = temp_eye_position - vsInStruct.position;
float3 temp_view_vector2;
temp_view_vector2.x = dot( temp_view_vector, vsInStruct.tangent );
temp_view_vector2.y = dot( temp_view_vector, vsInStruct.binormal );
temp_view_vector2.z = dot( temp_view_vector, vsInStruct.normal );

//**-------------------------
//** Calculate the half angle
//**-------------------------
vsOutStruct.half_angle = vsOutStruct.light_vector + temp_view_vector2;

return vsOutStruct; //** Return the resulting output struct
}

sampler base_map = sampler_state
{
texture=(entSkin1);
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
MIPFILTER = LINEAR;
};

sampler bump_map = sampler_state
{
texture=(entSkin2);
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
MIPFILTER = LINEAR;
};

struct PS_INPUT_STRUCT
{
float2 bump_map: TEXCOORD0;
float3 light_vector: TEXCOORD1;
float3 half_angle: TEXCOORD2;
};

struct PS_OUTPUT_STRUCT
{
float4 color0: COLOR0;
};

//**---------------------------------------------------------
//** Function: main
//** Description: Declare the main entry point for the shader
//** Input: PS_INPUT_STRUCT, derived from the output of
//** the associated vertex shader
//** Returns: PS_OUTPUT_STRUCT
//**---------------------------------------------------------
PS_OUTPUT_STRUCT PS( PS_INPUT_STRUCT psInStruct )
{
PS_OUTPUT_STRUCT psOutStruct; //** Declare the output struct

//**------------------------------------------------------
//** Retreive the base color and bump components from the
//** respective textures, based on the passed bump coords.
//**------------------------------------------------------
float3 base = tex2D( base_map, psInStruct.bump_map );
float3 bump = tex2D( bump_map, psInStruct.bump_map );

//**----------------------------------------------------
//** Normalize the passed vectors from the vertex shader
//**----------------------------------------------------
float3 normalized_light_vector = normalize( psInStruct.light_vector );
float3 normalized_half_angle = normalize( psInStruct.half_angle );

//**--------------------------------------------------------
//** "Smooth out" the bump based on the bumpiness parameter.
//** This is simply a linear interpolation between a "flat"
//** normal and a "bumped" normal. Note that this "flat"
//** normal is based on the texture space coordinate basis.
//**--------------------------------------------------------
float3 smooth = { 0.5f, 0.5f, 1.0f };
bump = lerp( smooth, bump, bumpiness );
bump = normalize( ( bump * 2.0f ) - 1.0f );

//**---------------------------------------------------------
//** These dot products are used for the lighting model
//** equations. The surface normal dotted with the light
//** vector is denoted by n_dot_l. The normal vector
//** dotted with the half angle vector is denoted by n_dot_h.
//**---------------------------------------------------------
float4 n_dot_l = dot( bump, normalized_light_vector );
float4 n_dot_h = dot( bump, normalized_half_angle );

//**--------------------------------------
//** Calculate the resulting pixel color,
//** based on our lighting model.
//** Ambient + Diffuse + Specular
//**--------------------------------------
psOutStruct.color0.rgb =
( base * ambient * Ka ) +
( base * diffuse * Kd * max( 0, n_dot_l ) ) +
( specular * Ks * pow( max( 0, n_dot_h ), specular_power ) );
psOutStruct.color0.a = 1.0f; //** Set the alpha component manually

return psOutStruct; //** Return the resulting output struct
}


technique spec_bump
{
pass Single_Pass
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}

Re: normal maps [Re: indiGLOW] #59572
12/05/05 20:16
12/05/05 20: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
Hi

Are normalmapping just for models and Dot3 bump mapping for blocks?


Re: normal maps [Re: MaxF] #59573
12/05/05 20:24
12/05/05 20:24
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
No, you can do dot3 bump mapping via the fixed function pipeline for models as well. This is a good fall back technique when the target system does not support normalmapping via vs/ps shaders.

A6 has problems with shaders on blocks. So I would suggest to use it on models for now.


Models, Textures and Games from Dexsoft
Re: normal maps [Re: Machinery_Frank] #59574
12/06/05 00:16
12/06/05 00: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 Frank_G

Quote:

A6 has problems with shaders on blocks




When will this be fixed, does anyone know


Page 1 of 3 1 2 3

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