Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Teddy::Imports::LWSurfaceBlok Class Reference

Parser for LightWave object file surface blok subchunks. More...

#include <LWSurfaceBlok.h>

Collaboration diagram for Teddy::Imports::LWSurfaceBlok:

Collaboration graph
[legend]
List of all members.

Public Methods

 LWSurfaceBlok (LWSurface *surface)
 Constructor. More...

void processBlok ()

Protected Methods

void applyAttributes (ID4 type)
void applyImageMap ()
void applyProcedural ()
void applyGradient ()
void applyShader ()
void readChannel_ID4 ()
void readEnable_U2 ()
void readOpacity_U2_FP4_VX ()
void readDisplacementAxis_U2 ()
void readTextureMap (ID4 parent)
void readTextureCenter_VEC12_VX ()
 CNTR. More...

void readTextureSize_VEC12_VX ()
 SIZE. More...

void readTextureRotation_VEC12_VX ()
 ROTA. More...

void readTextureReferenceObject_S0 ()
 OREF. More...

void readTextureFalloff_U2_VEC12_VX ()
 FALL. More...

void readTextureCoordinateSystem_U2 ()
 CSYS. More...

void readTextureProjectionMode_U2 ()
 PROJ. More...

void readTextureMajorAxis_U2 ()
 AXIS. More...

void readTextureImageMap_VX ()
 IMAG. More...

void readTextureWrapOptions_U2_U2 ()
 WRAP. More...

void readTextureWrapWidthAmount_FP4_VX ()
 WRPW. More...

void readTextureWrapHeightAmount_FP4_VX ()
 WRPH. More...

void readTextureUV_VertexMap_S0 ()
 VMAP. More...

void readTextureAntialiasingStrength_U2_FP4 ()
 AAST. More...

void readTexturePixelBlending_U2 ()
 PIXB. More...

void readTextureStack_VX ()
 STCK. More...

void readTextureAmplitude_FP4_VX ()
 TAMP. More...

void readTextureNegative_U2 ()
 NEGA. More...

void readProceduralAxis_U2 ()
 AXIS. More...

void readProceduralBasicValue_FP4_1_or_3 ()
 VALU. More...

void readProceduralAlgorithm_S0_data ()
 FUNC. More...

void readGradientParameter_S0 ()
 PNAM. More...

void readGradientItem_S0 ()
 INAM. More...

void readGradientRangeStart_FP4 ()
 GRST. More...

void readGradientRangeEnd_FP4 ()
 GREN. More...

void readGradientRepeat_U2 ()
 GRPT. More...

void readGradientKeys_FP4_data_FP4 ()
 FKEY. More...

void readGradientKeyParameters_data_U2 ()
 IKEY. More...

void readShaderAlgorithm_S0_data ()
 FUNC. More...


Protected Attributes

LWFilef
LWSurfacesurface
ID4 texture_channel
 CHAN. More...

U2 enable
 ENAB. More...

U2 opacity_type
 OPAC. More...

FP4 opacity
 OPAC. More...

VX opacity_envelope
 OPAC. More...

U2 displacement_axis
 AXIS. More...

VEC12 texture_center
 CNTR. More...

VX texture_center_envelope
 CNTR. More...

VEC12 texture_size
 SIZE. More...

VX texture_size_envelope
 SIZE. More...

VEC12 texture_rotation
 ROTA. More...

VX texture_rotation_envelope
 ROTA. More...

S0 texture_reference_object
 OREF. More...

U2 texture_falloff_type
 FALL. More...

VEC12 texture_falloff
 FALL. More...

VX texture_falloff_envelope
 FALL. More...

U2 texture_coordinate_system
 CSYS. More...

U2 texture_projection_mode
 PROJ. More...

U2 texture_major_axis
 AXIS. More...

VX texture_image_map
 IMAG. More...

U2 texture_width_wrap
 WRAP. More...

U2 texture_height_wrap
 WRAP. More...

FP4 texture_wrap_width_cycles
 WRPW. More...

VX texture_wrap_width_cycles_envelope
 WRPW. More...

FP4 texture_wrap_height_cycles
 WRPH. More...

VX texture_wrap_height_cycles_envelope
 WRPH. More...

S0 texture_uv_vertex_map
 VMAP. More...

U2 texture_antialiasing_type
 AAST. More...

FP4 texture_antialiasing_strength
 AAST. More...

U2 texture_pixel_blending
 PIXB. More...

VX texture_stack
 STCK. More...

FP4 texture_amplitude
 TAMP. More...

VX texture_amplitude_envelope
 TAMP. More...

U2 texture_negative
 NEGA. More...

U2 procedural_axis
 AXIS. More...

