Author Topic: Textures, Powers of Two Question [SOLVED]  (Read 3235 times)

Darth Futuza

  • Posts: 58
  • Turrets: +1/-4
Textures, Powers of Two Question [SOLVED]
« on: October 01, 2008, 04:48:50 am »
Alright, so when you want to use custom textures I understand that the pixel sizes need to be in powers of 2.  What exactly does this mean?  EX: 1^2 (1), 2^2 (4), 3^2 (9), 4^2 (16), 5^2 (25), 6^2 (36)...etc   OR   2, 4, 6, 8, 10....etc  OR   2, 4, 8, 16, 32, 64,  OR something else?

Just looking for a little clarification on that, so far I've only modified already in game textures for Quake3 Style maps.
Thanks.
« Last Edit: October 01, 2008, 09:38:51 pm by Darth Futuza »

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: Textures, Powers of Two Question
« Reply #1 on: October 01, 2008, 05:15:15 am »
"Powers of two" means 2n where n is a positive integer.

Textures of arbitrary dimensions can be used, but this is definitely not recommended as you'll need weird scaling/stretching and alignment values.

zaishaza

  • Posts: 32
  • Turrets: +4/-3
Re: Textures, Powers of Two Question
« Reply #2 on: October 01, 2008, 08:17:46 pm »
21=2
22=4
23=8
24=16
25=32
26=64
27=128
28=256
29=512
210=1024
etc.....

basically it doubles every time. remember that textures don't always have to be square, stuff like 256x1024 is ok too.
« Last Edit: October 01, 2008, 08:33:57 pm by zaishaza »

Darth Futuza

  • Posts: 58
  • Turrets: +1/-4
Re: Textures, Powers of Two Question
« Reply #3 on: October 01, 2008, 09:38:24 pm »
Alright, thanks.

Lava Croft

  • Guest

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Textures, Powers of Two Question [SOLVED]
« Reply #5 on: October 02, 2008, 04:41:13 pm »
Hmm, the renderer seems to rescale any textures to powers of two on loading, so:
  • your graphics driver may be able to use non-power-of-two textures, but tremulous will never use them
  • you can use non-power-of-two textures, but they may look crappy in the game because they are interpolated

Lava Croft

  • Guest
Re: Textures, Powers of Two Question [SOLVED]
« Reply #6 on: October 02, 2008, 05:32:12 pm »
Yes, Quake has done this since forever. It is most noticeable when first looking at Quake with it's software renderer, and then at GlQuake. You will notice some real ugly interpolation on for example monster skins.