如何通过openGL创建鱼眼镜头效果? [英] How to create fisheye lens effect by openGL?

查看:342
本文介绍了如何通过openGL创建鱼眼镜头效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用openGL在图像上创建lomo鱼眼效果.我是openGL的新手,是否应该使用多维数据集映射和鱼眼投影?我可以参考任何开放源代码吗?谢谢.

I am trying to create lomo fisheye effect on an image using openGL. I am new to openGL, should I use cube mapping and fisheye projection? Is there any open source that I can refer to? Thanks.

推荐答案

您可以绘制一个带有已纹理图像的四边形,并使用片段着色器根据需要扭曲每个像素的纹理坐标.您必须自己做所有的数学运算,但是看起来上一篇文章可能是一个不错的起点.

You can draw a single quad with the image textured onto it, and use a fragment shader to warp the texture coordinate per-pixel as you desire. You'll have to do all the math yourself, but it looks like the previous post here might be a good starting point.

这篇关于如何通过openGL创建鱼眼镜头效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