Tremulous Forum

Media => Mapping Center => Topic started by: Darth Futuza on October 01, 2008, 04:48:50 am

Title: Textures, Powers of Two Question [SOLVED]
Post by: Darth Futuza 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.
Title: Re: Textures, Powers of Two Question
Post by: Taiyo.uk 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.
Title: Re: Textures, Powers of Two Question
Post by: zaishaza 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.
Title: Re: Textures, Powers of Two Question
Post by: Darth Futuza on October 01, 2008, 09:38:24 pm
Alright, thanks.
Title: Re: Textures, Powers of Two Question [SOLVED]
Post by: Lava Croft on October 02, 2008, 03:43:01 pm
Psst: http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt
Title: Re: Textures, Powers of Two Question [SOLVED]
Post by: gimhael on October 02, 2008, 04:41:13 pm
Hmm, the renderer seems to rescale any textures to powers of two on loading, so:
Title: Re: Textures, Powers of Two Question [SOLVED]
Post by: Lava Croft 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.