Transparency issues


I made a custom GLTF loader with babylon, so I would be able to hide and display meshes on the fly. The GLTF loader is working correctly, as you can see it here: 3D Model Viewer - League of Legends - Teemo.GG

However, for some reason, some materials ignore the transparent pixels on a PNG texture, and they appear with another color as you can see the image here:


What am I doing wrong?
I already attempted to change the Blend Modes, add another texture, change the lighting and colors - with no success.

I have also been trying to fix that on the playground, with this GLB:
(Sorry in advance for multiple meshes displaying on the playground, since they are not hidden there by default)

Thanks in advance

Hello, the site is pretty cool :slight_smile:

About the transparency it looks like you are using the texture on the emissive channels.

Alpha can only be read from either the opacityTexture or the albedoTexture in PBR.

pinging @thomlucc and @PirateJC FYI

Hey @honux - Welcome to the forum and Babylon family! This looks rad! Can’t wait to play with it!

Can you do material.hasAlpha = true?

Hey Sebavan, thank you for your help.

I have decided to go for an emissive channel because that is the only way I found to keep the color fidelity between real League of Legends models, and by using the albedoTexture I was not able to keep the same color fidelity.

Since this section of the website is mainly used by cosplayers, color fidelity is crucial.
Is there any way to fix the color and use albedo at the same time? I tried to google search how to disable lighting but I failed miserably.

You can use an unlit GLTF file for that :slight_smile:

Adding @gary for the syntax as I can not remember it exactly :frowning:

1 Like

That was enough for me to google it! :stuck_out_tongue:

Just in case you are wondering, this was the way I did it:

Thanks for all the help, I will update all the models soon :slight_smile:


Yup, that’s right. For future reference, here is the unlit material specification for glTF: glTF/extensions/2.0/Khronos/KHR_materials_unlit at master · KhronosGroup/glTF · GitHub

1 Like