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 :

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

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?


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

Are yall still getting the artifacts with this:

Dumb dumb dumb...

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

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.