Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP PEX Implementation and Programming Supplement: HP9000 Series 700 Color Workstations > Chapter 9 Overview of CGE PEX Texture Mapping

Step 4: Set Up the Look-Up Tables (LUTs)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Four LUTs — Binding, Coordinate Source, Composition, and Sampling — are used to control the mapping of textures onto primitives. These LUTs are created, manipulated, and inquired using the standard calls PEXCreateLookupTable, PEXGetTableInfo, PEXGetDefinedIndices, and the extended calls, PEXExtSetTableEntries, PEXExtGetTableEntry, PEXExtGetTableEntries, and PEXExtFreeTableEntries.

The function PEXExtChangeRenderer must be used to register the Texture Mapping Lookup Tables with the PEX renderer. PEXExtSetRendererAttributeMask or PEXExtSetRendererAttributeMaskAll may be used to set the mask needed by the PEXExtChangeRenderer call. The extended calls PEXExtGetRendererAttributes and PEXExtFreeRendererAttributes can be used to inquire and free the extended attributes of a PEX renderer.

  • “Binding LUT ”: Associates a texture map with its orientation on a primitive, its texture composition and the texture-map sampling method by referencing the texture map description and indices into the Coordinate Source LUT, Composition LUT, and Sampling LUT. In general, there will be one Binding LUT entry for each primitive in the database that is to be texture-mapped.

  • “Coordinate-Source LUT”: Defines how a texture map is oriented on a primitive.

  • “Composition LUT ”: Defines how the values in a texture map are blended with a primitive's color and alpha values.

  • “Sampling LUT ”: Defines how a texture map is sampled as it is mapped onto a primitive.

Binding LUT

table_type〉 = PEXExtLUTTMBinding

struct PEXExtTMBindingEntry {
PEXExtTMDescription tm_description_id; /* Texture ID. Returned by
PEXExtCreateTMDescription */
PEXTableIndex coord_source_index; /* Index into Coordinate
Source LUT */
PEXTableIndex composition_index; /* Index into Composition
LUT */
PEXTableIndex sampling_index; /* Index into Sampling LUT */
}

Coordinate-Source LUT

table_type〉 = PEXExtLUTTMCoordSource

struct PEXExtTMCoordSourceEntry {
PEXEnumTypeIndex tm_source; /* tm_source and fp_data_index are
used only with texture maps that are
defined for explicit parameterization;
that is, parameterization is set to
PEXExtTMParamExplicit when
PEXExtCreateTMDescription is
called. For other parameterization
methods, these values are ignored.
The only supported value is:
PEXExtTMCoordSourceFloatData: Source
is included in the vertex's
floating-point data list
(default). */
unsigned short int fp_data_index; /* Specifies the location of the
floating-point data at the end of
vertex if tm_source is set to
PEXExtTMCoordSourceFloatData. */
PEXMatrix orientation; /* The texture coordinates are
transformed by the orientation matrix
before they are interpolated. */
}

Composition LUT

table_type〉 = PEXExtLUTTMComposition

struct PEXExtTMCompositionEntry {
PEXEnumTypeIndex method; /* Specifies how the texture map is
blended with a primitive's existing
color and alpha data. Supported
values are:
PEXExtTMCompositeReplace: The
texture map data replaces the
primitive's existing data
(default operation).
PEXExtTMCompositeModulate: The
texture map and primitive data are
blended.
PEXExtTMCompositeDecal: The
texture-map color and the
primitive color are blended by the
texture map alpha. If the texture
map alpha is not defined, the
texture map color replaces the
primitive color, and the
primitive's alpha is replaced
with 1.0. */
unsigned short reserved; /* Ignored */
union {
PEXColorSpecifier decal_bkgd_color;/* Not used by HP PEX */
struct {
unsigned long channel_number; /* R=0, G=1, B=2 */
PEXColorSpecifier color;
} blend_env; /* Not used by HP PEX */
struct {
unsigned long channel_number; /* R=0, G=1, B=2 */
PEXColorSpecifier color1;
PEXColorSpecifier color2;
} blend_repl; /* Not used by HP PEX */
PEXExtImpDepData imp_dep; /* Not used by HP PEX */
} data;
}

Sampling LUT

table_type〉 = PEXExtLUTTMSampling

