Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualVincent_M

Posted 26 February 2013 - 08:47 AM

For some reason, my glow effect isn't very vibrant. Attached below is what my Hellknight's tongue looks like when having glow applied to it. What I did was create two FBOs, and rendered all glow sources to the first one. Then, I swapped FBOs, and started running a horizontal blur shader, swap FBOs again, then vertical blur. I also turned depth testing off, and turned additive blending on, but no luck.

 

Here's my fragment shader to horizontal blur:

precision lowp float;
varying vec2 v_coord;
uniform float u_blurStep;
uniform sampler2D u_renderTexture;
void main()
{
	vec4 sum = texture2D(u_renderTexture, vec2(v_coord.x, v_coord.y)) * 0.2;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 4.0 * u_blurStep, v_coord.y)) * 0.05;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 3.0 * u_blurStep, v_coord.y)) * 0.09;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 2.0 * u_blurStep, v_coord.y)) * 0.11;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - u_blurStep, v_coord.y)) * 0.15;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + u_blurStep, v_coord.y)) * 0.15;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 2.0 * u_blurStep, v_coord.y)) * 0.11;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 3.0 * u_blurStep, v_coord.y)) * 0.09;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 4.0 * u_blurStep, v_coord.y)) * 0.05;
	gl_FragColor = sum;
}

 

u_blurStep = (1.0 / screenWidth)


#1Vincent_M

Posted 26 February 2013 - 07:39 AM

For some reason, my glow effect isn't very vibrant. Attached below is what my Hellknight's tongue looks like when having glow applied to it. What I did was create two FBOs, and rendered all glow sources to the first one. Then, I swapped FBOs, and started running a horizontal blur shader, swap FBOs again, then vertical blur. I also turned depth testing off, and turned additive blending on, but no luck.

 

Here's my fragment shader to horizontal blur:

precision lowp float;
varying vec2 v_coord;
uniform float u_blurStep;
uniform sampler2D u_renderTexture;
void main()
{
	vec4 sum = texture2D(u_renderTexture, vec2(v_coord.x, v_coord.y)) * 0.16;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 4.0 * u_blurStep, v_coord.y)) * 0.05;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 3.0 * u_blurStep, v_coord.y)) * 0.09;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - 2.0 * u_blurStep, v_coord.y)) * 0.12;
	sum += texture2D(u_renderTexture, vec2(v_coord.x - u_blurStep, v_coord.y)) * 0.15;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + u_blurStep, v_coord.y)) * 0.15;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 2.0 * u_blurStep, v_coord.y)) * 0.12;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 3.0 * u_blurStep, v_coord.y)) * 0.09;
	sum += texture2D(u_renderTexture, vec2(v_coord.x + 4.0 * u_blurStep, v_coord.y)) * 0.05;
	gl_FragColor = sum;
}

 

u_blurStep = (1.0 / screenWidth)


PARTNERS