jps0611

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:

http://playground.babylonjs.com/#35QZ3E#1

On Desktop all seems ok: 

565834137_ScreenShot2018-08-03at3_28_06PM.thumb.png.3a3e07a3d9fa736ca8500ffd77db41a9.png

But on iOS i'm getting:

50708921_IMG_3103copy.thumb.jpg.0a369b115a409a4d1290adc225639f59.jpg

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

Thanks!

JPS

Share this post


Link to post
Share on other sites

@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!

JPS

 

Share this post


Link to post
Share on other sites

Works just fine on my iPhone 6s

 

671E788E-4A68-45B0-A795-4BCB65C284EE.png

Actually now looking at the screenshot, I can see a little line... odd I cant see that while actively viewing it though.

Share this post


Link to post
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?
 

Share this post


Link to post
Share on other sites

Pretty sure it’s the alias mixing, can you turn of mips as well to check that.

9557FF06-F6E8-4D46-A46A-EF63B9B5AB6E.png

I can pretty confidently say it has to do with mipmapping or aliasing changing the values of the transitional pixel.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
4 minutes ago, Pryme8 said:

First test turn off mips on the textures when importing them and lets start there.

Hmmm I'm not sure how to do that. Got some documentation I could take a look at? Or a playground:? :)

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.