Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebGL is only rendering/loading certain PNG files

I have created an OOP environment for WebGL so I can easily create all the objects I need for future game projects i might get. Most of the work is already done, but I'm getting painfully frustrated now with the displaying of .png files, I tested multiple object instances with a certain png file, and it was working smoothly (even the transparancy was), but now that I try other png files it doesn't render those properly. just the untextured plane (black square).

I have tried multiple orders of calling them in, and some other png files it does load in, but i cant find any apparent difference in the png files, all have the same right access for the browser. Also I can't find any alike problems with this online..

Anyone experience with WebGL / OpenGL who knows what might be happening here?

EDIT:

I still haven't figured out why it can only read certain PNG files, but i do know the right settings needed to make it readable.

RGB Color, 8 Bit

Color profile: sRGB IEC61966-2.1

like image 800
Samuel Avatar asked Jan 31 '26 22:01

Samuel


1 Answers

Are your textures powers of 2?

WebGL is designed for embedded systems so it's non-power of 2 support is limited.

like image 70
David C. Bishop Avatar answered Feb 02 '26 10:02

David C. Bishop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!