source: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollps.hlsl @ 2417

Revision 2417, 1.1 KB checked in by szirmay, 18 years ago (diff)
Line 
1#define MAX_LIGHT 2
2#define MAX_CAU_CASTER 2
3#define SPOT_ANGLE 2.093
4#define SPOT_FALLOFF 1
5#define SHADOW_COLOR float4(0.3,0.3,0.3,1.0)
6#define SHADOW_BIAS_POINT 0.0001
7#define SHADOW_EPSILON_POINT 0.0001
8
9uniform sampler2D colorTexture : register(s0);
10uniform sampler2D bumpMap : register(s1);
11
12uniform float4 lightRange;
13uniform float lightPower;
14uniform float4 lightColor;
15
16uniform float specularity;
17uniform float albedo;
18uniform float4 specularColor;
19
20#include "illum.hlsl"
21
22struct Troll_PS_IN
23{
24        float2 texCoord:TEXCOORD0;
25        float3 tangent:TEXCOORD1;
26        float3 binormal:TEXCOORD2;
27        float3 normal:TEXCOORD3;
28        float3 V: TEXCOORD4;
29        float3 L: TEXCOORD5;
30};
31
32float4 Troll_PS(Troll_PS_IN IN):COLOR
33{
34        float4 Color = 0;
35        float3 N = normalize(IN.normal);//NormalMap(IN.tangent, IN.binormal, IN.normal, IN.texCoord, bumpMap);
36        float dist = length(IN.V);
37        float3 V = IN.V /dist;
38        float3 L = IN.L;
39       
40        float4 diffuseColor = albedo * tex2D(colorTexture, IN.texCoord);
41       
42        Color = Illumination(N, L, V, lightColor * lightPower, lightRange, diffuseColor, specularity, specularColor);
43       
44        float4 ret =  Color;
45        return float4(ret.xyz, dist);
46}
Note: See TracBrowser for help on using the repository browser.