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

Teddy::Imports::LWSurface Class Reference

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

#include <LWSurface.h>

Inheritance diagram for Teddy::Imports::LWSurface:

Inheritance graph
[legend]
Collaboration diagram for Teddy::Imports::LWSurface:

Collaboration graph
[legend]
List of all members.

Public Methods

 LWSurface (LWLayer *layer, Model *model, const std::string &name)
 Constructor. More...

virtual ~LWSurface ()
 Destructor. More...

void processSubChunk ()
 Process surface subchunks. More...

void setModel (Model *model)
LWLayergetLayer ()
Model * getModel ()
void endSurface ()
virtual void setTexture (Texture *t, bool enable=false)
 Set Material Texture. More...


Protected Methods

int getMapType (const char *s)
void endTexture ()
void useTextureColormap ()
void readBaseColor_COL4 ()
void readStateFlags_U2 ()
void readLuminosity_IP2 ()
 LWOB Luminosity. More...

void readLuminosity_FP4 ()
 LWOB Luminosity. More...

void readDiffuse_IP2 ()
 LWOB Diffuse. More...

void readDiffuse_FP4 ()
 LWOB Diffuse. More...

void readSpecular_IP2_4 ()
 LWOB Specularity. More...

void readSpecular_FP4 ()
 LWOB Specularity. More...

void readReflection_IP2_4 ()
void readReflection_FP4 ()
void readTransparency_IP2 ()
void readTransparency_FP4 ()
void readSpecularGlossiness_I2_4 ()
 LWOB Specular glossiness. More...

void readReflectionMode_U2 ()
void readReflectionMapImage_FNAM0 ()
void readReflectionMapImageSeamAngle_DEG4 ()
void readRefractiveIndex_F4 ()
void readEdgeTransparencyTreshold_F4 ()
void readMaxSmoothingAngle_DEG4 ()
void readAlphaMode_U2_U2 ()
void readShaderPlugin_S0 ()
void readShaderData_f ()
void readSequenceOptions_U2_U2_U2 ()
void readFlyerClipOptions_U4_U4 ()
void readColorCycleOptions_U2_U2_U2 ()
void readColorTexture_S0 ()
void readDiffuseTexture_S0 ()
void readSpecularTexture_S0 ()
void readReflectionTexture_S0 ()
void readTransparencyTexture_S0 ()
void readLuminosityTexture_S0 ()
void readBumpTexture_S0 ()
void readBaseColor_COL12_VX ()
void readLuminosity_FP4_VX ()
void readDiffuse_FP4_VX ()
void readSpecular_FP4_VX ()
void readReflection_FP4_VX ()
void readTransparency_FP4_VX ()
void readTranslucency_FP4_VX ()
void readSpecularGlossiness_FP4_VX ()
void readDiffuseSharpness_FP4_VX ()
void readBumpIntensity_FP4_VX ()
void readPolygonSidedness_U2 ()
void readMaxSmoothingAngle_ANG4 ()
void readReflectionOptions_U2 ()
void readReflectionMapImage_VX ()
void readReflectionMapImageSeamAngle_ANG4_VX ()
void readRefractiveIndex_F4_VX ()
void readColorHighlights_FP4_VX ()
void readTransparencyOptions_U2 ()
void readRefractionMapImage_VX ()
void readColorFilter_FP4_VX ()
void readAdditiveTransparency_FP4_VX ()
void readGlowEffect_U2_F4_VX_F4_VX ()
void readRenderOutlines_U2_F4_VX_COL12_VX ()
void readAlphaMode_U2_FP4 ()
void readBlok ()
void readComment_S0 ()

Protected Attributes

LWFilef
LWLayerlayer
Model * model
LWModelroot_model
ID4 subchunk_id
U4 subchunk_length
Color baseColor
long stateFlags
float luminosity_p
float diffuse_p
float specular_p
float reflection_p
float transparency_p
float translucency_p
float specularGlossiness_p
long reflectionMode
unsigned char reflectionMapImage [256]
float reflectionMapImageSeamAngle
float refractiveIndex
float edgeTransparencyTreshold
float maxSmoothingAngle
long alphaMode
int_to_LWTexture textures
int_to_LWSurfaceBlok bloks
LWTexturecurrent_texture

