Antoine Farel
Member
Hey everyone,
I have this shader that I took from xorshader :
I have no issue to apply it to whole application surface, but I'm strugguling to apply it to a specific sprite, because this code :
produce this result:
As you can imagine, there's not only this sprite to display but a lot of other stuff around, in my window...
What am I doing wrong?
Thank you for your answers
I have this shader that I took from xorshader :
GML:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec3 size;//width,height,radius
const int Quality = 8;
const int Directions = 16;
const float Pi = 6.28318530718;//pi * 2
void main()
{
vec2 radius = size.z/size.xy;
vec4 Color = texture2D( gm_BaseTexture, v_vTexcoord);
for( float d=0.0;d<Pi;d+=Pi/float(Directions) )
{
for( float i=1.0/float(Quality);i<=1.0;i+=1.0/float(Quality) )
{
Color += texture2D( gm_BaseTexture, v_vTexcoord+vec2(cos(d),sin(d))*radius*i);
}
}
Color /= float(Quality)*float(Directions)+1.0;
gl_FragColor = Color * v_vColour;
}
Code:
//CREATE EVENT
usize = shader_get_uniform(shd_gaussian_blur,"size");
//DRAW EVENT
shader_set(shd_gaussian_blur);
shader_set_uniform_f(usize,231,231,8);
draw_sprite(global.snap_mana, 0,0,0);
shader_reset();
As you can imagine, there's not only this sprite to display but a lot of other stuff around, in my window...
What am I doing wrong?
Thank you for your answers