Hi there. I was wondering if there's a shader for glowing polygons in Love. I'm programming a small geometry game in which I use love functions to draw complex polygons. Even though it's a simple game, I wish I could use a glow effect to make them look cooler.
For instance: I want to draw two rectangles using love.graphics.rectangle and then apply a glow effect on them, like this:
How could I do that?
Shader for glowing polygons
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Shader for glowing polygons
First of all, you need to know that shader effects only apply within the area of an object being rendered, everything outside of it is unaffected. If you draw a square, only pixels inside the square are affected. So if you'd use a glow shader, it would not glow outwards.
Second of all, try baking glowing effect into the sprite, or try making a composite sprite with a base part and a glow part. This is computationally cheaper and you can probably make it look much nicer in Photoshop than in GLSL.
Glowing effect in general is achieved by having a separate canvas just for glow effect. Once its filled with glow graphics, it's rendered on top of main scene. You can go with cheap bloom algorithm, i.e. take rendered scene and map colors from upper region of original brightness to full range of brightness (bottom part gets clipped and top part is smooth transition), then apply hefty amount of blur. You can use something more sophisticated, such as rendering custom glow sprites into glow canvas. When you're finished, you set additive blend mode (or whichever is best fitting) and render glow canvas full-screen on top of rendered scene.
Second of all, try baking glowing effect into the sprite, or try making a composite sprite with a base part and a glow part. This is computationally cheaper and you can probably make it look much nicer in Photoshop than in GLSL.
Glowing effect in general is achieved by having a separate canvas just for glow effect. Once its filled with glow graphics, it's rendered on top of main scene. You can go with cheap bloom algorithm, i.e. take rendered scene and map colors from upper region of original brightness to full range of brightness (bottom part gets clipped and top part is smooth transition), then apply hefty amount of blur. You can use something more sophisticated, such as rendering custom glow sprites into glow canvas. When you're finished, you set additive blend mode (or whichever is best fitting) and render glow canvas full-screen on top of rendered scene.
Who is online
Users browsing this forum: No registered users and 208 guests