Static Protected Attributes

char * LW_ImageMapStrings []

Detailed Description

Parser for LightWave object file surface subchunks.

Definition at line 62 of file LWSurface.h.


Constructor & Destructor Documentation

Teddy::Imports::LWSurface::LWSurface LWLayer   layer,
Model *    model,
const std::string &    name
 

Constructor.

Definition at line 74 of file LWSurface.cpp.

References baseColor, current_texture, diffuse_p, Teddy::SysSupport::dmsg, f, layer, luminosity_p, Teddy::SysSupport::M_LWS, Teddy::Materials::Material::max_smoothing_angle, model, Teddy::MixIn::Named::name, reflection_p, Teddy::Materials::Material::setAmbient, Teddy::Materials::Material::setBorder, Teddy::Materials::Material::setDiffuse, Teddy::Materials::Material::setEmission, Teddy::Materials::Material::setSpecular, Teddy::Materials::Material::shininess, specular_p, translucency_p, and transparency_p.

Teddy::Imports::LWSurface::~LWSurface   [virtual]
 

Destructor.

Definition at line 115 of file LWSurface.cpp.


Member Function Documentation

void Teddy::Imports::LWSurface::endSurface  
 

Definition at line 303 of file LWSurface.cpp.

References endTexture.

void Teddy::Imports::LWSurface::endTexture   [protected]
 

Definition at line 307 of file LWSurface.cpp.

References current_texture.

Referenced by endSurface, and readColorTexture_S0.

LWLayer * Teddy::Imports::LWSurface::getLayer  
 

Definition at line 120 of file LWSurface.cpp.

References layer.

int Teddy::Imports::LWSurface::getMapType const char *    s [protected]
 

Definition at line 61 of file LWSurface.cpp.

References LW_CUBIC_IMAGE_MAP, LW_CYLINDRICAL_IMAGE_MAP, LW_PLANAR_IMAGE_MAP, and LW_SPHERICAL_IMAGE_MAP.

Referenced by readColorTexture_S0.

Model * Teddy::Imports::LWSurface::getModel  
 

Definition at line 124 of file LWSurface.cpp.

References model.

void Teddy::Imports::LWSurface::processSubChunk  
 

Process surface subchunks.

Definition at line 140 of file LWSurface.cpp.

