More CSpaceWarpFilter coordinate fixes

This commit is contained in:
Jack Andersen 2016-07-29 18:39:13 -10:00
parent 03671ce5e1
commit 8460ed713b
2 changed files with 9 additions and 4 deletions

View File

@ -112,8 +112,6 @@ void CSpaceWarpFilter::draw(const zeus::CVector2f& pt)
m_uniform.m_indXf[1][1] = clipRect.x10_height / oldH; m_uniform.m_indXf[1][1] = clipRect.x10_height / oldH;
} }
CGraphics::ResolveSpareTexture(clipRect);
/* Transform UV coordinates of rectangle within viewport and sampled scene texels (clamped to viewport bounds) */ /* Transform UV coordinates of rectangle within viewport and sampled scene texels (clamped to viewport bounds) */
zeus::CVector2f vp{CGraphics::g_ViewportResolution.x, CGraphics::g_ViewportResolution.y}; zeus::CVector2f vp{CGraphics::g_ViewportResolution.x, CGraphics::g_ViewportResolution.y};
m_uniform.m_matrix[0][0] = clipRect.xc_width / vp.x; m_uniform.m_matrix[0][0] = clipRect.xc_width / vp.x;
@ -121,7 +119,14 @@ void CSpaceWarpFilter::draw(const zeus::CVector2f& pt)
m_uniform.m_matrix[2][0] = pt.x + (1.f / vp.x); m_uniform.m_matrix[2][0] = pt.x + (1.f / vp.x);
m_uniform.m_matrix[2][1] = pt.y + (1.f / vp.y); m_uniform.m_matrix[2][1] = pt.y + (1.f / vp.y);
m_uniform.m_strength.x = m_uniform.m_matrix[0][0] * m_strength * 0.5f; if (clipRect.x4_left + clipRect.xc_width < CGraphics::g_ViewportResolution.x)
clipRect.xc_width += 1;
if (clipRect.x8_top + clipRect.x10_height < CGraphics::g_ViewportResolution.y)
clipRect.x10_height += 1;
CGraphics::ResolveSpareTexture(clipRect);
m_uniform.m_strength.x = m_uniform.m_matrix[1][1] * m_strength * 0.5f;
m_uniform.m_strength.y = m_uniform.m_matrix[1][1] * m_strength * 0.5f; m_uniform.m_strength.y = m_uniform.m_matrix[1][1] * m_strength * 0.5f;
m_uniBuf->load(&m_uniform, sizeof(m_uniform)); m_uniBuf->load(&m_uniform, sizeof(m_uniform));

2
hecl

@ -1 +1 @@
Subproject commit b7d5cbb0ab437ae73391a5a22c6a627cce05df42 Subproject commit a095b87ca1b3dc4f6291b6f248fcb9260e26eb92