Blur Effect (Wet in Wet effect) in Paint Application Using OpenGL-ES

回眸只為那壹抹淺笑 提交于 2019-12-17 19:56:10

问题


I am developing Paint application using OpenGL-ES for iPhone and i want to implement Gaussian blur effect(Wet in Wet) for painting. Please have look at the image describing my requirement for Blur effect :

I tried to search how for OpenGL function but did not get anything. Can anyone guide me to a right direction in this problem.. Any kind of help or suggestion will be highly appreciated.. Thanks..


回答1:


You should be able to render the same brush stroke many times pixels apart to get the effect you want. If you jitter the renders with a Gaussian distribution you will get a Gaussian blur.

This would be similar to jitter antialiasing with an accumulation buffer, but instead of using subpixel offsets you would use multi-pixel offsets as big as you want the blur effect. You'd would want to probably render around 16 times to make it look smooth. http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node63.html

This is also similar(or really the same thing) as jittering to create motion blur. http://glprogramming.com/red/chapter10.html

You wouldn't even NEED to use a separate accumulation buffer here, just render each pass with alpha that adds up to solid. One thing to remember, you want to always jitter across the same offsets so that successive frames look the same(i.e. if you are using random offsets then every frame will have slightly different blur effect).




回答2:


I am assuming you would want to apply this on an Image. I have no idea how this could be done in OpenGL ES. But you could try using this awesome image processing library. It provides other image effects other than Guassian-Blur...

Happy Blurring...



来源:https://stackoverflow.com/questions/6980402/blur-effect-wet-in-wet-effect-in-paint-application-using-opengl-es

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!