struct PEXExtTMSamplingEntry {
PEXEnumTypeIndex minification_method;
/* Used when multiple texture-map texels map
to a single primitive pixel. Supported values
are:
PEXExtTMTexelSampleSingleBase: The closest
single texel selected by the texture
coordinate(s) is sampled from the base
texture map level (default).
PEXExtTMTexelSampleLinearBase: The 2^n
closest texels selected by the texture
coordinate(s) are sampled from the base
texture map level. Note that n is the
dimension (1D, 2D, or 3D) of the texture
map. The weighted average of the selected
texels is used.
PEXExtTMTexelSampleSingleInMipmap: The
closest single texel selected by the
texture coordinate(s) is sampled from the
closest texture map level to the sample
depth.
PEXExtTMTexelSampleLinearInMipmap: The
2^n closest texels selected by the
texture coordinate(s) are sampled from the
closest texture map level to the sample
depth. Note that n is the dimension
(1D, 2D, or 3D) of the texture map. The
weighted average of the selected texels is
used.
PEXExtTMTexelSampleBetweenMipmaps: The
closest texel selected by the texture
coordinate(s) is sampled from the two
closest texture map levels to the sample
depth. The texel found at the exact
sample depth by linear interpolation
between these two sampled texels is used.
If the sample depth is beyond the base or
pinnacle texture-map levels, that level is
used and this method behaves like
PEXExtTMTexelSampleSampleInMipmap.
PEXExtTMTexelSampleLinearBetweenMipmaps: The
2^n closest texels selected by the
texture coordinate (s) are sampled from
the two closest texture map levels to the
sample depth. Note that n is the
dimension (1D, 2D, or 3D) of the texture
map. A weighted average is taken of these
2^n texels on each of the texture map
levels. The texel found at the exact
sample depth by linear interpolation
between these two calculated texels is
used. If the sample depth is beyond the
base or pinnacle texture map levels, that
level is used and this method behaves like
PEXExtTMTexelSampleLinearInMipmap. */
PEXEnumTypeIndex magnification_method;
/* Used when a single texture-map texel is too
large to map to a single pixel of a primitive.
Supported values are:
PEXExtTMTexelSampleSingleBase: The closest
single texel selected by the texture
coordinate(s) is sampled from the base
texture map level (default).
PEXExtTMTexelSampleLinearBase: The 2^n
closest texels selected by the texture
coordinate(s) are sampled from the base
texture map level. Note that n is the
dimension (1D, 2D, or 3D) of the texture
map. The weighted average of the selected
texels is used. */
PEXEnumTypeIndex t0_boundary_condition; /* X boundary condition */
PEXEnumTypeIndex t1_boundary_condition; /* Y boundary condition */
PEXEnumTypeIndex t2_boundary_condition; /* Z boundary condition;
not used by HP PEX */
/* Specifies the texturing to be applied when
the texture coordinates select a point outside
the texture map. Supported values are:
PEXExtTMBoundaryCondClampColor: The
color specified by the clamp color source
is applied.
PEXExtTMBoundaryCondBoundary: The closest
boundary texture map texel is used.
PEXExtTMBoundaryCondWrap: Texel
sampling wraps back to the opposite
texture border creating a "rubber stamp"
effect.
PEXExtTMBoundaryCondMirror: Texel
sampling is reversed across the texture
map. This produces the effect of
alternating the texture map with a version
of the map that is "backwards", "upside
down", or both (depending on the values of
t0_boundary_condition and
t1_boundary_condition). */
PEXEnumTypeIndex boundary_clamp_color_source;
/* Determines source of color if the
boundary_condition is
PEXExtTMBoundaryCondClampColor. Supported
values are:
PEXExtTMClampColorSourceAbsolute:
Texturing is discontinued. The
primitive's color beyond the texture map
boundary remains unchanged (default).
PEXExtTMClampColorSourceExplicit: The color
specified in clamp_color is used. */
PEXColorSpecifier clamp_color;
/* Used when the boundary condition is
PEXExtTMBoundaryCondClampColor and the
clamp color source is
PEXExtTMClampColorSourceExplicit (default is
R = G = B = 0.0). */
float depth_sampling_bias_hint;
/* Used to adjust the sampling depth. A
factor of -1.0 moves the sampling depth one
level toward the Mip map's base level,
effectively making the texturing more
detailed or jaggy. A positive factor moves
the sampling depth away from the base level,
effectively blurring the texture (default is
0.0.). */
float t0_frequency_hint; /* \ Frequency hints */
float t1_frequency_hint; /* / for each dimension */
float t2_frequency_hint; /* t2 not used by HP PEX */
/* If a particular texture map has low spatial
frequency that would lead to unacceptable
blurring when sampling occurs, this hint maybe
set to a value between 0.0 and 1.0. A value
of 1.0 indicates unknown spatial frequency or
high spatial frequency (that is, there are
abrupt changes of color in the texture map).
The default is 1.0. */
}
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.