|
sampler2D baseMap;
float fInverseViewportWidth;
float fInverseViewportHeight;
struct PS_INPUT
{
float2 Texcoord : TEXCOORD0;
};
const float4 samples[4] = {
-1.0, 0.0, 0, 0.25,
1.0, 0.0, 0, 0.25,
0.0, 1.0, 0, 0.25,
0.0, -1.0, 0, 0.25
};
float4 ps_main( PS_INPUT Input ) : COLOR0
{
//return tex2D( baseMap, Input.Texcoord );
float4 col = float4(0,0,0,0);
// Sample and output the box averaged colors
for(int i=0;i<4;i++)
col += samples.w*tex2D(baseMap, Input.Texcoord +
float2(samples.x*fInverseViewportWidth,
samples.x*fInverseViewportHeight));
return col;
}
我不是很明白 为什么
float2(samples.x*fInverseViewportWidth,
samples.x*fInverseViewportHeight)
samples 要乘以 fInverseViewportWidth 这样做的意义是什么?
Cheers! |
|