Hello!
I'm trying to implement SSAA by myself. My idea is to draw entire scene few times with different offsets (not always regular, but I would like to test for example checker) to textures and merge them later. And it works in some way... but I don't see difference above 8 samples and I'm pretty sure that MSAA x8 looks much much better than my 64 samples SSAA.
My main suspect is wrong applied offsets. I'm calculating my offsets in range [-0.5,0.5] and then I'm dividing them by half of my resolution. Why half? Because if I think correctly NDC in D3D11 is in range [-1,1] so one pixel is twice as bigger. Then I modify my projection matrix:
void Camera::SetOffset(const DirectX::XMFLOAT2& offset)
{
m_offset = offset;
XMFLOAT4 tmp;
XMStoreFloat4(&tmp, m_projectionMatrix.r[3]);
tmp.x = m_offset.x;
tmp.y = m_offset.y;
m_projectionMatrix.r[3] = XMLoadFloat4(&tmp);
}
And now I'm not sure if translating my projection matrix is a proper way to apply offset... Can you see something wrong in my thinking or it's bug somewhere in my code?