Jump to content

diffuseTexture with alpha channel has edge artifacts on iOS?


Recommended Posts

Howdy friends!

I've noticed that if I use either the alpha channel of a diffuseTexture or an opacityTexture, there are really bad artifacts around the edge of the alpha channel on iOS. Consider this playground:


On Desktop all seems ok: 


But on iOS i'm getting:


@Deltakosh is there some magic ingredient i'm missing to refine the edges of the alpha channel?



Link to comment
Share on other sites

So no perf penalty by using TGA (it is just slower to load)

the artifacts surely come from my TGA file which is bit crappy :)


for the TGA, I think you need to export it as 32bits

Link to comment
Share on other sites

  • 2 weeks later...

@Deltakosh  for our unique circumstances (we're building a web game) .png will have to be the chosen texture format.

I've been beating my head against a wall trying to find some work around....no luck thus far. Is there anything i'm missing? I'm surprised that nobody has discovered this issue before me. Building games for mobile platforms like iOS seems like precisely what Babylon is well positioned to handle. But if transparency doesn't work on textures cleanly...I'm sorta stuck. :(

Here's another playground explicitly showing the issue: http://playground.babylonjs.com/#2IY6VG#1

Thanks for any help!



Link to comment
Share on other sites

I bet it has to do with fully transparent pxls saving as 0,0,0,0  and the transition between from aliasing mixes that with the color and raises its alpha.

Or it might be something else are you using for your export setting on the pngs?

Link to comment
Share on other sites

Its on the BJS side then after looking at your export (its correct).  Pretty sure its the mips or the aliasing.  First test turn off mips on the textures when importing them and lets start there.

It could be the alpha is getting premultiplied also.

Link to comment
Share on other sites

When I get some free time maybe, Im pretty busy this evening but if I get a second!

Ive had to fix this before as well, it was just a long time ago.

After some testing it seems related to the emissive not when you use an diffuse with alpha.  but more tests are needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...