References current_texture, Teddy::Imports::did, Teddy::SysSupport::dmsg, Teddy::SysSupport::emsg, f, ID_ADTR, ID_BLOK, ID_BTEX, ID_BUMP, ID_CLRF, ID_CLRH, ID_CMNT, ID_CTEX, ID_DIFF, ID_DTEX, ID_EDGE, ID_FLAG, ID_FLYR, ID_GLOS, ID_GLOW, ID_IMCC, ID_IMSQ, ID_LINE, ID_LTEX, ID_LUMI, ID_LWO2, ID_LWOB, ID_REFL, ID_RFLT, ID_RFOP, ID_RIMG, ID_RIND, ID_RSAN, ID_RTEX, ID_SDAT, ID_SHDR, ID_SHRP, ID_SIDE, ID_SMAN, ID_SPEC, ID_STEX, ID_TAAS, ID_TALP, ID_TAMP, ID_TCLR, ID_TCTR, ID_TFAL, ID_TFLG, ID_TFP, ID_TFRQ, ID_TIMG, ID_TIP, ID_TOPC, ID_TRAN, ID_TREF, ID_TRNL, ID_TROP, ID_TSIZ, ID_TSP, ID_TTEX, ID_TVAL, ID_TVEL, ID_TWRP, ID_VDIF, ID_VLUM, ID_VRFL, ID_VSPC, ID_VTRN, Teddy::SysSupport::M_LWO, readAdditiveTransparency_FP4_VX, readAlphaMode_U2_FP4, readAlphaMode_U2_U2, readBaseColor_COL12_VX, readBaseColor_COL4, readBlok, readBumpIntensity_FP4_VX, readBumpTexture_S0, readColorCycleOptions_U2_U2_U2, readColorFilter_FP4_VX, readColorHighlights_FP4_VX, readColorTexture_S0, readComment_S0, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readDiffuseSharpness_FP4_VX, readDiffuseTexture_S0, readEdgeTransparencyTreshold_F4, readFlyerClipOptions_U4_U4, readGlowEffect_U2_F4_VX_F4_VX, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readLuminosityTexture_S0, readMaxSmoothingAngle_ANG4, readMaxSmoothingAngle_DEG4, readPolygonSidedness_U2, readReflection_FP4, readReflection_FP4_VX, readReflection_IP2_4, readReflectionMapImage_FNAM0, readReflectionMapImage_VX, readReflectionMapImageSeamAngle_ANG4_VX, readReflectionMapImageSeamAngle_DEG4, readReflectionMode_U2, readReflectionOptions_U2, readReflectionTexture_S0, readRefractionMapImage_VX, readRefractiveIndex_F4, readRefractiveIndex_F4_VX, readRenderOutlines_U2_F4_VX_COL12_VX, readSequenceOptions_U2_U2_U2, readShaderData_f, readShaderPlugin_S0, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, readSpecularGlossiness_FP4_VX, readSpecularGlossiness_I2_4, readSpecularTexture_S0, readStateFlags_U2, readTranslucency_FP4_VX, readTransparency_FP4, readTransparency_FP4_VX, readTransparency_IP2, readTransparencyOptions_U2, readTransparencyTexture_S0, subchunk_id, and subchunk_length.

void Teddy::Imports::LWSurface::readAdditiveTransparency_FP4_VX   [protected]
 

LWO2 Additive Transparency

ADTR { additive[FP4], envelope[VX] }

This percentage selects how "additive" transparency effect are. The default value of zero indicates that transparent surfaces fully attenuate the background color while a value of 100% indicates that that the background color is full strength under the transparent surface.

Definition at line 925 of file LWSurface.cpp.

References f, Teddy::Imports::FP4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readAlphaMode_U2_FP4   [protected]
 

LWO2 Alpha Mode

ALPH { mode[U2], value[FP4] }

This chunk defines the alpha channel output options for the surface.

If mode is 0, this surface does not affect the Alpha channel at all when rendered.

If mode is 1, the alpha channel will have a fixed value which is the second parameter in the chunk and should normally have a value between 0.0 and 1.0.

If mode is 2, the alpha value is derived from surface opacity, which is the default if the ALPH chunk is missing.

If mode is 3, the alpha value comes from shadow density.

Definition at line 998 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readAlphaMode_U2_U2   [protected]
 

Definition at line 481 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readBaseColor_COL12_VX   [protected]
 

LWO2 Base Color

COLR { base-color[COL12], envelope[VX] }

This defines the base color of the surface, which is the color that lies under all the other texturing attributes.

Definition at line 566 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, specular_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readBaseColor_COL4   [protected]
 

LWOB

COLR { base-color[COL4] }

This defines the base color of the surface, which is the color that lies under all the other texturing attributes.

Definition at line 341 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, specular_p, and Teddy::Imports::U1.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readBlok   [protected]
 

LWO2 BLOK

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.

The header for any block can contain the following sub-chunks, although some are ignored for different block types.

Definition at line 1029 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readBumpIntensity_FP4_VX   [protected]
 

LWO2 Bump Intensity

BUMP { strength[FP4], envelope[VX] }

Bump strength scales the height of the bumps in the gradient calculation. Higher values have the effect of increasing the contrast of the bump shading. The default value is 1.0.

Definition at line 711 of file LWSurface.cpp.

References f, Teddy::Imports::FP4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readBumpTexture_S0   [protected]
 

