jME-CircleShader Package for Drawing/Animating and Distorting Circles

Polished off my circle shader for jME. With the circle shader you can draw circles that fade between up to seven different colors on quads. These circles are drawn by the shader rather than from a texture so they are fully scaleable without pixelation.

Circles can be modified with an optional color texture which multiplies the circle’s color and alpha values. They can also be distorted using a normal map. Both the color texture map and distortion map can be tiled and offset opening up a wide array of effects through animating these textures either by scrolling them or using sprite sheets. The distortion feature uses x and y strength properties to determine the amount of distortion to be applied.

The radius and circle center can be set and animated along with the position of each color along the radius. Color positions are set as a percentage along the radius so changing the radius will not effect the position of your colors within the circle, they will scale appropriately with changes in the radius.

This shader can be used to create a variety of effects such as simple particles, smoke and fire, shockwave/ring-waves and lens-flare elements.

To download this package, along with source, and learn more about how to use it check out the pages I just uploaded to my web-site:

I also posted a tutorial on how to create the animated ring-wave featured above.

  • distortion map =

:+1: Thanks for making. Thanks for sharing. :chimpanzee_smile:

No problem friend. I got the idea for this for my project’s main menu animation. The engine effects for my space ships include these particle trails with a sort of Brownian motion and the main menu has just those particles zoomed in. I figured I could fake a depth of field effect by using this shader and modifying the Offset property based on the particle’s z-axis location.

While working on it I thought why not throw in some extra stuff to make it useful for other effects too :smile:

P.S. While the anti-aliasing for opaque circles doesn’t work on devices that don’t support GLSL1.2 you can get a nice anti-aliased look by setting the Offset to 0.99 instead of 1.0.