S0 procedural_algorithm
 FUNC. More...

S0 gradient_parameter
 PNAM. More...

S0 gradient_item
 INAM. More...

FP4 gradient_range_start
 GTST. More...

FP4 gradient_range_end
 GREN. More...

U2 gradient_repeat
 GRPT. More...

S0 shader_algorithm
 FUNC. More...


Detailed Description

Parser for LightWave object file surface blok subchunks.

Warning:
Very incomplete

Bug:
Destructors missing?

A surface may contain any number of 'blocks' which hold texture layers or shaders. The blocks are defined by a sub-chunk with the following format.

BLOK { type { ordinal[ID4], header[SUB-CHUNK] * }, attributes[SUB-CHUNK] * }

Immediately inside the block sub-chunk is another sub-chunk which is the header for the block. The type code for this header block defines the type of the block. This header block contains an ordinal string followed by any number and type of header sub-chunks. Following the required header sub-chunk, sub-chunks which contain the attributes of this block are found in any order. The chunks here will depend on the overall type of the block.

Ordinary string compare functions are used to sort the ordinal strings. These are never read by the user, so they can contain any characters from 1 to 255 and tend to be very short. The only rule is that an ordinal string must not end with a 1 byte, since that prevents arbitrary insertion.

Definition at line 71 of file LWSurfaceBlok.h.


Constructor & Destructor Documentation

Teddy::Imports::LWSurfaceBlok::LWSurfaceBlok LWSurface   surface
 

Constructor.

Definition at line 44 of file LWSurfaceBlok.cpp.

References displacement_axis, enable, f, gradient_range_end, gradient_range_start, gradient_repeat, opacity, opacity_envelope, opacity_type, procedural_axis, surface, texture_amplitude, texture_amplitude_envelope, texture_antialiasing_strength, texture_antialiasing_type, texture_center, texture_center_envelope, texture_channel, texture_coordinate_system, texture_falloff, texture_falloff_envelope, texture_falloff_type, texture_height_wrap, texture_image_map, texture_major_axis, texture_negative, texture_pixel_blending, texture_projection_mode, texture_rotation, texture_rotation_envelope, texture_size, texture_size_envelope, texture_stack, texture_width_wrap, texture_wrap_height_cycles, texture_wrap_height_cycles_envelope, texture_wrap_width_cycles, texture_wrap_width_cycles_envelope, and Vector.


Member Function Documentation

void Teddy::Imports::LWSurfaceBlok::applyAttributes ID4    type [protected]
 

Definition at line 336 of file LWSurfaceBlok.cpp.

References applyGradient, applyImageMap, applyProcedural, applyShader, Teddy::SysSupport::dmsg, Teddy::Imports::ID4, ID_GRAD, ID_IMAP, ID_PROC, ID_SHDR, and Teddy::SysSupport::M_LWO.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::applyGradient   [protected]
 

Definition at line 45 of file LWSurfaceBlokGradient.cpp.

References Teddy::SysSupport::dmsg, enable, and Teddy::SysSupport::M_LWO.

Referenced by applyAttributes.

void Teddy::Imports::LWSurfaceBlok::applyImageMap   [protected]
 

Definition at line 55 of file LWSurfaceBlokImageMap.cpp.

References Teddy::Imports::did, Teddy::SysSupport::dmsg, Teddy::SysSupport::emsg, enable, Teddy::SysSupport::fix_file_name, LW_PROJECTION_CUBIC, LW_PROJECTION_CYLINDRICAL, LW_PROJECTION_FRONT, LW_PROJECTION_PLANAR, LW_PROJECTION_SPHERICAL, LW_PROJECTION_UV, Teddy::SysSupport::M_LWO, Teddy::SysSupport::M_TMAP, surface, texture_center, texture_channel, texture_image_map, texture_major_axis, and texture_size.

Referenced by applyAttributes.

void Teddy::Imports::LWSurfaceBlok::applyProcedural   [protected]
 

Definition at line 41 of file LWSurfaceBlokProcedural.cpp.

References Teddy::SysSupport::dmsg, enable, and Teddy::SysSupport::M_LWO.

Referenced by applyAttributes.

void Teddy::Imports::LWSurfaceBlok::applyShader   [protected]
 

Definition at line 37 of file LWSurfaceBlokShader.cpp.

Referenced by applyAttributes.

void Teddy::Imports::LWSurfaceBlok::processBlok  
 

LWO2 BLOK

Surface Blocks

A surface may contain any number of blocks which hold texture layers or shaders. Each block is defined by a subchunk with the following format.

BLOK { header[SUB-CHUNK], attributes[SUB-CHUNK] * }