Definition at line 541 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readColorCycleOptions_U2_U2_U2   [protected]
 

Definition at line 486 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readColorFilter_FP4_VX   [protected]
 

LWO2 Color Filter

CLRF { color-filter[FP4], envelope[VX] }

The color filter percentage determines how much rays passing through a transparent surface are tinted by the color of the surface. This replaces the old discrete "Color Filter" flag.

Definition at line 907 of file LWSurface.cpp.

References f, Teddy::Imports::FP4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readColorHighlights_FP4_VX   [protected]
 

LWO2 Color Highlights

CLRH { color-highlights[FP4], envelope[VX] }

The color highlight percentage determines how much the reflections on a surface, including specular highlights, are tinted by the color of the surface. This replaces the old discrete "Color Highlights" flag.

Specular highlights are ordinarily the color of the incident light. Color highlights models the behavior of dialectric and conducting materials, in which the color of the specular highlight tends to be closer to the color of the material. A higher color highlight value blends more of the surface color and less of the incident light color.

Definition at line 863 of file LWSurface.cpp.

References f, Teddy::Imports::FP4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readColorTexture_S0   [protected]
 

LWOB Start Texture Definition

CTEX, DTEX, STEX, RTEX, TTEX, LTEX, BTEX { texture-type[S0] }

The presence of one of these sub-chunks indicates that the current surface has a color, diffuse, specular, reflection, transparency, luminosity, or bump texture. The contents of the sub-chunk is a character string specifying the texture type as shown on the control panel. Once one of these sub-chunks is encountered within a SURF chunk, all subsequent texture-related sub-chunks are considered to pertain to the current texture, until another one of these texture starting sub-chunks is read. There may be any number of textures for each parameter, and the textures are layered in the order they are read.

Definition at line 504 of file LWSurface.cpp.

References current_texture, endTexture, f, getMapType, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readComment_S0   [protected]
 

Definition at line 550 of file LWSurface.cpp.

References f, and Teddy::Materials::Material::setPolygonOffset.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readDiffuse_FP4   [protected]
 

LWOB Diffuse.

Definition at line 412 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readDiffuse_FP4_VX   [protected]
 

Definition at line 598 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, specular_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readDiffuse_IP2   [protected]
 

LWOB Diffuse.

Definition at line 402 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readDiffuseSharpness_FP4_VX   [protected]
 

LWO2 Diffuse Sharpness

SHRP { sharpness[FP4], envelope[VX] }

Diffuse sharpness models non-Lambertian surfaces. The sharpness refers to the transition from lit to unlit portions of the surface, where the difference in diffuse shading is most obvious. For a sharpness of 0.0, diffuse shading of a sphere produces a linear gradient. A sharpness of 50% (0.5) corresponds to the fixed "Sharp Terminator" switch in versions of LightWave prior to 6.0. It produces planet-like shading on a sphere, with a brightly lit day side and a rapid falloff near the day/night line (the terminator). 100% sharpness is more like the Moon, with no falloff until just before the terminator.

Definition at line 695 of file LWSurface.cpp.

References f, Teddy::Imports::FP4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readDiffuseTexture_S0   [protected]
 

Definition at line 511 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readEdgeTransparencyTreshold_F4   [protected]
 

Definition at line 473 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readFlyerClipOptions_U4_U4   [protected]
 

Definition at line 485 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readGlowEffect_U2_F4_VX_F4_VX   [protected]
 

LWO2 Glow Effect

GLOW { type[U2], intensity[F4], intensity-envelope[VX], size[F4], size-envelope[VX] }

The glow effect causes a surface to spread and effect neighboring areas of the image.The type can be 0 for Hastings glow, and 1 for image convolution. The size and intensity modulate how large and how strong the effect is, but the exact units are unclear.

Definition at line 942 of file LWSurface.cpp.

References f, Teddy::Imports::F4, Teddy::Imports::U2, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readLuminosity_FP4   [protected]
 

LWOB Luminosity.

