implement perspective correct interpolation to the 2D window space clipped brush stroke sample.

This commit is contained in:
2018-11-15 18:09:19 +01:00
parent 18067726b5
commit 8f9422b6d6
5 changed files with 162 additions and 22 deletions

View File

@@ -101,6 +101,8 @@ void NodeCanvas::draw()
for (int plane_index = 0; plane_index < 6; plane_index++)
{
m_canvas->m_plane_unproject[plane_index] = glm::inverse(m_canvas->m_proj * m_canvas->m_mv * m_canvas->m_plane_transform[0]);
m_canvas->m_plane_dir[plane_index] = -(m_canvas->m_plane_transform[plane_index] * glm::vec4(m_canvas->m_plane_origin[plane_index], 1));
auto plane_mvp = proj * camera *
glm::scale(glm::vec3(m_canvas->m_order.size() + 500)) *
m_canvas->m_plane_transform[plane_index] *