Closed PrincessGod closed 6 years ago
I'm pretty sure most glTF 2 renderers will ignore the alpha channel for anything but base color. For example: https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/master/shaders/pbr-frag.glsl#L293.
It would be better to transfer the alpha channel to the base color (diffuse) texture instead.
@lilleyse Thanks, That's let me learn a lot.
But in this code, if a .png
file load for ambientTexture
first, and when deffuseTexture
use it, it will lose alpha data. Because you just load image once.
Ah that is true. I'll open a PR to change the load order.
Should
checkTransparency
parameter be inambientTextureOptions
? Cause I haveobj
with transparency ambient texture.