E
E
Egor Merkushev2014-02-15 14:37:20
Android
Egor Merkushev, 2014-02-15 14:37:20

Where can I find a C++ implementation of the Gaussian Blur effect for Cocos2d-x?

The second day I'm looking for an implementation of the gaussian blur effect for use in Cocos2d-x v2.0 on two platforms - iOS and Android.
I found an implementation through AWTextureFilter , but this class, in turn, requires the CCTexture2DMutable and CCRenderTextureMutable classes in C ++ that are relevant for the current version of Cocos2d (OpenGL 2.0), which are not. I don't understand OpenGL so I can update these classes myself.
I am also considering the option of using a C++ ported GPUImage , but this solution looks heavy from the point of view of the final goal - I just need to blur the screenshot for the menu background.
Also, when using GPUImage and Cocos2d, there are problems with access to the graphics context...
In cocos2d-x there is an example of a blur filter implemented through a shader, but its result is very different from the required one (for example, Gaussian Blur in Photoshop) for the worse (the resulting blur is similar to motion blur).
I would like to find a quick and easy solution.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2014-02-15
Protko @Fesor

it's better to use a shader I think, and the effect there depends on the convolution kernel.

A
AxisPod, 2014-02-15
@AxisPod

Well, a real blur is not an easy thing, especially if you need to constantly render, except to drain the battery. Although one-time rendering to a texture is possible. It's better to do it with shaders.

E
Egor Merkushev, 2014-02-21
@egormerkushev

As a result, I implemented it through AWTextureFilter, but for some reason it crashes on Android. If I find an error, I will write.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question