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

@@ -119,7 +119,7 @@ std::vector<vertex_t> poly_intersect(const std::vector<vertex_t>& poly, const st
glm::vec2 hit_uv;
segments_intersect(edge[0], edge[1], s[0].pos, s[1].pos, pt, hit_uv);
vertex_t v;
v.pos = glm::vec4(pt, 0, 1);
v.pos = glm::lerp(s[0].pos, s[1].pos, hit_uv.y);
v.uvs = glm::lerp(s[0].uvs, s[1].uvs, hit_uv.y);
v.uvs2 = glm::lerp(s[0].uvs2, s[1].uvs2, hit_uv.y);
if (side0) // outgoing