Definition at line 390 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::SysSupport::dmsg, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::SysSupport::M_LWS, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readLuminosity_FP4_VX   [protected]
 

LWO2 Base Shading Values

DIFF, LUMI, SPEC, REFL, TRAN, TRNL { intensity[FP4], envelope[VX] }

These sub-chunks specify the base level of the surface's diffuse, luminosity, specular, reflection, transparency, or tranlucency settings. If any of these sub-chunks are absent for a surface, a value of zero is assumed.

Definition at line 587 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, specular_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readLuminosity_IP2   [protected]
 

LWOB Luminosity.

Definition at line 378 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::SysSupport::dmsg, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::SysSupport::M_LWS, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readLuminosityTexture_S0   [protected]
 

Definition at line 535 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readMaxSmoothingAngle_ANG4   [protected]
 

LWO2 Max Smoothing Angle

SMAN { max-smoothing-angle[ANG4] }

The maximum angle between adjacent polygons that will be smooth shaded. Shading across edges at higher angles won't be interpolated (the polygons will appear to meet at a sharp seam). If this chunk is missing, or if the value is <= 0, then the polygons are not smoothed.

Definition at line 750 of file LWSurface.cpp.

References f, and Teddy::Materials::Material::max_smoothing_angle.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readMaxSmoothingAngle_DEG4   [protected]
 

Definition at line 476 of file LWSurface.cpp.

References f, and Teddy::Materials::Material::max_smoothing_angle.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readPolygonSidedness_U2   [protected]
 

LWO2 Polygon Sidedness

SIDE { sidedness[U2] }

The sidedness of a polygon can be 1 for front-only, or 3 for front and back. This replaces the old "Double Sided" flag bit. If missing, single-sided polygons are assumed.

Definition at line 727 of file LWSurface.cpp.

References f, and Teddy::Imports::U2.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflection_FP4   [protected]
 

Definition at line 467 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflection_FP4_VX   [protected]
 

Definition at line 620 of file LWSurface.cpp.

References f, reflection_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflection_IP2_4   [protected]
 

Definition at line 465 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionMapImage_FNAM0   [protected]
 

Definition at line 470 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionMapImage_VX   [protected]
 

LWO2 Reflection Map Image

RIMG { image[VX] }

A surface reflects this image as if it were spherically wrapped around the scene. The RIMG is only used if the reflection options in RFOP are set to use an image and the reflectivity of the surface in REFL is non-zero. The image is the index of a CLIP chunk, or zero to indicate no image

Definition at line 807 of file LWSurface.cpp.

References f, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionMapImageSeamAngle_ANG4_VX   [protected]
 

LWO2 Reflection Map Image Seam Angle

RSAN { seam-angle[ANG4], envelope[VX] }

This angle is the heading angle of the reflection map seam. If missing, a value of zero is assumed.

Definition at line 820 of file LWSurface.cpp.

References Teddy::Imports::ANG4, f, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionMapImageSeamAngle_DEG4   [protected]
 

Definition at line 471 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionMode_U2   [protected]
 

Definition at line 469 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionOptions_U2   [protected]
 

LWO2 Reflection Options

RFOP { reflection-options[U2] }

Reflection options is a numeric code that describes how reflections are handled for this surface and is only meaningful if the reflectivity in REFL is non-zero.

0 - Backdrop Only

Only the backdrop is reflected.

1 - Raytracing + Backdrop

Objects in the scene are reflected when raytracing is enabled. Rays that don't intercept an object are assigned the backdrop color.

2 - Spherical Map

If an image is provided in an RIMG subchunk, the image is reflected as if it were spherically wrapped around the scene.

3 - Raytracing + Spherical Map

Objects in the scene are reflected when raytracing is enabled. Rays that don't intercept an object are assigned a color from the image map.

If there is no RFOP subchunk, a value of 0 is assumed.

Definition at line 788 of file LWSurface.cpp.

References f, and Teddy::Imports::U2.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readReflectionTexture_S0   [protected]
 

