An easy entry to shaders with LibGDX

 

 

via libgdx-contribs-postprocessing and Alcove Games.

If you do want to add some fancy blooms and zooms and there’s a little allergy in you for coding in glsl you can work with fantastic library with ready to work effects.
I won’t explain importing – it’s already done on the project’s site and it’s super easy idiot-proof.
I recorded a short introduction to what it offers on some gifs below;
Each effect (source linked) presented on a GIF:


Bloom:

ezgif.com-video-to-gif.gif


CameraMotion:

this effect is INCOMPLETE!


CrtMonitor:

Depending on a constructor it can look in 3 ways:

public CrtMonitor (int fboWidth, int fboHeight, boolean barrelDistortion, boolean performBlur, RgbMode mode, int effectsSupport){…}

For ex:

CrtMonitor crtMonitor = new CrtMonitor(800, 480, false, false, RgbMode.RgbShift, 0);

RgbMode.ChromaticAberrations

chromatic aberrations.gif

RgbMode.RgbShift

rgb shift.gif

RgbMode.None

crt monitor none.gif


Curvature:

curvature.gif

Not my video but presents effect well.

(combined with CrtMonitor effect)


LensFlare:

Deprecated, use the LensFlare2.


LensFlare2:

Pseudo lens flare implementation. This is a post-processing effect entirely, no need for light positions or anything. It includes ghost generation, halos, chromatic distortion and blur.
@author Toni Sagrista

Gif soon.


MotionBlur:

A motion blur effect which draws the last frame with a lower opacity. The result is then stored as the next last frame to create the trail effect.
@author Toni Sagrista

motionblur.gif


Vignette:

vignette.gif


Zoomer:

Implements a zooming effect: either a radial blur filter or a zoom filter is used.

zoomer.gif


Antialiasings:

You didn’t expect me recording antialiasing example on a gif duh?


Antialiasing:

Just an abstract class.


Nfaa:

Implements the normal filter anti-aliasing. Very fast and useful for combining with other post-processing effects.
@author Toni Sagrista


Fxaa:

Implements the fast approximate anti-aliasing. Very fast and useful for combining with other post-processing effects.
@author Toni Sagrista


Although all the benefits it can do thorribly irritating problems with working on Android, troubleshooting here.


Another thing which you may be interested is a some kind of a light effect, attached to a body, a mouse or anything.
I want to recommend you this tutorial. It’s also easy, just import the project, look into code and adjust it into your needs.
Minus – performance on Android devices.

I recorded my game in which I attached a light to the mouse.

Advertisements

One thought on “An easy entry to shaders with LibGDX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s