PNG vs JPG Opacity Maps

In a few documentation playgrounds, (this one and this one) I’ve noticed opacity maps are PNGs with transparency. I’ve been trying to set a black and white JPG as an opacity map and so far haven’t gotten it to work. Is there a step I’m missing? Or do opacity maps need to be PNGs with transparency?

I’m not sure how helpful this is, but here’s a basic playground with an attempt at jpg opacity maps.

You need to set getAlphaFromRGB to true:

https://www.babylonjs-playground.com/#VW4U62#1

3 Likes