jps0611 Posted August 3, 2018 Share Posted August 3, 2018 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: But on iOS i'm getting: @Deltakosh is there some magic ingredient i'm missing to refine the edges of the alpha channel? Thanks! JPS Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 Does the Sprite manager offer better refinement here? Quote Link to comment Share on other sites More sharing options...
Guest Posted August 3, 2018 Share Posted August 3, 2018 This may be linked to iOS reading the alpha as premultiplied. Can you try with a TGA? Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 @DeltakoshHmmm my Targa doesn't seem to playing nice: http://playground.babylonjs.com/#35QZ3E#2 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 Confirmed that this issue is also present while using the SpriteManager. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 3, 2018 Share Posted August 3, 2018 what about this one: http://playground.babylonjs.com/#35QZ3E#3 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 It sure does! My targa came right out of Photoshop CC...any documentation around the Targa support? Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 Are there performance implications of using a Targa over PNG? Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 3, 2018 Author Share Posted August 3, 2018 Also related...on black I am noticing artifacts on the right edge of the plane with the Targa: http://playground.babylonjs.com/#35QZ3E#5 Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2018 Share Posted August 6, 2018 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 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 6, 2018 Author Share Posted August 6, 2018 Ok! Let me poke around a bit with this. Thanks! Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 6, 2018 Share Posted August 6, 2018 interesting i see a seem on my windows machine too. for me it works by changing the wrap properties http://playground.babylonjs.com/#35QZ3E#15 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 @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 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 16, 2018 Share Posted August 16, 2018 Hello, Can you send me a screenshot of what you are experiencing with the cat ? I ll get an ios device tomorrow to try out. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 Works just fine on my iPhone 6s Actually now looking at the screenshot, I can see a little line... odd I cant see that while actively viewing it though. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 @Pryme8 It looks like even in your screenshot the issue is present. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 @Sebavan along the edges of the opacity I would expect to see the following for the Cat: Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 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? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 Pretty sure it’s the alias mixing, can you turn of mips as well to check that. I can pretty confidently say it has to do with mipmapping or aliasing changing the values of the transitional pixel. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 From photoshop would could I change to producer a better export? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 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:? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
jps0611 Posted August 16, 2018 Author Share Posted August 16, 2018 Thanks for you help @Pryme8 @Sebavan Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 16, 2018 Share Posted August 16, 2018 http://www.babylonjs-playground.com/#YDO1F#69 I'm really leaning tword that 0,0,0,0 mixing thing I was talking about being the culprit and it having to do something with the way we handle emissive textures and alphas. jps0611 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.