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,633 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
Ati Shaders #62241
01/18/06 00:53
01/18/06 00:53
Joined: Aug 2005
Posts: 34
AAO Offline OP
Newbie
AAO  Offline OP
Newbie

Joined: Aug 2005
Posts: 34
Hello, I was sondering if a shader like this ati one could be used in gamestudio, or if changes were nececarry

//------------------------------------------------------------------------------
// LightEffect.fx
//
// This file contains the shaders to render the light...it does not do light effects...
// it just renders teh light object.
//
// $Header$
//
// Marwan Y. Ansari - ATI Research, Inc. - 2003
//------------------------------------------------------------------------------



float4x4 world_view_matrix : WORLDVIEWMATRIX;
float4x4 world_view_proj_matrix : WORLDVIEWPROJECTION;

//=============================================================================
struct VS_INPUT
{
float4 position:POSITION;
float4 diffuse:COLOR;
float3 normal:NORMAL;
float4 tex0 :TEXCOORD0;
};
struct VS_OUTPUT
{
float4 position :POSITION;
float4 diffuse :COLOR;
float4 tex0 :TEXCOORD0;
};
struct PS_INPUT
{
float4 diffuse :COLOR;
float4 tex0 :TEXCOORD0;
};
//=============================================================================
VS_OUTPUT LightVertexShader( VS_INPUT In )
{
VS_OUTPUT Out = (VS_OUTPUT) 0;

float4 pos = In.position;
float3 normal;
float3 lightVector;

// transform position to screen space.
Out.position = mul( pos,world_view_proj_matrix );

// Just to visualize the light, shade the light as if there is another light
lightVector = mul( -pos, world_view_matrix);
normal = normalize(mul( In.normal,world_view_matrix));

Out.diffuse = (max( dot(normal,lightVector),0));
Out.tex0 = In.tex0;

return Out;

}
//=============================================================================
float4 DefaultPixelShader( PS_INPUT In ) : COLOR
{
float4 c= {.5,0,0,0};
c.xy = In.diffuse;
return c;
}
//=============================================================================
technique DefaultLightTech
{
pass P0
{
VertexShader = compile vs_2_0 LightVertexShader();
PixelShader = compile ps_2_0 DefaultPixelShader();
}
}
//===========================================================================================

Re: Ati Shaders [Re: AAO] #62242
01/18/06 03:31
01/18/06 03:31
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Yes some changes are needed here...


Sphere Engine--the premier A6 graphics plugin.

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