像素化pixel shader

void MyFragmentShader9(float2 uv : TEXCOORD0,
out float4 color : COLOR,
uniform sampler2D texture,
uniform float numpixels)
{

float num = numpixels;

float stepsize = 1.0/num;
float2 fragment = float2(stepsize * floor(uv.x * num),stepsize *floor(uv.y * num));
color = tex2D(texture, fragment);
}

你可能感兴趣的:(像素化pixel shader)