Gamestudio Links
Zorro Links
Newest Posts
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, AndrewAMD, 1 invisible), 18,553 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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