[2386] | 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;
|
---|
[2417] | 17 | uniform float albedo;
|
---|
[2386] | 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;
|
---|
[2389] | 35 | float3 N = normalize(IN.normal);//NormalMap(IN.tangent, IN.binormal, IN.normal, IN.texCoord, bumpMap);
|
---|
[2398] | 36 | float dist = length(IN.V);
|
---|
| 37 | float3 V = IN.V /dist;
|
---|
[2386] | 38 | float3 L = IN.L;
|
---|
| 39 |
|
---|
[2417] | 40 | float4 diffuseColor = albedo * tex2D(colorTexture, IN.texCoord);
|
---|
[2386] | 41 |
|
---|
| 42 | Color = Illumination(N, L, V, lightColor * lightPower, lightRange, diffuseColor, specularity, specularColor);
|
---|
| 43 |
|
---|
[2417] | 44 | float4 ret = Color;
|
---|
[2398] | 45 | return float4(ret.xyz, dist);
|
---|
[2386] | 46 | } |
---|