Domanda

Can I use 16 bits per channel (i.e. 48 bits for RGB) image data in WebGL? May I use PNG as an input format for this? If I do this, is that based on some official standard or does it depend on browser-specific extensions which are likely to break on other browsers?

È stato utile?

Soluzione

Core WebGL doesn't support more than 8 bits per color channel. The OES_texture_float extension is widely supported, though, so that might be the best way forward. (Well, as long as you keep away from mobile devices, anyway.)

You can load a 48-bit PNG on any browser, but it will get converted to 24-bit before you get access to it. You'll have to load your image data manually, using JavaScript and XMLHttpRequest, and then convert from 16-bit integer to float before calling texImage2D.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top