Definition at line 523 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readRefractionMapImage_VX   [protected]
 

LWO2 Refraction Map Image

TIMG { image[VX] }

The refraction image is wrapped around the scene and is used for refraction mapping if the TROP mode is set to use an image and the transparency of the surface is non-zero. This setting is the refractive analogue of RIMG.

Definition at line 893 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readRefractiveIndex_F4   [protected]
 

Definition at line 472 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readRefractiveIndex_F4_VX   [protected]
 

LWO2 Refractive Index

RIND { refractive-index[F4], envelope[VX] }

The surface's refractive index determines how much light rays bend when passing into or out of this material, and is defined as the ratio of the speed of light in a vacuum to the speed of light in the material. Since light is fastest in a vacuum, this value should therefore be greater than or equal to 1.0.

Definition at line 837 of file LWSurface.cpp.

References f, Teddy::Imports::F4, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readRenderOutlines_U2_F4_VX_COL12_VX   [protected]
 

LWO2 Render Outlines

LINE { flags[U2], ( size[F4], size-envelope[VX], ( color[COL12], color-envelope[VX] )? )? }

The line effect draws the surface as a wireframe of the polygon edges. Currently the only flag defined is an enable switch in the low bit. The size is the thickness of the lines in pixels, and the color, if not given, is the base color of the surface. Note that you may encounter LINE subchunks with no color information (these will have a subchunk length of 8 bytes) and possibly without size information (subchunk length 2)

Definition at line 969 of file LWSurface.cpp.

References f, Teddy::Imports::F4, Teddy::Imports::U2, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSequenceOptions_U2_U2_U2   [protected]
 

Definition at line 484 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readShaderData_f   [protected]
 

Definition at line 483 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readShaderPlugin_S0   [protected]
 

Definition at line 482 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecular_FP4   [protected]
 

LWOB Specularity.

Definition at line 432 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecular_FP4_VX   [protected]
 

Definition at line 609 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, specular_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecular_IP2_4   [protected]
 

LWOB Specularity.

Definition at line 422 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, f, luminosity_p, Teddy::Materials::Material::specular, and specular_p.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecularGlossiness_FP4_VX   [protected]
 

LWO2 Specular Glossiness

GLOS { glossiness[FP4], envelope[VX] }

Glossiness controls the falloff of specular highlights. The intensity of a specular highlight is calculated as cos^n a, where a is the angle between the reflection and view vectors. The power n is the specular exponent. The GLOS chunk stores a glossiness g as a floating point fraction related to n by: n = 2(10g + 2). A glossiness of 20% (0.2) gives a specular exponent of 2^4, or 16, equivalent to the "Low" glossiness preset in versions of LightWave prior to 6.0. Likewise 40% is 64 or "Medium," 60% is 256 or "High," and 80% is 1024 or "Maximum." The GLOS subchunk is only meaningful when the specularity in SPEC is non-zero. If GLOS is missing, a value of 40% is assumed.

Definition at line 662 of file LWSurface.cpp.

References Teddy::SysSupport::dmsg, f, Teddy::SysSupport::M_LWO, Teddy::Materials::Material::shininess, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecularGlossiness_I2_4   [protected]
 

LWOB Specular glossiness.

Definition at line 442 of file LWSurface.cpp.

References Teddy::SysSupport::dmsg, Teddy::SysSupport::emsg, f, Teddy::Imports::I2, Teddy::SysSupport::M_LWO, Teddy::Materials::Material::shininess, and Teddy::Imports::U4.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readSpecularTexture_S0   [protected]
 

Definition at line 517 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readStateFlags_U2   [protected]
 

LWOB, LWLO, LWO2

LUMI, DIFF, SPEC, REFL, TRAN { percentage[IP2] } VLUM, VDIF, VSPC, VRFL, VTRN { percentage[FP4] }

