I was reading the presentation for Killzone Shadow Fall and I have a question about their temporal upscaling solution. In the slides they state they render two 960x1080 buffers with one containing odd pixels and the other containing even pixels. I am a little confused how you would do this. I know how you can just write odd or even pixels to the framebuffer using something like this:
But how would you have a buffer filled entirely with just odd pixels and not have "gaps" where the even pixels would be? Could someone explain this to me? Its probably something obvious I am just not understanding.
Code:
// Default color is fully transparent
float4 color = 0;
// Scale to int texture size, add x and y
float2 vpos = texCoord * TextureSize * 0.5f;
float vposSum = vpos.x + vpos.y;
// Calc diff between rounded half and half to get 0 or 0.5
float diff = round(vposSum) - vposSum;
float diffSq = diff * diff;
// Even or odd? Only even pixels are sampled
if(diffSq < 0.1)
{
color = tex2D(TexSampler, texCoord);
}
return color;
But how would you have a buffer filled entirely with just odd pixels and not have "gaps" where the even pixels would be? Could someone explain this to me? Its probably something obvious I am just not understanding.