jps0611

diffuseTexture with alpha channel has edge artifacts on iOS?

Recommended Posts

So I was right about the mips and the transparent pixels being stored as 0,0,0,0.  Cool I’m not crazy.

 

The work around solution is export younr cat with its background being the same color yellow, then use a secondary alpha texture. 

Share this post


Link to post
Share on other sites

Hello, sorry to interupt you in this passionated topic! I really liked following your ideas and brainstorming on the subject.

But I have to participate because I have the same issue. All the png and svg image I import in babylon have this dark/grey edge showing when you set hasAlpha to true.
See in this playground : https://playground.babylonjs.com/#U6F7E2#12

For me the problem occurs on every browser.
I tried all of your solution above and none has work.

The only way I found to improve this was to use engine.setHardwareScalingLevel(0.5); but not very nive for the GPU I guess.

Hope that can help the topic! ;)

Share this post


Link to post
Share on other sites

hey guys what the heck you are doing here. You are testing the texture color value against the lights and this would be my first thought, when i would start debug. 

Share this post


Link to post
Share on other sites

Do we and if not why don't we have a method for setting a specific alpha texture so we can have a separate image an alpha?

 


IE:
myMaterial.alphaTexture = new BABYLON.Texture("PATH TO IMAGE", scene)
myMaterial.alphaTexture.blackAndWhite = true



Are yall still getting the artifacts with this:
https://playground.babylonjs.com/#HLGXFX#3

*UPDATE*
Dumb dumb dumb...
http://www.babylonjs-playground.com/#4K1IX9

Just export your cat on a solid yellow background, then export the opacity pass as a separate image.
Should fix your artifacts.


Why material.opacityTexture is not mentioned in the docs anywhere I can find is beyond me.

Share this post


Link to post
Share on other sites
Quote

Why material.opacityTexture is not mentioned in the docs anywhere I can find is beyond me

Because documentation is a long and painful work and we are not getting a lot of help on this front :) (However I wanted to shout out to @JohnK for his invaluable help on the doc)

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.