Effect of diffuse alpha channel on transmission

My understanding from the documentation on transmission is that it is effectively a replacement for alpha blending. I’ve noticed that when using a transmission map and swapping out a diffuse texture with an alpha channel with one without results in a significantly different shading even when the alpha channel is opaque.

Can anyone help me understand what effect the diffuse alpha channel has here when using a transmission map? Examples below (with alpha, without) rendered in ModelViewer


1 Like

I think the alpha acts as an extra modifer for the final opacity value.

My understanding from the documentation on transmission is that it is effectively a replacement for alpha blending.

They’re very different techniques. I’m not sure I’d agree that one is a replacement for the other. You could also use them together, but that’s unusual.

If your material uses alpha blending (this is independent of whether the diffuse map contains an alpha channel) then three.js should be setting material.transparent = true and material.depthWrite = false. If the material is not alpha blended then three.js should be ignoring any alpha channel in the diffuse map entirely, regardless of transmission. If that’s not happening, it could be a bug.

Transmission has special cases related to material.side = DoubleSide which could also be a factor in the difference too.

1 Like

Thanks @donmccurdy that’s helpful. I wasn’t sure how they could work together as the docs say

“The transmission property can be used to model these materials. When transmission is non-zero, opacity should be set to 1 .”

, but I suppose it’s a ‘should’ and still possible. My material shouldn’t be alpha blending but I will check the parameters to make sure material.transparent = false.

@donmccurdy I’m not seeing any alpha blending discrepancies. They are both using opaque blend mode and not double sided.

I put together a minimal example here: https://walnut-heliotrope-heliotrope.glitch.me/ showing two versions of the same geometry loading in model-viewer. The only difference is one uses a png with alpha channel and the other uses a jpg. They both are using a transmission map. I get the same/similar results in every viewer. If it does seem like a bug I’m happy to submit a report but I’m sure I’m missing something.

Models:
https://cdn.glitch.global/ed8c6819-9d89-4328-a904-3ce9783b7ca1/jpg_test.glb?v=1707759750869
https://cdn.glitch.global/ed8c6819-9d89-4328-a904-3ce9783b7ca1/png_test.glb?v=1707759758844

@elalish Does this track for you? It’s still unclear to me if this is intended functionality or not.