使用OpenGL-ES在涂料应用中的模糊效果(湿润效果) [英] Blur Effect (Wet in Wet effect) in Paint Application Using OpenGL-ES

查看:138
本文介绍了使用OpenGL-ES在涂料应用中的模糊效果(湿润效果)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 OpenGL-ES iPhone 开发Paint应用程序,我想实现高斯模糊效果(Wet in Wet)进行绘画。请查看描述我对模糊效果的要求的图像:

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 :

我试图搜索OpenGL函数的方法,但没有得到任何结果。任何人都可以指导我在这个问题上找到正确的方向..任何形式的帮助或建议都将受到高度赞赏..谢谢..

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..

推荐答案

您应该可以将相同的画笔笔划分开多次像素,以获得所需的效果。如果你使用高斯分布抖动渲染器,你将得到高斯模糊。

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.

这类似于带有累积缓冲区的抖动抗锯齿,但不是使用子像素偏移你会使用像您想要的模糊效果一样大的多像素偏移。您可能希望渲染大约16次以使其看起来平滑。 http://www.opengl.org/resources/code /samples/advanced/advanced97/notes/node63.html

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

这与创建运动模糊的抖动类似(或实际上相同)。 http://glprogramming.com/red/chapter10.html

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

你甚至不需要在这里使用单独的累积缓冲区,只需渲染每次传递的alpha加起来就是实体。有一点要记住,你想要总是在相同的偏移上抖动,这样连续的帧看起来是一样的(即如果你使用随机偏移,那么每帧的模糊效果都会略有不同)。

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在涂料应用中的模糊效果(湿润效果)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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