Vizard 7 » Reference » Appearance & Texturing » Texture appearance and filtering
7.6

Texture appearance and filtering

Texture map appearance

To change the texture map appearance of your 3D object, modify it by adding <node3d>.appearance to your script, replacing <node3d> with your 3D object, and one of the following flags:

Texture modifier

Flag

Automatic texture coordinate generation for reflective surfaces.

viz.TEXGEN

Linear and mipmap filtering for texture magnification and minification.

viz.TEXMIPMAP

Don't perform any linear or mipmap filtering.

viz.TEXNEAREST

Force modulation of texture with any scene lights and the surfaces underlying material color properties.

viz.TEXMODULATE

Display the exact bitmap as the surface texture.

viz.TEXDECAL

Allow texture coordinates outside [0,1] range.

viz.TEXREPEAT

Clamp texture coordinates to [0,1] range.

viz.TEXCLAMP

Texture filtering

Vizard uses OpenGL filtering modes for textures. The filter mode defines how a texture pixel is calculated. There are two filter modes, the minification filter and magnification filter. The minification filter is used when the size of the texture on screen is smaller than the actual texture. The magnification filter is used when the size of the texture on screen is larger than the actual texture. Here is a list of all the possible filter modes:

Texture filter flag

Description

viz.LINEAR

Use linear interpolation between the 4 nearest texture pixels. (Default for magnification filter).

viz.LINEAR_MIPMAP_LINEAR

Calculates linear texture pixel value from two nearest mipmaps and linearly interpolates between those two values. (Default for minification filter) (Only available for minification filter).

viz.LINEAR_MIPMAP_NEAREST

Uses the linearly interpolated texture pixel from the nearest mipmap. (Only available for minification filter).

viz.NEAREST

Use the nearest texture pixel.

viz.NEAREST_MIPMAP_LINEAR

Uses the nearest texture pixel from the two nearest mipmaps and linearly interpolates between them. (Only available for minification filter).

viz.NEAREST_MIPMAP_NEAREST

Uses the nearest texture pixel from the nearest mipmap. (Only available for minification filter).

Using linear filtering makes the texture look smoother, that is why Vizard uses it as the default. Here is sample code to set the filter mode of a texture to viz.NEAREST:

texture.filter(viz.MIN_FILTER,viz.NEAREST)
texture.filter(viz.MAG_FILTER,viz.NEAREST)

See also

In this section:

Appearance & texturing basics

Texture wrapping

Multi-texturing

Environment mapping

Texture types

Texture matrix

Visibility

Draw order & Z offsetting

Projecting textures

Appearance & texturing command table

Other sections:

Tutorial: Applying Textures

Example scripts:

Alpha map