Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

check if texture alpha channel exists

$
0
0

Hi,

 

after loading a texture how can i check if the source image (PNG) has an alpha channel/transparent pixels or not?

I need to know this to set the flags material.diffuseTexture.hasAlpha and material.useAlphaFromDiffuseTexture to true.

In my scenario the images/textures which will be used later in the application are not predefined.

The only way is that i automatically detect if i need to enable the alpha flags.


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>