Once you do please PM me, I'm thinking on combining that shader with a the bloom one to make some awesome effects
(zero gravity physics world with a glowing circle moving around a leaving a motion blur effect, how cool is that )
[[
extern number intensity;
extern number aspeed;
vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ) {
vec2 speed = vec2(aspeed, 0.0);
vec2 offset = intensity * speed;
vec4 c = vec4(0.);
number inc = 0.1;
number weight = 0.;
for (number i = 0.; i <= .3; i += inc)
{
c += Texel(texture, texture_coords + i * offset).rgba;
weight += 1.;
}
c /= weight;
return c;
}
]]
(aspeed should be the speed of the object and I usually set intensity to .1)
Out of the source from this link, it's not really what I wanted but it'll do for now the thing is it's only made for horizontal movement, can someone make this work for vertiacal and diagonal movement ? I still don't undestand a single thing of GLSL
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping
Cartesian to polar is super easy just use r,theta=sqrt(x^2+y^2),atan2(y,x) for cartesian to polar and use x,y=r*cos(theta),r*sin(theta) for polar to cartesian!
I tried to implement your shader qwook, the glow effect looks really cool in your picture. Unfortunately, I'm not doing something right, as my pig doesn't glow like I think it should:
pigtest.png (41.22 KiB) Viewed 6234 times
I've attached my .love, I'd appreciate it if you could point out my mistake or explain what's going on in the pixel shader code a bit.
CaptainMaelstrom wrote:I tried to implement your shader qwook, the glow effect looks really cool in your picture. Unfortunately, I'm not doing something right, as my pig doesn't glow like I think it should:
In fact the code is a code for bluring not for glowing.
What I undestand of glowing, you want your picture surrounded by an halo.
I draw this halo on transparent zone of the image (with alpha=0).
In this case, try the attached love file.
Of course, the glowing effect is truncated by the border of your image.
The glowing color is the color you have setted by love.graphics.setColor.