Texture Bug
Andor Salga | 18 January, 2009 | 21:18When I first started applying textures to objects I came across a frustrating bug. One of my textures would crash the browser every time I applied it to an object. Eventually I figured out that it was because the texture was a solid color. I assumed it must have to do with the extension since Firefox loads solid color images just fine. As workaround, whenever I required a basic texture, I would place a pixel of a slightly different color somewhere in the image. I have recently been told that the bug stems from Firefox optimizing textures which are a solid color. When OpenGL is passed the texture, the image perhaps exists only as 1 pixel and a set of dimensions? I’m still unsure about the internals, but I’ll be contacting Vlad and I’ll ask him about it.
I ran some tests to see if I could get a solid texture to load in a different format or platform, but I didn’t have any success. All the following images crashed the browser.
On my windows machine I used Paint and tried:Blue texture as a JPG
White texture as a JPG
Blue texture as a GIF
White texture as a GIF
I turned to GIMP and tried some more:
Black texture as a JPG
Blue texture as a JPG
White texture as a JPG
I opened my macbook pro and ran GIMP and tried:
Black texture as a JPG
White texture as a JPG
Blue texture as a JPG
Until the issue is resolved, users should simply put a pixel of a slightly different color in the image.