These sub-chunks specify the base level of the surface's luminosity, diffuse, specular, reflection, or transparency settings. Each setting has a fixed-point and a floating-point form, but if both are present the floating-point form should take precedence. The fixed-point value should be rounded to the nearest half percent. Even though the floating-point form is prefered, the convention is to write both sub-chunks to a surface description to support older parsers. If any of these sub-chunks are absent for a surface, a value of zero is assumed. The LUMI or VLUM sub-chunk overrides the Luminous bit of the FLAG sub-chunk.

Definition at line 371 of file LWSurface.cpp.

References f, and Teddy::Imports::U2.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTranslucency_FP4_VX   [protected]
 

Definition at line 636 of file LWSurface.cpp.

References f, translucency_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTransparency_FP4   [protected]
 

Definition at line 468 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTransparency_FP4_VX   [protected]
 

Definition at line 628 of file LWSurface.cpp.

References f, transparency_p, and Teddy::Imports::VX.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTransparency_IP2   [protected]
 

Definition at line 466 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTransparencyOptions_U2   [protected]
 

LWO2 Transparency Options

TROP { transparency-options[U2] }

Transparency options are just the same as reflection options except that they describe how refraction is handled. Refraction can be any combination of background color, image or raytracing.

Definition at line 878 of file LWSurface.cpp.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::readTransparencyTexture_S0   [protected]
 

Definition at line 529 of file LWSurface.cpp.

References f, and Teddy::Imports::S0.

Referenced by processSubChunk.

void Teddy::Imports::LWSurface::setModel Model *    model
 

Definition at line 128 of file LWSurface.cpp.

References model.

void Teddy::Imports::LWSurface::setTexture Texture *    t,
bool    enable = false
[virtual]
 

Set Material Texture.

Reimplemented from Teddy::Materials::Material.

Definition at line 315 of file LWSurface.cpp.

References Teddy::MixIn::Options::enable, and useTextureColormap.

void Teddy::Imports::LWSurface::useTextureColormap   [protected]
 

Definition at line 324 of file LWSurface.cpp.

References Teddy::Materials::Material::ambient, baseColor, Teddy::Materials::Material::diffuse, diffuse_p, Teddy::Materials::Material::emission, luminosity_p, Teddy::Materials::Material::specular, and specular_p.

Referenced by setTexture.


Member Data Documentation

long Teddy::Imports::LWSurface::alphaMode [protected]
 

Definition at line 165 of file LWSurface.h.

Color Teddy::Imports::LWSurface::baseColor [protected]
 

Definition at line 150 of file LWSurface.h.

Referenced by LWSurface, readBaseColor_COL12_VX, readBaseColor_COL4, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, and useTextureColormap.

int_to_LWSurfaceBlok Teddy::Imports::LWSurface::bloks [protected]
 

Definition at line 167 of file LWSurface.h.

LWTexture* Teddy::Imports::LWSurface::current_texture [protected]
 

Definition at line 168 of file LWSurface.h.

Referenced by endTexture, LWSurface, processSubChunk, and readColorTexture_S0.

float Teddy::Imports::LWSurface::diffuse_p [protected]
 

Definition at line 153 of file LWSurface.h.

Referenced by LWSurface, readBaseColor_COL12_VX, readBaseColor_COL4, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, and useTextureColormap.

float Teddy::Imports::LWSurface::edgeTransparencyTreshold [protected]
 

Definition at line 163 of file LWSurface.h.

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

Definition at line 144 of file LWSurface.h.

Referenced by LWSurface, processSubChunk, readAdditiveTransparency_FP4_VX, readBaseColor_COL12_VX, readBaseColor_COL4, readBumpIntensity_FP4_VX, readBumpTexture_S0, readColorFilter_FP4_VX, readColorHighlights_FP4_VX, readColorTexture_S0, readComment_S0, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readDiffuseSharpness_FP4_VX, readDiffuseTexture_S0, readGlowEffect_U2_F4_VX_F4_VX, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readLuminosityTexture_S0, readMaxSmoothingAngle_ANG4, readMaxSmoothingAngle_DEG4, readPolygonSidedness_U2, readReflection_FP4_VX, readReflectionMapImage_VX, readReflectionMapImageSeamAngle_ANG4_VX, readReflectionOptions_U2, readReflectionTexture_S0, readRefractiveIndex_F4_VX, readRenderOutlines_U2_F4_VX_COL12_VX, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, readSpecularGlossiness_FP4_VX, readSpecularGlossiness_I2_4, readSpecularTexture_S0, readStateFlags_U2, readTranslucency_FP4_VX, readTransparency_FP4_VX, and readTransparencyTexture_S0.

