From 8460ed713b58854f64c3837992c7cd4f68e04692 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 29 Jul 2016 18:39:13 -1000 Subject: [PATCH] More CSpaceWarpFilter coordinate fixes --- Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp | 11 ++++++++--- hecl | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp b/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp index 493d438b3..e777452e8 100644 --- a/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp +++ b/Runtime/Graphics/Shaders/CSpaceWarpFilter.cpp @@ -112,16 +112,21 @@ void CSpaceWarpFilter::draw(const zeus::CVector2f& pt) 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) */ 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[1][1] = clipRect.x10_height / vp.y; m_uniform.m_matrix[2][0] = pt.x + (1.f / vp.x); m_uniform.m_matrix[2][1] = pt.y + (1.f / vp.y); + + 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[0][0] * m_strength * 0.5f; + 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_uniBuf->load(&m_uniform, sizeof(m_uniform)); diff --git a/hecl b/hecl index b7d5cbb0a..a095b87ca 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit b7d5cbb0ab437ae73391a5a22c6a627cce05df42 +Subproject commit a095b87ca1b3dc4f6291b6f248fcb9260e26eb92