|
@@ -28,7 +28,8 @@ float outerAngleCos;
|
|
|
//control the brightness of the light
|
|
|
float lightIntensity = 1.0f;
|
|
|
|
|
|
-DECLARE_TEXTURE(colorMap, 0) = sampler_state
|
|
|
+texture2D colorMap : register(t0);
|
|
|
+sampler colorMapSampler : register(s0) = sampler_state
|
|
|
{
|
|
|
Texture = (colorMap);
|
|
|
AddressU = CLAMP;
|
|
@@ -39,7 +40,8 @@ DECLARE_TEXTURE(colorMap, 0) = sampler_state
|
|
|
};
|
|
|
|
|
|
// normals, and specularPower in the alpha channel
|
|
|
-DECLARE_TEXTURE(normalMap, 1) = sampler_state
|
|
|
+texture2D normalMap : register(t1);
|
|
|
+sampler normalMapSampler : register(s1) = sampler_state
|
|
|
{
|
|
|
Texture = (normalMap);
|
|
|
AddressU = CLAMP;
|
|
@@ -50,7 +52,8 @@ DECLARE_TEXTURE(normalMap, 1) = sampler_state
|
|
|
};
|
|
|
|
|
|
//depth
|
|
|
-DECLARE_TEXTURE(depthMap, 2) = sampler_state
|
|
|
+texture2D depthMap : register(t2);
|
|
|
+sampler depthMapSampler : register(s2) = sampler_state
|
|
|
{
|
|
|
Texture = (depthMap);
|
|
|
AddressU = CLAMP;
|
|
@@ -60,7 +63,6 @@ DECLARE_TEXTURE(depthMap, 2) = sampler_state
|
|
|
Mipfilter = POINT;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
struct VertexShaderInput
|
|
|
{
|
|
|
float3 Position : POSITION0;
|
|
@@ -97,17 +99,17 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
|
|
texCoord -=halfPixel;
|
|
|
|
|
|
//get normal data from the normalMap
|
|
|
- float4 normalData = SAMPLE_TEXTURE(normalMap,texCoord);
|
|
|
+ float4 normalData = tex2D(normalMapSampler, texCoord);
|
|
|
//tranform normal back into [-1,1] range
|
|
|
float3 normal = 2.0f * normalData.xyz - 1.0f;
|
|
|
|
|
|
//get specular power
|
|
|
float specularPower = normalData.a * 255;
|
|
|
//get specular intensity from the colorMap
|
|
|
- float specularIntensity = SAMPLE_TEXTURE(colorMap,texCoord).a;
|
|
|
+ float specularIntensity = tex2D(colorMapSampler, texCoord).a;
|
|
|
|
|
|
//read depth
|
|
|
- float depthVal = SAMPLE_TEXTURE(depthMap,texCoord).r;
|
|
|
+ float depthVal = tex2D(depthMapSampler, texCoord).r;
|
|
|
|
|
|
//compute screen-space position
|
|
|
float4 position;
|