使用 OpenGL-ES 的绘画应用程序中的模糊效果(湿中湿效果)
我正在使用 OpenGL-ES for iPhone 开发 Paint 应用程序,我想实现高斯模糊效果(湿中湿)进行绘画。请查看描述我对模糊效果的要求的图像:
我尝试搜索如何使用 OpenGL 功能,但没有找到得到任何东西。任何人都可以指导我在这个问题上找到正确的方向..任何形式的帮助或建议将不胜感激..谢谢..
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..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够以像素间隔多次渲染相同的笔触,以获得您想要的效果。如果使用高斯分布抖动渲染,您将得到高斯模糊。
这类似于使用累积缓冲区的抖动抗锯齿,但您可以使用与您想要的模糊效果一样大的多像素偏移,而不是使用子像素偏移。您可能需要渲染大约 16 次才能使其看起来平滑。 http://www.opengl.org/resources/code /samples/advanced/advanced97/notes/node63.html
这也与通过抖动创建运动模糊类似(或者实际上是同一件事)。 http://glprogramming.com/red/chapter10.html
你甚至不需要使用这里有一个单独的累积缓冲区,只需使用 alpha 渲染每个通道,累加起来就是实体。要记住的一件事是,您希望始终在相同的偏移量上抖动,以便连续的帧看起来相同(即,如果您使用随机偏移量,那么每个帧都会有稍微不同的模糊效果)。
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).
我假设您想将其应用到图像上。我不知道如何在
OpenGL ES
中完成此操作。但您可以尝试使用这个很棒的图像处理库。它提供除高斯模糊之外的其他图像效果...快乐模糊...
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...