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 |
|
---|
9 | uniform sampler2D colorTexture : register(s0);
|
---|
10 | uniform sampler2D bumpMap : register(s1);
|
---|
11 |
|
---|
12 | uniform float4 lightRange;
|
---|
13 | uniform float lightPower;
|
---|
14 | uniform float4 lightColor;
|
---|
15 |
|
---|
16 | uniform float specularity;
|
---|
17 | uniform float albedo;
|
---|
18 | uniform float4 specularColor;
|
---|
19 |
|
---|
20 | #include "illum.hlsl"
|
---|
21 |
|
---|
22 | struct 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 |
|
---|
32 | float4 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 | } |
---|