Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actuallarspensjo

Posted 09 September 2012 - 01:56 AM

You can't selectively interpolate some texels and not others.
However, this doesn't have to be a problem. If you make all of your transparent pixels black, and then use the "pre-multiplied alpha" blend mode (i.e. src=1, dst=1-srcAlpha), there won't be any artefacts around the edges.


Interesting, I have the same problem. Please help me understand how it works (I am using pre multiple alpha already).
[attachment=11170:TransparentArtifacts_2012-09-09.jpeg]
It is the sampling from the texture that will get a bad color, isn't it? So a position between a white non transparent pixel and a black transparent pixel would become gray 50% transparent? If so, using pre multiplied alpha won't help as long as the colors are wrong?

There is another possibility: Using mipmaps, but you have to create the mipmaps yourself. That way, you can use an averaging algorithm that ignores transparent pixels.

#1larspensjo

Posted 09 September 2012 - 01:56 AM

You can't selectively interpolate some texels and not others.
However, this doesn't have to be a problem. If you make all of your transparent pixels black, and then use the "pre-multiplied alpha" blend mode (i.e. src=1, dst=1-srcAlpha), there won't be any artefacts around the edges.


Interesting, I have the same problem. Please help me understand how it works (I am using pre multiple alpha already).

It is the sampling from the texture that will get a bad color, isn't it? So a position between a white non transparent pixel and a black transparent pixel would become gray 50% transparent? If so, using pre multiplied alpha won't help as long as the colors are wrong?

There is another possibility: Using mipmaps, but you have to create the mipmaps yourself. That way, you can use an averaging algorithm that ignores transparent pixels.
[attachment=11170:TransparentArtifacts_2012-09-09.jpeg]

PARTNERS