Unity Toolkit blending modes

Hi, i decided to make “fake” shadows (for performance and project need), basically planes with transparent materials. For this to work, I need to change the alphaMode of the exported material instances from 2 (default) to 4. I assume that the result is like a “multiply” blending mode. This works fine, but I need to change this in the Babylon file. Is there a better way to do this? Or could you consider adding parameters on materials for blending mode?

Here’s the result :

Thanks in advance @MackeyK24 !

1 Like

Specifically what properties are you talking about ?

For my very specific need, I just want to set the alphaMode to 4 instead of 2 for a material to avoid editing the babylon file after export. I could be wrong but I think this could be translated as putting a material in “multiply” blend mode.

If you are willing to do that, maybe it is a good idea for the user community to add other blend modes to materials as well (“screen”, “overlay” and some others blend modes), if it’s possible of course.

Switch alphaMode to 4 on babylon file material instance is the same to set these parameters on babylon sandbox inspector (Alpha – less than 1, Transparency mode to “Alpha blend” and Alpha mode to “Multiply”) :


Hope it helps.

1 Like

Do you mean GLTF file… Or are you using the OLD Toolkit with .babylon files ?

For my GLTF based Babylon Toolkit, the next update will allow you to specify the Alpha Blend Mode if you use one of the Babylon Shaders…

Here is example shot using the Babylon Standard shader

This is perfect, thanks @MackeyK24 !

Hi @MackeyK24
I’ve been struggling with the different rendering modes for the alpha (cutout, fade, transparent).
Fade and transparent get mixed up (one item passing over the other in a strange fashion)
Cutout works properly, but it’s cutout, which I don’t want.

I succeed to get the desired result by exporting in cutout and changing this our code: mat.useAlphaFromDiffuseTexture = true.
How can I achieve this / good result, directly from the toolkit ?

Thank you!