c# - Mapping UV to a bulged triangle strip -
i don't know if "bulged" correct term it's can think of right now. i'm trying map 1-pixel wide (though technically every texture have problem) image along triangle strip simulate laser. when it's uniform , square, how looks:
and wireframe of that:
but problem arises when slide points inwards. uv wrong, since tries map if triangle horizontal.
and wireframe of that:
right can't think of term search work out how i'd map it. want map stripe shrinks along strip itself, not frontal mapping. tips? i'm sure it's easy i'm not able think of right now.
you want perspective correct texture mapping. see affine transformation, doesn't take depth account.
this link explains problem , suggests how solve it:
http://www.reedbeta.com/blog/2012/05/26/quadrilateral-interpolation-part-1/
i did myself recall pass 3rd attribute in addition uv coordinates have homogeneous texture vector passed vertex shader fragment shader. in fragment shader divide uv 3rd argument , use sample texture.
sadly don't have code in front of me best do. page linked should lead solution.
Comments
Post a Comment