문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top