Since this regular expression hides much of the structure of a block, it may be helpful to visualize a typical texture block in outline form.

-block -header -ordinal string -channel -enable flag -opacity... -texture mapping -center -size... -other attributes...

The first subchunk is the header. The subchunk ID specifies the block type, and the subchunks within the header subchunk define properties that are common to all block types. The ordinal string defines the sorting order of the block relative to other blocks. The header is followed by other subchunks specific to each type. For some texture layers, one of these will be a texture mapping subchunk that defines the mapping from object to texture space. All of these components are explained in the following sections.

Ordinal Strings

Each BLOK represents a texture layer applied to one of the surface channels, or a shader plug-in applied to the surface. If more than one layer is applied to a channel, or more than one shader is applied to the surface, we need to know the evaluation order of the layers or shaders, or in what order they are "stacked." The ordinal string defines this order.

Readers can simply compare ordinal strings using the C strcmp function to sort the BLOKs into the correct order. Writers of LWO2 files need to generate valid ordinal strings that put the texture layers and shaders in the right order. See the Object Examples supplement for an example function that generates ordinal strings.

To understand how LightWave uses these, imagine that instead of strings, it used floating-point fractions as the ordinals. Whenever LightWave needed to insert a new block between two existing blocks, it would find the new ordinal for the inserted block as the average of the other two, so that a block inserted between ordinals 0.5 and 0.6 would have an ordinal of 0.55.

But floating-point ordinals would limit the number of insertions to the (fixed) number of bits used to represent the mantissa. Ordinal strings are infinite-precision fractions written in base 255, using the ASCII values 1 to 255 as the digits (0 isn't used, since it's the special character that marks the end of the string).

Ordinals can't end on a 1, since that would prevent arbitrary insertion of other blocks. A trailing 1 in this system is like a trailing 0 in decimal, which can lead to situations like this,

0.5 "\x80" 0.50 "\x80\x01"

where there's no daylight between the two ordinals for inserting another block.

Definition at line 163 of file LWSurfaceBlok.cpp.

References applyAttributes, Teddy::Imports::did, Teddy::SysSupport::dmsg, f, Teddy::Imports::ID4, ID_AAST, ID_AXIS, ID_ENAB, ID_FKEY, ID_FUNC, ID_GRAD, ID_GREN, ID_GRPT, ID_GRST, ID_IKEY, ID_IMAG, ID_IMAP, ID_INAM, ID_NEGA, ID_OPAC, ID_PIXB, ID_PNAM, ID_PROC, ID_PROJ, ID_SHDR, ID_STCK, ID_TAMP, ID_TMAP, ID_VALU, ID_WRAP, ID_WRPH, ID_WRPW, Teddy::SysSupport::M_LWO, readChannel_ID4, readDisplacementAxis_U2, readEnable_U2, readGradientItem_S0, readGradientKeyParameters_data_U2, readGradientKeys_FP4_data_FP4, readGradientParameter_S0, readGradientRangeEnd_FP4, readGradientRangeStart_FP4, readGradientRepeat_U2, readOpacity_U2_FP4_VX, readProceduralAlgorithm_S0_data, readProceduralAxis_U2, readProceduralBasicValue_FP4_1_or_3, readShaderAlgorithm_S0_data, readTextureAmplitude_FP4_VX, readTextureAntialiasingStrength_U2_FP4, readTextureImageMap_VX, readTextureMajorAxis_U2, readTextureMap, readTextureNegative_U2, readTexturePixelBlending_U2, readTextureProjectionMode_U2, readTextureStack_VX, readTextureUV_VertexMap_S0, readTextureWrapHeightAmount_FP4_VX, readTextureWrapOptions_U2_U2, readTextureWrapWidthAmount_FP4_VX, and Teddy::Imports::U2.

void Teddy::Imports::LWSurfaceBlok::readChannel_ID4   [protected]
 

LWO2::BLOK Header Channel

CHAN { texture-channel[ID4] }

This is required in all texture layer blocks and can have a value of COLR, DIFF, LUMI, SPEC, GLOS, REFL, TRAN, RIND, TRNL, or BUMP, The texture layer is applied to the corresponding surface attribute. If present in a shader block, this value is ignored.

Definition at line 407 of file LWSurfaceBlok.cpp.

References f, and texture_channel.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readDisplacementAxis_U2   [protected]
 

LWO2::BLOK Header Displacement Axis

AXIS { displacement-axis[U2] }

For displacement mapping, defines the plane from which displacements will occur. The value is 0, 1 or 2 for the X, Y or Z axis.

Definition at line 464 of file LWSurfaceBlok.cpp.

References displacement_axis, and f.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readEnable_U2   [protected]
 

