SFML community forums

General => SFML wiki => Topic started by: Hapax on July 28, 2015, 06:18:05 pm

Title: RadialGradient Shader
Post by: Hapax on July 28, 2015, 06:18:05 pm
Just posted a shader on the Wiki to add radial gradients to untextured SFML graphics objects e.g. rectangles, circles, vertex arrays.

There is also a complete example that - using an sf::CircleShape and an sf::Rectangle - ends up displaying this:
(http://i.imgur.com/13Q4M1Z.png)

Here's the Wiki page:
RadialGradient Shader (https://github.com/SFML/SFML/wiki/Source:-Radial-Gradient-Shader)

EDIT: changed image width to fit into the forum.