How to create fisheye lens effect by openGL?

2019-01-24 15:32发布

问题:

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.

回答1:

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.