WebGL: Render Warning non-power-of-2 / not a depth texture

I am receiving a WebGL render warning on a scene, and I can’t see how I should fix it…

On Chrome I get the warning: RENDER WARNING: texture bound to texture unit 8 and 18 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.

and on Firefox I get: drawElements: TEXTURE_2D at unit 1,4 and 10 is not a depth texture with TEXTURE_COMPARE_MODE, but the shader sampler is a shadow sampler.

Can someone explain what these warnings mean in somewhat simple terms? :slight_smile: I have seen them addressed elsewhere online ( such as here and here ) but I’m yet to find an intuitive explanation/one that suggests how I can fix it.

We need a repro to help you further. This could have a lot of cause so we will need to see it live

I tried to repro in the playground to no avail… go figure! It isn’t causing any issues for me, just would rather not have the console warning

I agree. can you share your live page somewhere perphas?


I always use power of 2 textures, as there are many advantages beyond compatibility. There is far less computation on the GPU to render and update a non power of 2 texture. And if the texture is a power of 2 in both dimensions then WebGL can do higher quality filtering, it can use mipmap, and it can set the wrapping mode to REPEAT or MIRRORED_REPEAT .

This will be a big change in WebGL2, which will better support non power of 2. However, I’ll still continue to use power of 2 as it will still require more computation for non power of 2 textures.


1 Like

@Deltakosh Sorry I forgot to reply! I can’t share the live page unfortunately as it’s a work project…

@Galen I wasn’t aware of the computation benefits - I’ll go back and double check my values. Thanks for the info!

1 Like