iPhone 4S上的GPUImage Kuwahara过滤器 [英] GPUImage Kuwahara filter on iPhone 4S

查看:134
本文介绍了iPhone 4S上的GPUImage Kuwahara过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Brad Larson的GPUImage框架。但是,当我尝试应用 kuwahara 过滤器,过滤器半径 5.0f 时,我在iPhone上获得了工件4S。 (适用于性能更高的设备)

I'm using Brad Larson's GPUImage framework. However when I'm trying to apply kuwahara filter with filter radius 5.0f , I'm getting artifacts on an iPhone 4S. (works fine on higher performance devices)

源图像尺寸 2048x2048px。

通过阅读原始开发人员的评论,我了解到有一种看门狗计时器会在GPU上运行太长时间时触发。

By reading original developer's comments I understood that there's a kind of watchdog timer which fires when something takes too long to run on the GPU.

所以我的问题是,iPhone 4S的最大可能分辨率是多少我可以应用 Kuwahara 过滤器,半径 5.0f 没有得到工件?

So my question is , what is the maximum possible resolution for an iPhone 4S I can apply Kuwahara filter with radius of 5.0f without getting artifacts ?

推荐答案

确实没有硬限制。您看到的平铺工件是由于OpenGL ES看门狗定时器在花费太长时间后中止场景渲染。如果你有一个渲染时间超过大约2秒的帧,你的帧渲染将以这种方式被杀死。

There really isn't a hard limit. The tiling artifacts you are seeing are due to the OpenGL ES watchdog timer aborting the scene rendering after it takes too long. If you have a single frame that takes longer than approximately 2 seconds to render, your frame rendering will be killed in this manner.

它所需的确切时间是硬件功能,系统负载,着色器复杂性和iOS版本。在GPUImage中,你几乎只能用Kuwahara过滤器看到这个,因为我使用了那个荒谬的未经优化的着色器。它来自使用桌面GPU执行此操作的出版物,并且是关于像这样的移动GPU的最坏情况操作。有人贡献了一个固定半径版本,速度要快得多,但如果你想在除最新设备之外的任何东西上使用大图像,你需要创建自己的优化版本。

The exact time it takes is a function of hardware capabilities, system load, shader complexity, and iOS version. In GPUImage, you pretty much only see this with the Kuwahara filter because of the ridiculously unoptimized shader I use for that. It's drawn from a publication that was doing this using desktop GPUs, and is about the worst case operation for a mobile GPU like these. Someone contributed a fixed-radius version of this which is significantly faster, but you'll need to create your own optimized version if you want to use this with large images on anything but the latest devices.

这篇关于iPhone 4S上的GPUImage Kuwahara过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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