

| Home | Games | Downloads | Ramblings | About |
| Download: | |
| jME-CircleShader.zip: | Download |
The above code first instantiates a new Geometry encompasing a Quad. Following this we create a new Material using the Circle.j3md shader. As you can see the simplest form of circle only needs to have the Color property set. With just that one property we create a circle that encompases the whole quad with the set color and an alpha value that fades from the center to the edge of the circle.
The Offset property defines the scale of the circle's center as a percentage of the circle's radius from 0.0-1.0 with a default value of 0.0.
Okay, now the circle fade from the center color to Color2, but it's fully opaque. A circle will automatically fade from the supplied color's alpha value to 0 from the center to the edge of the radius when only one color is used, but when more than one color is used you must set the alpha value yourself with the supplied color.
As a side note if you want a fully opaque circle with just one color you can set the Offset property to 1.0.