GLSL 图像处理

文章转载于:https://r3dux.org/2011/06/glsl-image-processing/


Image Processing Vertex Shader

Image Processing Fragment Shader

The only other bit of code worth mentioning is the generation of the texture coordinate offsets, which is accomplished with the following C++ code (yes, it’s kinda ugly – no, I didn’t write it – yes, it works):

You can then draw your full-screen quad something like this:

Job’s a good ‘un.


你可能感兴趣的:(C/C++)