1

Why WebGL's MAX_TEXTURE_SIZE property constraints the maximum dimensions of an image instead of its raw size in pixels?

var canvas = document.getElementById("webgl-canvas")
gl = canvas.getContext("experimental-webgl");
var maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );

console.log("Max texture size: ", maxTextureSize)
<canvas id="webgl-canvas" width="1" height="1"></canvas>

So when the MAX_TEXTURE_SIZE is N it means the maximum texture possible is uniform (width = N and height = N). Why can't one use a texture with arbitrary proportions with the pixel size N^2.

This problem is elegantly handled by Three.js, but I am coruius about the theoretical background.

My guess: it would make some texture operations impossible. However I hope someone here has a specific answer.

Update:

As tkausl pointed out this limit is not a novel property of the WebGL standard, but of some underlying abstraction like the driver or the very architecture of the video card.

gman
  • 100,619
  • 31
  • 269
  • 393
atevm
  • 801
  • 1
  • 14
  • 27
  • 2
    This is a limitation of the graphics card/graphics driver, not of WebGL – tkausl Dec 14 '17 at 16:49
  • @tkausl I guessed, but my code example is in JavaScript. So I tried to stay in that domain, but your are right I will update my question. – atevm Dec 14 '17 at 17:08

0 Answers0