1
votes

First Scenerio

  1. Loaded a texture with Stick-util.jar, where the image size = 50x50 & texture size =64x64.
  2. Bound the texture & drew a Quad of size 64x64. And gives out an Image of size 50x50.

Grid of size 50x50

Grid of size 50x50

Second Scenerio

  1. Loaded another texture of Image size = 180x50, but texture size = 256x64

Question

It's obvious that slick-util is converting the texture size to some power of 2. And when bound, drawing its original size. (default)

But why & how? The second texture's width to height ratio is not equal to the image size.

1

1 Answers

2
votes

Why is simply because some older GPUs only support power-of-two textures.

How is difficult to answer, because it is implementation specific. It either uses texcoords to only show the part of the texture that was from the initial image, or it fills the extra texture space with alpha=0 texels that are rejected when drawing. I'm only speculating though.