Implementing GLSL shader for glow effect on android

Hi Nehon,
Can you guide me on how can i create the neon glow effect with glsl shaders for android ?


If you need @nehon, you might want to tag his name just like I did.

I might be able to help on the glow effect bit… general methodology.

but I don’t have experience with Android.

Were you just wanting the glow/bloom off of the emitting mesh? and you want to add a light source as well, for nearby mesh reaction?

Main problem is that android does not always allow non power of two textures, as well as gles2.0 does not require FBO’s at all.
At least an offscreen rendertarget is kind of a requirement for a real glow shader.

Other usual option is to somehow fake it with some texturing tricks. Might work for text and 2d likish items, but might be harder for real 3d models

I pretend I didn’t read all of the other threads, I’d say “use filter post processor”.

Pretending I did read all of the other threads, I’d say “figure out why filter post processor isn’t working”.

…but you’d have to provide some information, any really, to get started on that. Because effects like this will require the same mechanisms and it almost seemed like your problem was unrelated to FPP itself… but I’m only guessing from incomplete information.

Well…you could use a texture where the glow is baked…IMO that’s the best option for android.

@Relic724 thanx for replying, i want to have a general discussion on this topic. The thing is bloom/glow filter require filter post processor but since android does’nt support that yet for jme3 so i thought someone will help me implement the neon text with the help of shaders. I did try to fake the effect and the surrounding mesh i.e. wall was getting the glow but the text mesh did’nt appeared to be actually glowing. I will be glad if you can share some shaders example which can make the text mesh glow.

@nehon Ok, i will try that and see if that can help

@pspeed my problem is simple i just want to display the stuff in the above mentioned link, but filter post processor that is required to implement the bloom filter does’nt support android yet and on android it says that filter post processor are not supported

So, you added a FilterPostProcessor and it didn’t work? It gave you an error message? It didn’t compile? It blew up your computer? It didn’t work on one particular phone? It gave some other error message?

We can’t help without some information… and “it doesn’t work” is basically no information at all.

hmm… how about an unshaded(<-- no… why not “light additive”), translucent(<-- it would be on that bucket… but it would be adding its color, rather than replacing for the OpenGL…), “sleeve Mesh” for the “glow effect” then? That would be the easiest that I could think of… again… I don’t know what android can do… but that should “skip” the requirement of an OffScreen target… it still requires being able to “sample” the main buffer…

Is that allowed in android?

Sampling the renderbuffer is fortunately not required for additive coloring…

But in general, sampling the current rendertarget is not restricted in any opengl, but unless you use memory barriers, the specifications states that the result is unknown and might be the correct value, pure garbage or something between.

Actually i am not sure how i would sample the render buffer on android if there is no FBO support and you are not writing to a texture. There is probably some way trough pbo’s or something like that

Yeppers, @zzuegg

the trick to what I’m suggesting is that we use the Translucent bucket/queue to “decide” what is already on the screen for that frame: Translucent happening right after the Opaque bucket/queue.

so, if we can do the additive coloring without having to sample… we have our solution without the need for sampling the render buffer.

we would still need a “sleeve mesh” with that “material” attached to it though, for this to work.

Not yet sure how you can make a nice smooth fading out glow effect with the sleeve mesh technique. AFAIK you would have to do a lot of calculations to get the relative position in viewspace to the original model.

Trickier then it sounds…

I would first try to add FBO support to android, and then try to use a power of two texture as rendertarget, if you get it working, you would be able to use the FPP as usual

hmm… I can think of two “quick n dirty” solutions… have a “surface normals” on the .vert side for a “light source” of arbitrary position * (you could cheat with the camera’s position, or a predefined point in “front” of the mesh)

or you can go with the .frag side where you define a ColorMap type texture2D to “plug in” that goes from black to W/E color you want to add

Those are two posibilities from off the top of my head that might work for smoothing it.