PDA

View Full Version : level of detail in q3 r_picmip



08-13-2000, 12:37 AM
void glTexImage2D(
GLenum target,
GLint level,
GLint components,
GLsizei width,
GLsizei height,
GLint border,
GLenum format,
GLenum type,
const GLvoid *pixels
);
level
The level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.

wat does it means ?
it controls the texture quality ? or am i required to produce a lower quality texture ??

how does q3 controls it's texture by it's picmip ? izzit the glTexImage2D function ??

Bob
08-13-2000, 03:46 AM
level is the mipmap level you intend to upload. If you say 0, you will upload the main texture. If you say 1, you will upload the first mipmap level of the texture. 2 is the second mipmap level and so on.

If you want to upload the second mipmap level, you must scale your image downwards by 4 (manually, and 4 is 2^n where n=2 for second mipmap level) before uploading the texture.

08-13-2000, 05:52 AM
does it means i need to create another small version of my texture to upload ?

Bob
08-13-2000, 06:04 AM
Yeah, and if you create one mipmap level, you need to create them all... all the way down to 1x1. This can be changed by some functions, dunno name, but it has something to to with BIAS_LOD.

08-13-2000, 08:20 PM
but how does q3 control it?
i dun c any multi version of textures in it's pk3 files..
it's all single texture
den r_picmip controls da quality/detail of texture.

Bob
08-14-2000, 01:53 AM
Well, the scaling is done by Q3. It loads the main texture and uploads it, then, in system memory, it scales the image downwards and uploads the first mipmap level. When this is done, the image is scaled once more, and uplaoded as second mipmap level. This procedure is done untill all levels has been done.

And concerning texture quality/detail, thats another thing. If you want lower quality/detail (faster texturmapping), you just choose another internal texture format, with less bits per colorelement. A R5G5B5-texture (5 bits for each colorelement) is faster, but also less detailed/less quality compared to a R8G8B8-texture (8 bits per colorelement). The last version occupies more memory and is slower, but looks nicer.

08-14-2000, 03:37 AM
hey man thanks alot..yar a great help.