Skip to content
Snippets Groups Projects
Commit 38d10798 authored by Patrik Huber's avatar Patrik Huber
Browse files

Added missing tex2d function which takes glm vector types

parent 7d775985
No related branches found
No related tags found
No related merge requests found
......@@ -300,6 +300,14 @@ cv::Vec3f tex2d(const cv::Vec2f& texcoords, const Texture& texture, float dudx,
return (1.0f / 255.0f) * tex2d_linear_mipmap_linear(texcoords, texture, dudx, dudy, dvdx, dvdy);
};
template<typename T, glm::precision P = glm::defaultp>
glm::tvec3<T, P> tex2d(const glm::tvec2<T, P>& texcoords, const Texture& texture, float dudx, float dudy, float dvdx, float dvdy)
{
// Todo: Change everything to GLM.
cv::Vec3f ret = (1.0f / 255.0f) * tex2d_linear_mipmap_linear(cv::Vec2f(texcoords[0], texcoords[1]), texture, dudx, dudy, dvdx, dvdy);
return glm::tvec3<T, P>(ret[0], ret[1], ret[2]);
};
cv::Vec3f tex2d_linear_mipmap_linear(const cv::Vec2f& texcoords, const Texture& texture, float dudx, float dudy, float dvdx, float dvdy)
{
using cv::Vec2f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment