HTML canvas globalAlpha Property

For example, I need 0.5 alpha for the canvas on the webpage.
Is it possible to use HTML canvas globalAlpha Property with Babylon canvas like in the example at https://www.w3schools.com/tags/canvas_globalalpha.asp ? If yes, how to do it?

Hi. I don’t know if this is something specific for 2d context or not, but you can do something similar with

scene.clearColor = new Color4(1,1,1,0.5)  - where 0.5 is alpha flag

Well, the results in this case are definitely interesting, but far from desired…
https://www.babylonjs-playground.com/#SVZL1I#35

Setting the clear color should give you the desired effect for background but every mesh needs to also have their material set up to have alpha = 0.5

I don’t think webgl will let you set a global alpha like 2D context does for canvas

Wow! CSS background for the desired part of the scene!
https://igiuk.com/3d-utilities/alphacanvas/

1 Like