Calling obsolete TexImage2d

Hi, I have been trying to run several different samples that render text onto a texture, e.g. Learning WebGL — lesson 7, and I’m using the latest chromium, but I always get the console warning ‘Calling obsolete texImage2d(…)’, and although the text renders in the 2d canvas, it doesn’t render in the 3d canvas.

Does anyone else know how to fix this problem? I tried updating my graphics card drivers (a GeForce 9300 GS) but doesn’t fix it :frowning:

Here’s the fix, just make the canvas width and height a power of 2, e.g. 128*512 etc. Voila.
It will work with non-powers of two in minefield.

The console warning was a red herring, it doesn’t seem to matter.

WebGL is only meant to offer very limited support for power-of-two textures (see WebGL and OpenGL Differences - WebGL Public Wiki) but Minefield doesn’t currently enforce the restriction if your graphics card can handle NPOT – which is true of most desktop graphics cards, but of few mobile/embedded ones. It’s best to stick to power-of-two.

The signature for texImage2d has changed, but I think Chrome is kindly supporting both old- and new-style calls right now; this is probably not something we can rely on in the long term, but (as you say) isn’t likely to cause issues right now.

Cheers,

Giles