All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TextureOpt Class Reference

#include <texture.h>

Public Types

enum  Wrap {
  WrapDefault, WrapBlack, WrapClamp, WrapPeriodic,
  WrapMirror, WrapPeriodicPow2, WrapPeriodicSharedBorder, WrapLast
enum  MipMode {
  MipModeDefault, MipModeNoMIP, MipModeOneLevel, MipModeTrilinear,
enum  InterpMode { InterpClosest, InterpBilinear, InterpBicubic, InterpSmartBicubic }

Public Member Functions

 TextureOpt ()
 TextureOpt (const TextureOptions &opt, int index)

Static Public Member Functions

static Wrap decode_wrapmode (const char *name)
static Wrap decode_wrapmode (ustring name)
static void parse_wrapmodes (const char *wrapmodes, TextureOpt::Wrap &swrapcode, TextureOpt::Wrap &twrapcode)

Public Attributes

int firstchannel
 First channel of the lookup. More...
int subimage
 Subimage or face ID. More...
ustring subimagename
 Subimage name. More...
Wrap swrap
 Wrap mode in the s direction. More...
Wrap twrap
 Wrap mode in the t direction. More...
MipMode mipmode
 Mip mode. More...
InterpMode interpmode
 Interpolation mode. More...
int anisotropic
 Maximum anisotropic ratio. More...
bool conservative_filter
 True == over-blur rather than alias. More...
float sblur
float tblur
 Blur amount. More...
float swidth
float twidth
 Multiplier for derivatives. More...
float fill
 Fill value for missing channels. More...
const float * missingcolor
 Color for missing texture. More...
float time
 Time (for time-dependent texture lookups) More...
float bias
 Bias for shadows. More...
int samples
 Number of samples for shadows. More...
Wrap rwrap
 Wrap mode in the r direction. More...
float rblur
 Blur amount in the r direction. More...
float rwidth
 Multiplier for derivatives in r direction. More...


class pvt::TextureSystemImpl

Detailed Description

Encapsulate all the options needed for texture lookups. Making these options all separate parameters to the texture API routines is very ugly and also a big pain whenever we think of new options to add. So instead we collect all those little options into one structure that can just be passed by reference to the texture API routines.

Definition at line 184 of file texture.h.

Member Enumeration Documentation

Interp mode determines how we sample within a mipmap level


Force closest texel.


Force bilinear lookup within a mip level.


Force cubic lookup within a mip level.


Bicubic when maxifying, else bilinear.

Definition at line 211 of file texture.h.

Mip mode determines if/how we use mipmaps


Default high-quality lookup.


Just use highest-res image, no MIP mapping.


Use just one mipmap level.


Use two MIPmap levels (trilinear)


Use two MIPmap levels w/ anisotropic.

Definition at line 201 of file texture.h.

Wrap mode describes what happens when texture coordinates describe a value outside the usual [0,1] range where a texture is defined.


Use the default found in the file.


Black outside [0..1].


Clamp to [0..1].


Periodic mod 1.


Mirror the image.


Periodic, but only for powers of 2!!!


Periodic with shared border (env)


Mark the end – don't use this!

Definition at line 188 of file texture.h.

Constructor & Destructor Documentation

TextureOpt::TextureOpt ( )

Create a TextureOpt with all fields initialized to reasonable defaults.

Definition at line 221 of file texture.h.

TextureOpt::TextureOpt ( const TextureOptions opt,
int  index 

Convert a TextureOptions for one index into a TextureOpt.

Member Function Documentation

static Wrap TextureOpt::decode_wrapmode ( const char *  name)

Utility: Return the Wrap enum corresponding to a wrap name: "default", "black", "clamp", "periodic", "mirror".

Definition at line 263 of file texture.h.

static Wrap TextureOpt::decode_wrapmode ( ustring  name)

Definition at line 267 of file texture.h.

static void TextureOpt::parse_wrapmodes ( const char *  wrapmodes,
TextureOpt::Wrap swrapcode,
TextureOpt::Wrap twrapcode 

Utility: Parse a single wrap mode (e.g., "periodic") or a comma-separated wrap modes string (e.g., "black,clamp") into separate Wrap enums for s and t.

Definition at line 275 of file texture.h.

Friends And Related Function Documentation

friend class pvt::TextureSystemImpl

Definition at line 287 of file texture.h.

Member Data Documentation

int TextureOpt::anisotropic

Maximum anisotropic ratio.

Definition at line 246 of file texture.h.

float TextureOpt::bias

Bias for shadows.

Definition at line 253 of file texture.h.

bool TextureOpt::conservative_filter

True == over-blur rather than alias.

Definition at line 247 of file texture.h.

float TextureOpt::fill

Fill value for missing channels.

Definition at line 250 of file texture.h.

int TextureOpt::firstchannel

First channel of the lookup.

Definition at line 239 of file texture.h.

InterpMode TextureOpt::interpmode

Interpolation mode.

Definition at line 245 of file texture.h.

MipMode TextureOpt::mipmode

Mip mode.

Definition at line 244 of file texture.h.

const float* TextureOpt::missingcolor

Color for missing texture.

Definition at line 251 of file texture.h.

float TextureOpt::rblur

Blur amount in the r direction.

Definition at line 258 of file texture.h.

float TextureOpt::rwidth

Multiplier for derivatives in r direction.

Definition at line 259 of file texture.h.

Wrap TextureOpt::rwrap

Wrap mode in the r direction.

Definition at line 257 of file texture.h.

int TextureOpt::samples

Number of samples for shadows.

Definition at line 254 of file texture.h.

float TextureOpt::sblur

Definition at line 248 of file texture.h.

int TextureOpt::subimage

Subimage or face ID.

Definition at line 240 of file texture.h.

ustring TextureOpt::subimagename

Subimage name.

Definition at line 241 of file texture.h.

float TextureOpt::swidth

Definition at line 249 of file texture.h.

Wrap TextureOpt::swrap

Wrap mode in the s direction.

Definition at line 242 of file texture.h.

float TextureOpt::tblur

Blur amount.

Definition at line 248 of file texture.h.

float TextureOpt::time

Time (for time-dependent texture lookups)

Definition at line 252 of file texture.h.

float TextureOpt::twidth

Multiplier for derivatives.

Definition at line 249 of file texture.h.

Wrap TextureOpt::twrap

Wrap mode in the t direction.

Definition at line 243 of file texture.h.

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