LWLayer* Teddy::Imports::LWSurface::layer [protected]
 

Definition at line 145 of file LWSurface.h.

Referenced by getLayer, and LWSurface.

float Teddy::Imports::LWSurface::luminosity_p [protected]
 

Definition at line 152 of file LWSurface.h.

Referenced by LWSurface, readBaseColor_COL12_VX, readBaseColor_COL4, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, and useTextureColormap.

char * Teddy::Imports::LWSurface::LW_ImageMapStrings [static, protected]
 

Initial value:

 {
    "Planar Image Map",
    "Cylindrical Image Map",
    "Spherical Image Map",
    "Cubic Image Map",
}

Definition at line 47 of file LWSurface.cpp.

float Teddy::Imports::LWSurface::maxSmoothingAngle [protected]
 

Definition at line 164 of file LWSurface.h.

Model* Teddy::Imports::LWSurface::model [protected]
 

Definition at line 146 of file LWSurface.h.

Referenced by getModel, LWSurface, and setModel.

float Teddy::Imports::LWSurface::reflection_p [protected]
 

Definition at line 155 of file LWSurface.h.

Referenced by LWSurface, and readReflection_FP4_VX.

unsigned char Teddy::Imports::LWSurface::reflectionMapImage[256] [protected]
 

Definition at line 160 of file LWSurface.h.

float Teddy::Imports::LWSurface::reflectionMapImageSeamAngle [protected]
 

Definition at line 161 of file LWSurface.h.

long Teddy::Imports::LWSurface::reflectionMode [protected]
 

Definition at line 159 of file LWSurface.h.

float Teddy::Imports::LWSurface::refractiveIndex [protected]
 

Definition at line 162 of file LWSurface.h.

LWModel* Teddy::Imports::LWSurface::root_model [protected]
 

Definition at line 147 of file LWSurface.h.

float Teddy::Imports::LWSurface::specular_p [protected]
 

Definition at line 154 of file LWSurface.h.

Referenced by LWSurface, readBaseColor_COL12_VX, readBaseColor_COL4, readDiffuse_FP4, readDiffuse_FP4_VX, readDiffuse_IP2, readLuminosity_FP4, readLuminosity_FP4_VX, readLuminosity_IP2, readSpecular_FP4, readSpecular_FP4_VX, readSpecular_IP2_4, and useTextureColormap.

float Teddy::Imports::LWSurface::specularGlossiness_p [protected]
 

Definition at line 158 of file LWSurface.h.

long Teddy::Imports::LWSurface::stateFlags [protected]
 

Definition at line 151 of file LWSurface.h.

ID4 Teddy::Imports::LWSurface::subchunk_id [protected]
 

Definition at line 148 of file LWSurface.h.

Referenced by processSubChunk.

U4 Teddy::Imports::LWSurface::subchunk_length [protected]
 

Definition at line 149 of file LWSurface.h.

Referenced by processSubChunk.

int_to_LWTexture Teddy::Imports::LWSurface::textures [protected]
 

Definition at line 166 of file LWSurface.h.

float Teddy::Imports::LWSurface::translucency_p [protected]
 

Definition at line 157 of file LWSurface.h.

Referenced by LWSurface, and readTranslucency_FP4_VX.

float Teddy::Imports::LWSurface::transparency_p [protected]
 

Definition at line 156 of file LWSurface.h.

Referenced by LWSurface, and readTransparency_FP4_VX.


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