LWO2::BLOK Header Enable State

ENAB { enable[U2] }

True if the texture layer or shader should be evaluated during rendering. If ENAB is missing, the block is assumed to be enabled.

Definition at line 419 of file LWSurfaceBlok.cpp.

References enable, and f.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientItem_S0   [protected]
 

INAM.

LWO2::BLOK::GRAD Item Name

INAM { item-name[S0] }

The name of a scene item. This is used when the input parameter is derived from a property of an item in the scene.

Definition at line 828 of file LWSurfaceBlok.cpp.

References f, and gradient_item.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientKeyParameters_data_U2   [protected]
 

IKEY.

LWO2::BLOK::GRAD Key Parameters

IKEY { interpolation[U2] * }

An array of integers defining the interpolation for the span preceding each key. Possible values include

0 - Linear 1 - Spline 2 - Step

Definition at line 892 of file LWSurfaceBlok.cpp.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientKeys_FP4_data_FP4   [protected]
 

FKEY.

LWO2::BLOK::GRAD Key Values

FKEY { ( input[FP4], output[FP4] # 4 )* }

The transfer function is defined by an array of keys, each with an input value and an RGBA output vector. Given an input value, the gradient can be evaluated by selecting the keys whose positions bracket the value and interpolating between their outputs. If the input value is lower than the first key or higher than the last key, the gradient value is the value of the closest key.

Definition at line 876 of file LWSurfaceBlok.cpp.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientParameter_S0   [protected]
 

PNAM.

LWO2::BLOK::GRAD Parameter Name

PNAM { parameter[S0] }

The input parameter. Possible values include

"Previous Layer" "Bump" "Slope" "Incidence Angle" "Light Incidence" "Distance to Camera" "Distance to Object" "X Distance to Object" "Y Distance to Object" "Z Distance to Object" "Weight Map"

Definition at line 815 of file LWSurfaceBlok.cpp.

References f, and gradient_parameter.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientRangeEnd_FP4   [protected]
 

GREN.

Definition at line 846 of file LWSurfaceBlok.cpp.

References f, and gradient_range_end.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientRangeStart_FP4   [protected]
 

GRST.

LWO2::BLOK::GRAD Gradient Range

GRST, GREN { input-range[FP4] }

The start and end of the input range. These values only affect the display of the gradient in the user interface. They don't affect rendering.

Definition at line 842 of file LWSurfaceBlok.cpp.

References f, and gradient_range_start.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readGradientRepeat_U2   [protected]
 

GRPT.

LWO2::BLOK::GRAD Repeat Mode

GRPT { repeat-mode[U2] }

The repeat mode. This is currently undefined.

Definition at line 857 of file LWSurfaceBlok.cpp.

References f, and gradient_repeat.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readOpacity_U2_FP4_VX   [protected]
 

LWO2::BLOK Header Opacity

OPAC { type[U2], opacity[FP4], envelope[VX] }

Opacity is valid only for texture layers. It specifies how opaque the layer is with respect to the layers before it (beneath it) on the same channel, or how the layer is combined with the previous layers. The types can be

0 - Additive 1 - Subtractive 2 - Difference 3 - Multiply 4 - Divide 5 - Alpha 6 - Texture Displacement

Alpha opacity uses the current layer as an alpha channel. The previous layers are visible where the current layer is white and transparent where the current layer is black. Texture Displacement distorts the underlying layers. If OPAC is missing, 100% Additive opacity is assumed.

Definition at line 448 of file LWSurfaceBlok.cpp.

References f, opacity, opacity_envelope, and opacity_type.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readProceduralAlgorithm_S0_data   [protected]
 

FUNC.

LWO2::BLOK::PROC Algorithm and Parameters

FUNC { algorithm-name[S0], data[...] }

The FUNC subchunk names the procedural and stores its parameters. The name will often map to a plug-in name. The variable-length data following the name belongs to the procedural.

Definition at line 790 of file LWSurfaceBlok.cpp.

References f, and procedural_algorithm.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readProceduralAxis_U2   [protected]
 

AXIS.

LWO2::BLOK::PROC Axis

AXIS { axis[U2] }

If the procedural has an axis, it may be defined with this chunk using a value of 0, 1 or 2.

Definition at line 762 of file LWSurfaceBlok.cpp.

References f, and procedural_axis.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readProceduralBasicValue_FP4_1_or_3   [protected]
 

VALU.

LWO2::BLOK::PROC Basic Value

VALU { value[FP4] # (1, 3) }

Procedurals are often modulations between the current channel value and another value, given here. This may be a scalar or a vector.

Definition at line 775 of file LWSurfaceBlok.cpp.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readShaderAlgorithm_S0_data   [protected]
 

FUNC.

LWO2::BLOK::SHDR Shader Algorithm

FUNC { algorithm-name[S0], data[...] }

Just like a procedural texture layer, a shader is defined by an algorithm name (often a plug-in), followed by data owned by the shader.

Definition at line 906 of file LWSurfaceBlok.cpp.

References f, and shader_algorithm.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureAmplitude_FP4_VX   [protected]
 

TAMP.

LWO2::BLOK::IMAP Texture Amplitude

TAMP { amplitude[FP4], envelope[VX] }

Appears in image texture layers applied to the bump channel. Texture amplitude scales the bump height derived from the pixel values. The default is 1.0.

Definition at line 743 of file LWSurfaceBlok.cpp.

References f, texture_amplitude, and texture_amplitude_envelope.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureAntialiasingStrength_U2_FP4   [protected]
 

AAST.

LWO2::BLOK::IMAP Antialiasing Strength

AAST { flags[U2], antialising-strength[FP4] }

The low bit of the flags word is an enable flag for texture antialiasing. The antialiasing strength is proportional to the width of the sample filter, so larger values sample a larger area of the image.

Definition at line 701 of file LWSurfaceBlok.cpp.

References f, texture_antialiasing_strength, and texture_antialiasing_type.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureCenter_VEC12_VX   [protected]
 

CNTR.

LWO2::BLOK::TMAP Position, Orientation and Size

CNTR, SIZE, ROTA { vector[VEC12], envelope[VX] }

These subchunks each consist of a vector for the texture's size, center and rotation. The size and center are normal positional vectors in meters, and the rotation is a vector of heading, pitch and bank in radians. If missing, the center and rotation are assumed to be zero. The size should always be specified if it si to be used for any given mapping.

Definition at line 481 of file LWSurfaceBlok.cpp.

References f, texture_center, and texture_center_envelope.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureCoordinateSystem_U2   [protected]
 

CSYS.

LWO2::BLOK::TMAP Coordinate System

CSYS { type[U2] }

The coordinate system can be 0 for object coordinates (the default if the chunk is missing) or 1 for world coordinates.

Definition at line 548 of file LWSurfaceBlok.cpp.

References f, and texture_coordinate_system.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureFalloff_U2_VEC12_VX   [protected]
 

FALL.

LWO2::BLOK::TMAP Falloff

FALL { type[U2], vector[VEC12], envelope[VX] }

Texture effects may fall off with distance from the texture center if this subchunk is present. The vector represents a rate per unit distance along each axis. The type can be

0 - Cubic; Falloff is linear along all three axes independently. 1 - Spherical; Falloff is proportional to the Euclidean distance from the center. 2 - Linear X 3 - Linear Y 4 - Linear Z

Falloff is linear only along the specified axis. The other two vector components are ignored.

Definition at line 532 of file LWSurfaceBlok.cpp.

References f, texture_falloff, texture_falloff_envelope, and texture_falloff_type.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureImageMap_VX   [protected]
 

IMAG.

LWO2::BLOK::IMAP Image Map

IMAG { texture-image[VX] }

The CLIP index of the mapped image.

Definition at line 620 of file LWSurfaceBlok.cpp.

References f, and texture_image_map.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureMajorAxis_U2   [protected]
 

AXIS.

LWO2::BLOK::IMAP Major Axis

AXIS { texture-axis[U2] }

The major axis used for planar, cylindrical and spherical projections. The value is 0, 1 or 2 for the X, Y or Z axis.

Definition at line 608 of file LWSurfaceBlok.cpp.

References f, and texture_major_axis.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureMap ID4    parent [protected]
 

LWO2 BLOK Texture Mapping

Image map and procedural textures employ the TMAP subchunk to define the mapping they use to get from object or world coordinate space to texture space.

TMAP { attributes[SUB-CHUNK] * }

The TMAP subchunk contains a set of attribute chunks which describe the different aspects of this mapping.

Definition at line 361 of file LWSurfaceBlok.cpp.

References Teddy::Imports::did, Teddy::SysSupport::dmsg, f, Teddy::Imports::ID4, ID_CNTR, ID_CSYS, ID_FALL, ID_OREF, ID_ROTA, ID_SIZE, Teddy::SysSupport::M_LWO, readTextureCenter_VEC12_VX, readTextureCoordinateSystem_U2, readTextureFalloff_U2_VEC12_VX, readTextureReferenceObject_S0, readTextureRotation_VEC12_VX, readTextureSize_VEC12_VX, and Teddy::Imports::U2.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureNegative_U2   [protected]
 

NEGA.

Definition at line 749 of file LWSurfaceBlok.cpp.

References f, and texture_negative.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTexturePixelBlending_U2   [protected]
 

PIXB.

LWO2::BLOK::IMAP Pixel Blending

PIXB { flags[U2] }

Pixel blending enlarges the sample filter when it would otherwise be smaller than a single image map pixel. If the low-order flag bit is set, then pixel blending is enabled.

Definition at line 717 of file LWSurfaceBlok.cpp.

References f, and texture_pixel_blending.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureProjectionMode_U2   [protected]
 

PROJ.

LWO2::BLOK::IMAP Projection Mode

PROJ { projection-mode[U2] }

The projection defines how 2D coordinates in the image are transformed into 3D coordinates in the scene. In the following list of projections, image coordinates are called r (horizontal) and s (vertical).

0 - Planar

The image is projected on a plane along the major axis (specified in the AXIS subchunk). r and s map to the other two axes.

1 - Cylindrical

The image is wrapped cylindrically around the major axis. r maps to longitude (angle around the major axis).

2 - Spherical

The image is wrapped spherically around the major axis. r and s map to longitude and latitude.

3 - Cubic

Like Planar, but projected along all three axes. The dominant axis of the geometric normal selects the projection axis for a given surface spot.

4 - Front Projection

The image is projected on the current camera's viewplane. r and s map to points on the viewplane.

5 - UV

r and s map to points (u, v) defined for the geometry using a vertex map (identified in the BLOK's VMAP subchunk).

Definition at line 595 of file LWSurfaceBlok.cpp.

References f, and texture_projection_mode.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureReferenceObject_S0   [protected]
 

OREF.

LWO2::BLOK::TMAP Reference Object

OREF { object-name[S0] }

Specifies a reference object for the texture. The reference object is given by name, and the scene position, rotation and scale of the object are combined with the previous chunks to compute the texture mapping. If the object name is "(none)" or OREF is missing, no reference object is used.

Definition at line 509 of file LWSurfaceBlok.cpp.

References f, and texture_reference_object.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureRotation_VEC12_VX   [protected]
 

ROTA.

Definition at line 492 of file LWSurfaceBlok.cpp.

References f, texture_rotation, and texture_rotation_envelope.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureSize_VEC12_VX   [protected]
 

SIZE.

Definition at line 487 of file LWSurfaceBlok.cpp.

References f, texture_size, and texture_size_envelope.

Referenced by readTextureMap.

void Teddy::Imports::LWSurfaceBlok::readTextureStack_VX   [protected]
 

STCK.

LWO2::BLOK::IMAP Stack

STCK { value[FP4], envelope[VX] }

Reserved for future use. The default value is 0.0.

Definition at line 729 of file LWSurfaceBlok.cpp.

References f, and texture_stack.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureUV_VertexMap_S0   [protected]
 

VMAP.

LWO2::BLOK::IMAP UV Vertex Map

VMAP { txuv-map-name[S0] }

For UV projection, which depends on texture coordinates at each vertex, this selects the name of the TXUV vertex map that contains those coordinates.

Definition at line 686 of file LWSurfaceBlok.cpp.

References f, and texture_uv_vertex_map.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureWrapHeightAmount_FP4_VX   [protected]
 

WRPH.

Definition at line 672 of file LWSurfaceBlok.cpp.

References f, texture_wrap_height_cycles, and texture_wrap_height_cycles_envelope.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureWrapOptions_U2_U2   [protected]
 

WRAP.

LWO2::BLOK::IMAP Image Wrap Options

WRAP { width-wrap[U2], height-wrap[U2] }

Specifies how the color of the texture is derived for areas outside the image.

0 - Reset

Areas outside the image are assumed to be black. The ultimate effect of this depends on the opacity settings. For an additive texture layer on the color channel, the final color will come from the preceding layers or from the base color of the surface.

1 - Repeat (default)

The image is repeated or tiled.

2 - Mirror

Like repeat, but alternate tiles are mirror-reversed.

3 - Edge

The color is taken from the image's nearest edge pixel.

Definition at line 652 of file LWSurfaceBlok.cpp.

References f, texture_height_wrap, and texture_width_wrap.

Referenced by processBlok.

void Teddy::Imports::LWSurfaceBlok::readTextureWrapWidthAmount_FP4_VX   [protected]
 

WRPW.

LWO2::BLOK::IMAP Image Wrap Amount

WRPW, WRPH { cycles[FP4], envelope[VX] }

For cylindrical and spherical projections, these parameters control how many times the image repeats over each full interval.

Definition at line 666 of file LWSurfaceBlok.cpp.

References f, texture_wrap_width_cycles, and texture_wrap_width_cycles_envelope.

Referenced by processBlok.


Member Data Documentation

U2 Teddy::Imports::LWSurfaceBlok::displacement_axis [protected]
 

AXIS.

Definition at line 143 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readDisplacementAxis_U2.

U2 Teddy::Imports::LWSurfaceBlok::enable [protected]
 

ENAB.

Definition at line 139 of file LWSurfaceBlok.h.

Referenced by applyGradient, applyImageMap, applyProcedural, LWSurfaceBlok, and readEnable_U2.

LWFile* Teddy::Imports::LWSurfaceBlok::f [protected]
 

Definition at line 134 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, processBlok, readChannel_ID4, readDisplacementAxis_U2, readEnable_U2, readGradientItem_S0, readGradientParameter_S0, readGradientRangeEnd_FP4, readGradientRangeStart_FP4, readGradientRepeat_U2, readOpacity_U2_FP4_VX, readProceduralAlgorithm_S0_data, readProceduralAxis_U2, readShaderAlgorithm_S0_data, readTextureAmplitude_FP4_VX, readTextureAntialiasingStrength_U2_FP4, readTextureCenter_VEC12_VX, readTextureCoordinateSystem_U2, readTextureFalloff_U2_VEC12_VX, readTextureImageMap_VX, readTextureMajorAxis_U2, readTextureMap, readTextureNegative_U2, readTexturePixelBlending_U2, readTextureProjectionMode_U2, readTextureReferenceObject_S0, readTextureRotation_VEC12_VX, readTextureSize_VEC12_VX, readTextureStack_VX, readTextureUV_VertexMap_S0, readTextureWrapHeightAmount_FP4_VX, readTextureWrapOptions_U2_U2, and readTextureWrapWidthAmount_FP4_VX.

S0 Teddy::Imports::LWSurfaceBlok::gradient_item [protected]
 

INAM.

Definition at line 183 of file LWSurfaceBlok.h.

Referenced by readGradientItem_S0.

S0 Teddy::Imports::LWSurfaceBlok::gradient_parameter [protected]
 

PNAM.

Definition at line 182 of file LWSurfaceBlok.h.

Referenced by readGradientParameter_S0.

FP4 Teddy::Imports::LWSurfaceBlok::gradient_range_end [protected]
 

GREN.

Definition at line 185 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readGradientRangeEnd_FP4.

FP4 Teddy::Imports::LWSurfaceBlok::gradient_range_start [protected]
 

GTST.

Definition at line 184 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readGradientRangeStart_FP4.

U2 Teddy::Imports::LWSurfaceBlok::gradient_repeat [protected]
 

GRPT.

Definition at line 186 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readGradientRepeat_U2.

FP4 Teddy::Imports::LWSurfaceBlok::opacity [protected]
 

OPAC.

Definition at line 141 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readOpacity_U2_FP4_VX.

VX Teddy::Imports::LWSurfaceBlok::opacity_envelope [protected]
 

OPAC.

Definition at line 142 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readOpacity_U2_FP4_VX.

U2 Teddy::Imports::LWSurfaceBlok::opacity_type [protected]
 

OPAC.

Definition at line 140 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readOpacity_U2_FP4_VX.

S0 Teddy::Imports::LWSurfaceBlok::procedural_algorithm [protected]
 

FUNC.

Definition at line 179 of file LWSurfaceBlok.h.

Referenced by readProceduralAlgorithm_S0_data.

U2 Teddy::Imports::LWSurfaceBlok::procedural_axis [protected]
 

AXIS.

Definition at line 178 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readProceduralAxis_U2.

S0 Teddy::Imports::LWSurfaceBlok::shader_algorithm [protected]
 

FUNC.

Definition at line 189 of file LWSurfaceBlok.h.

Referenced by readShaderAlgorithm_S0_data.

LWSurface* Teddy::Imports::LWSurfaceBlok::surface [protected]
 

Definition at line 135 of file LWSurfaceBlok.h.

Referenced by applyImageMap, and LWSurfaceBlok.

FP4 Teddy::Imports::LWSurfaceBlok::texture_amplitude [protected]
 

TAMP.

Definition at line 173 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureAmplitude_FP4_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_amplitude_envelope [protected]
 

TAMP.

Definition at line 174 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureAmplitude_FP4_VX.

FP4 Teddy::Imports::LWSurfaceBlok::texture_antialiasing_strength [protected]
 

AAST.

Definition at line 170 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureAntialiasingStrength_U2_FP4.

U2 Teddy::Imports::LWSurfaceBlok::texture_antialiasing_type [protected]
 

AAST.

Definition at line 169 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureAntialiasingStrength_U2_FP4.

VEC12 Teddy::Imports::LWSurfaceBlok::texture_center [protected]
 

CNTR.

Definition at line 146 of file LWSurfaceBlok.h.

Referenced by applyImageMap, LWSurfaceBlok, and readTextureCenter_VEC12_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_center_envelope [protected]
 

CNTR.

Definition at line 147 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureCenter_VEC12_VX.

ID4 Teddy::Imports::LWSurfaceBlok::texture_channel [protected]
 

CHAN.

Definition at line 138 of file LWSurfaceBlok.h.

Referenced by applyImageMap, LWSurfaceBlok, and readChannel_ID4.

U2 Teddy::Imports::LWSurfaceBlok::texture_coordinate_system [protected]
 

CSYS.

Definition at line 156 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureCoordinateSystem_U2.

VEC12 Teddy::Imports::LWSurfaceBlok::texture_falloff [protected]
 

FALL.

Definition at line 154 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureFalloff_U2_VEC12_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_falloff_envelope [protected]
 

FALL.

Definition at line 155 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureFalloff_U2_VEC12_VX.

U2 Teddy::Imports::LWSurfaceBlok::texture_falloff_type [protected]
 

FALL.

Definition at line 153 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureFalloff_U2_VEC12_VX.

U2 Teddy::Imports::LWSurfaceBlok::texture_height_wrap [protected]
 

WRAP.

Definition at line 163 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapOptions_U2_U2.

VX Teddy::Imports::LWSurfaceBlok::texture_image_map [protected]
 

IMAG.

Definition at line 161 of file LWSurfaceBlok.h.

Referenced by applyImageMap, LWSurfaceBlok, and readTextureImageMap_VX.

U2 Teddy::Imports::LWSurfaceBlok::texture_major_axis [protected]
 

AXIS.

Definition at line 160 of file LWSurfaceBlok.h.

Referenced by applyImageMap, LWSurfaceBlok, and readTextureMajorAxis_U2.

U2 Teddy::Imports::LWSurfaceBlok::texture_negative [protected]
 

NEGA.

Definition at line 175 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureNegative_U2.

U2 Teddy::Imports::LWSurfaceBlok::texture_pixel_blending [protected]
 

PIXB.

Definition at line 171 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTexturePixelBlending_U2.

U2 Teddy::Imports::LWSurfaceBlok::texture_projection_mode [protected]
 

PROJ.

Definition at line 159 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureProjectionMode_U2.

S0 Teddy::Imports::LWSurfaceBlok::texture_reference_object [protected]
 

OREF.

Definition at line 152 of file LWSurfaceBlok.h.

Referenced by readTextureReferenceObject_S0.

VEC12 Teddy::Imports::LWSurfaceBlok::texture_rotation [protected]
 

ROTA.

Definition at line 150 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureRotation_VEC12_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_rotation_envelope [protected]
 

ROTA.

Definition at line 151 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureRotation_VEC12_VX.

VEC12 Teddy::Imports::LWSurfaceBlok::texture_size [protected]
 

SIZE.

Definition at line 148 of file LWSurfaceBlok.h.

Referenced by applyImageMap, LWSurfaceBlok, and readTextureSize_VEC12_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_size_envelope [protected]
 

SIZE.

Definition at line 149 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureSize_VEC12_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_stack [protected]
 

STCK.

Definition at line 172 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureStack_VX.

S0 Teddy::Imports::LWSurfaceBlok::texture_uv_vertex_map [protected]
 

VMAP.

Definition at line 168 of file LWSurfaceBlok.h.

Referenced by readTextureUV_VertexMap_S0.

U2 Teddy::Imports::LWSurfaceBlok::texture_width_wrap [protected]
 

WRAP.

Definition at line 162 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapOptions_U2_U2.

FP4 Teddy::Imports::LWSurfaceBlok::texture_wrap_height_cycles [protected]
 

WRPH.

Definition at line 166 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapHeightAmount_FP4_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_wrap_height_cycles_envelope [protected]
 

WRPH.

Definition at line 167 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapHeightAmount_FP4_VX.

FP4 Teddy::Imports::LWSurfaceBlok::texture_wrap_width_cycles [protected]
 

WRPW.

Definition at line 164 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapWidthAmount_FP4_VX.

VX Teddy::Imports::LWSurfaceBlok::texture_wrap_width_cycles_envelope [protected]
 

WRPW.

Definition at line 165 of file LWSurfaceBlok.h.

Referenced by LWSurfaceBlok, and readTextureWrapWidthAmount_FP4_VX.


The documentation for this class was generated from the following files: