Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Member Since 15 Nov 2010
Offline Last Active Nov 16 2014 02:19 PM

Posts I've Made

In Topic: Particle alpha blending

06 October 2014 - 04:39 PM

You can do blending in the fullscreen pass as well, but you need to change the blend function you use when rendering the particles.


The problem is that with the most common blend mode (glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)), you accidentally square the source alpha, resulting in incorrect destination alpha. This can be avoided by using




instead. This should give the resulting FBO correct alpha values.


EDIT: Also, in the fullsceen copy pass, your pixels essentially have premultiplied color, so glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) is the correct one to use.

In Topic: Particle alpha blending

06 October 2014 - 03:56 PM

I don't think you're actually getting dark halos. I think it's kind of an optical illusion.  It's caused by the color gradient change of the light when it reaches the edge. Try squaring the alpha value like this:

float alpha = 1.0f - clamp(length(position), 0.0f, 1.0f);
frag_color = vec4(1.0f, 1.0f, 1.0f, alpha*alpha);

See if it looks more like you expect.

In Topic: Compute shader runs more than once?!

26 September 2014 - 06:29 AM

Yeah, that's basically what this all boils down to. I've given up on reporting bugs to Nvidia as I never get any kind of response or feedback at all, so I'll just wait until the next driver comes out...

In Topic: Compute shader runs more than once?!

24 September 2014 - 04:03 PM

I'm unsure what that means... Hopefully it'll clear up once some time has passed?

In Topic: Compute shader runs more than once?!

24 September 2014 - 12:47 PM

Does the Java program I uploaded work on your AMD card? That'd rule out a lot of things. I could imagine that the C++ compiler optimizes the loop you have since it assumes that the value of *mappedBuffer does not change inside the loop or something like that... Anyway, it'd be nice to know if my Java version works, as that program worked perfectly fine on my HD7790.