Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:NEW

source files: [xc]txr.[ch]

SYNTAX

(SEND CLASS-TEXTURE :NEW

    [ :MINIFY-FN { :POINT | :BILINEAR | :MIPMAP-POINT | :MIPMAP-LINEAR
                  | :MIPMAP-BILINEAR | :MIPMAP-TRILINEAR } ]

    [ :MAGNIFY-FN { :POINT | :BILINEAR } ]
    [ :MERGE-TYPE { :DECAL | :MODULATE | :BLEND | :REPLACE } ]
    [ :WRAP-TYPE  { :CLAMP | :REPEAT   } ]
    [ :TEXTURE-IS { :BY-POINT | :BY-FACET | :ON | :OFF | NIL } ]
    [ :GRAPHIC-RELATION <pixel-relation> ]
) 

DESCRIPTION

Creates a new texture.

MAGNIFY-FN selects the manner in which the texture image is resampled when enlarging it to fill a polygon. :POINT picks the nearest point, :BILINEAR does bilinear interpolation between adjacent pixel color values.

MINIFY-FN selects the manner in which the texture image is resampled when shrinking it to fit a polygon. :POINT and :BILINEAR resampling work directly from the given image, either picking the nearest point, or bilinearly interpolating. The :MIPMAP-* options work from a (transparently constructed) pyramid of different-resolution versions of the image, interpolating between neighboring pixels and resolutions in various manners; they can produce nicer results, but also halve the maximum supported resolution. Most of functions attempt to blur the image nicely; textures which need sharp edges may do better with :POINT.

MERGE-TYPE controls how the texture image is combined with the normal color of the polygon: :MODULATE multiplies the normal colors by the texture image colors to produce a composite of the two; :DECAL discards the normal color and simply uses the texture image color information. Since the lighting computations affect only the "normal color", selecting :DECAL effectively turns off lighting effects, as well as material effects and so forth. Under GL, :BLEND is the same as :MODULATE and :REPLACE is the same as :DECAL. Under OpenGL, the resulting color and alpha come entirely from the texture under :REPLACE (vs resulting alpha coming entirely from the material under :DECAL) and the material color is emphasized more under :BLEND than under :MODULATE -- see the OpenGL manual for the full set of formulae.

WRAP-TYPE controls what happens when texture coordinates outside the range (0,1) are encountered: :CLAMP specifies that values greater than 1 should be treated as being 1, and values less than 0 should be treated as being 0, while :REPEAT specifies that the integral part should be ignored, and only the fractional part used, resulting in the image repeating over and over as the texture coordinates change monotonically.

TEXTURE-IS provides a way to select whether facet or point texture coordinates should be used, if both should be present, and also a convenient way to deactivate a texture completely (possibly for increased interactive speed). Setting :TEXTURE-IS to :BY-POINT will use point texture coordinates by preference, given a choice; selecting :BY-FACET will use facet texture coordinates given a choice; selecting :OFF will de-activate (this) texture. Selecting :ON is currently the same as selecting :BY-POINT, selecting NIL is currently the same as selecting :OFF.


Go to the first, previous, next, last section, table of contents.