3

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

genpfault
  • 51,148
  • 11
  • 85
  • 139
Samuel
  • 540
  • 1
  • 4
  • 17
  • Have you tried opening the PNGs in a different image editor and re-saving them? There might have been a sloppy writer in the first place, and some readers might be more forgiving. Just a guess, but you haven't told us what you're *really* doing. – spraff Feb 03 '12 at 10:46
  • You could try [validating the images](http://stackoverflow.com/questions/2408027/png-file-validation) with some separate software. – spraff Feb 03 '12 at 10:49
  • I have tried saving multiple ways of PNGs with Photoshop, reopening them and resaving them again. nothing seems to create a PNG thats readable.. – Samuel Feb 03 '12 at 11:10

1 Answers1

7

Are your textures powers of 2?

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

David C. Bishop
  • 6,437
  • 3
  • 28
  • 22