error = glu.Build1DMipmaps(internalformat, width, format, type, pixels)
glu.Build1DMipmaps()builds a series of prefiltered 1D texture maps of decreasing resolution. Mipmaps can be used so that textures don't appear aliased.
A return value of 0 indicates success. Otherwise a GLU error code is returned (See glu.ErrorString for details.).
glu.Build1DMipmaps() first checks whether the width of data is a power of 2. If not, it scales a copy of
pixels (up or down)
to the nearest power of two. This copy is used as the base for subsequent mipmapping operations. For example, if
57, a copy of
pixels scales up to 64 before mipmapping takes place. (If
width is exactly between powers of 2, the copy of
pixels is scaled upward.)
If the GL version is 1.1 or greater,
glu.Build1DMipmaps() uses proxy textures (See gl.TexImage1D for details.) to determine
if the implementation can store the requested texture in texture memory. If there isn't enough room,
width is halved (and
halved again) until it fits.
glu.Build1DMipmaps() builds a series of mipmap levels; it halves a copy of
pixels (or a scaled version of
necessary) until size 1 is reached. At each level, each texel in the halved image is an average of the corresponding two texels
in the larger image.
gl.TexImage1D() is called to load each of these images by level. If
width is a power of 2 which fits
in the implementation, level 0 is a copy of
pixels, and the highest level is log2(width). For example, if
width is 64 the
following images are built: 64x1, 32x1, 16x1, 8x1, 4x1, 2x1 and 1x1. These correspond to levels 0 through 6, respectively.
internalformat specifies the internal format of the texture image. See Internal pixel formats for details.
This can also be one of the special values 1, 2, 3, or 4.
format must be one of
type must be one of
Please note that this command operates directly with memory pointers. There is also a version which works with tables instead of memory pointers, but this is slower of course. See glu.BuildMipmaps for details. See Working with pointers for details on how to use memory pointers with Hollywood.
Please consult an OpenGL reference manual for more information.