2

I am using libgdx for making an Android app that will be using TextureRegions which defines a rectangular area of texture. Now I wan't to apply some visual effects to the TextureRegion using OpenGL ES (Which can include anything from blur effects to gradients to glowing effects to some or all part of the texture). After searching through internet and going through some popular tutorials, I am feeling lost on how to apply these effects in a dynamic way. I tried searching for some libraries that have made this task easier by reducing the complexities of OpenGL and came across Clutter which is way too extensive for such a simple task.

Can anyone please guide me to some starting point to manipulate and apply visual effects to textures using OpenGL ES. Any libraries or tutorials/methods and explanations will be very helpful.

Rafay
  • 6,108
  • 11
  • 51
  • 71
  • Stack Overflow isn't a place for "recommend me" kinds of questions. It's a place for practical answers to real, specific problems. – Nicol Bolas Apr 11 '12 at 17:22
  • @NicolBolas Well there are several questions on stackoverflow that ask for resource recommendation so I thought I was not doing any harm by asking such a question myself. – Rafay Apr 11 '12 at 18:34

1 Answers1

2

Assuming you are using GLES2.0 which libgdx supports. You can apply shaders to textures. Unfortunately shaders are not easy to pick up and you will have to dedicate a good amount of time to learning them.

Example of shaders in libgdx http://www.badlogicgames.com/wordpress/?p=471

Rajawali is another GLES2.0 engine, that while it is no where near the level of libgdx, it does have a lot of basic shaders included with it which may be useful to you for learning shaders.

ian.shaun.thomas
  • 3,468
  • 25
  • 40
  • Though it supports GLES2.0, I will not be using it which means using shaders to achieve this is not possible. Isn't there any other method to achieve this without using separate overlapping textures to create those visual effects? – Rafay Apr 12 '12 at 08:33
  • GLES1.X does support the use of basic blending which can be configured per object in your rendering code. This will only allow you to make simple graphical effects such as additive blending. It will not, as far as I know, let you make blur effects or make changes to only small areas of a texture. Is there a reason you do not want to use GLES2.0? Device support for GLES2.0 is at 88% so you will no be cutting out many users by requiring 2.0 vs 1.x. 88% at time of posting, Source: http://developer.android.com/resources/dashboard/opengl.html – ian.shaun.thomas Apr 14 '12 at 15:33
  • Okay if I do opt for OpenGL ES2.0, how I am I supposed to achieve this in an easy manner? – Rafay Apr 29 '12 at 16:38
  • I would start by reading the link I originally posted. GLES20 is not terribly easy to learn but it is very powerful. There are plenty of resources now demonstrating how to setup engines so start there until you get a grasp of how everything works. – ian.shaun.thomas Apr 30 '12 at 12:25
  • Well I am thinking of starting up with GLES20 as you have recommended. However it would be very kind of you to guide me in this question as well. (http://stackoverflow.com/questions/10373847/producing-eraser-effects-using-libgdx-and-opengl-es) Thanks in advance. – Rafay Apr 30 '12 at 14:49
  • And moreover I was able to achieve some of the effects such as transparency by changing the alpha values of individual TextureRegions. However, as you have explained, achieving more advanced effects would not be possible using ES1. – Rafay Apr 30 '12 at 14:54