Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
G3D::Texture::Preprocess Class Reference

Public Member Functions

 Preprocess ()
 
 Preprocess (const Any &a)
 
bool operator!= (const Preprocess &other) const
 
bool operator== (const Preprocess &other) const
 
Any toAny () const
 

Static Public Member Functions

static const Preprocessdefaults ()
 
static Preprocess gamma (float g)
 Defaults + gamma adjust set to g. More...
 
static const Preprocessnone ()
 Default settings + computeMinMaxMean = false. More...
 
static const PreprocessnormalMap ()
 
static const Preprocessquake ()
 Brighten by 2 and adjust gamma by 1.6, the default values expected for Quake versions 1 - 3 textures. More...
 

Public Attributes

BumpMapPreprocess bumpMapPreprocess
 
bool computeMinMaxMean
 If true (default), constructors automatically compute the min, max, and mean value of the texture. More...
 
bool convertToPremultipliedAlpha
 After loading and before computing any MIP maps or uploading to the GPU, but after gamma adjustment and modulation, multiply the color values by the alpha value. More...
 
float gammaAdjust
 After brightening, each (unit-scale) pixel is raised to this power. More...
 
Color4 modulate
 Multiplies color channels. More...
 
Color4 offset
 Offset values by this amount. More...
 

Friends

class Texture
 

Constructor & Destructor Documentation

◆ Preprocess() [1/2]

G3D::Texture::Preprocess::Preprocess ( )
inline

◆ Preprocess() [2/2]

G3D::Texture::Preprocess::Preprocess ( const Any a)
Parameters
aMust be in the form of a table of the fields or appear as a call to a static factory method, e.g.,:

Member Function Documentation

◆ defaults()

static const Preprocess& G3D::Texture::Preprocess::defaults ( )
static

◆ gamma()

static Preprocess G3D::Texture::Preprocess::gamma ( float  g)
static

Defaults + gamma adjust set to g.

◆ none()

static const Preprocess& G3D::Texture::Preprocess::none ( )
static

Default settings + computeMinMaxMean = false.

◆ normalMap()

static const Preprocess& G3D::Texture::Preprocess::normalMap ( )
static

◆ operator!=()

bool G3D::Texture::Preprocess::operator!= ( const Preprocess other) const
inline

◆ operator==()

bool G3D::Texture::Preprocess::operator== ( const Preprocess other) const

◆ quake()

static const Preprocess& G3D::Texture::Preprocess::quake ( )
static

Brighten by 2 and adjust gamma by 1.6, the default values expected for Quake versions 1 - 3 textures.

◆ toAny()

Any G3D::Texture::Preprocess::toAny ( ) const

Friends And Related Function Documentation

◆ Texture

friend class Texture
friend

Member Data Documentation

◆ bumpMapPreprocess

BumpMapPreprocess G3D::Texture::Preprocess::bumpMapPreprocess

◆ computeMinMaxMean

bool G3D::Texture::Preprocess::computeMinMaxMean

If true (default), constructors automatically compute the min, max, and mean value of the texture.

This is necessary, for example, for use with UniversalBSDF.

◆ convertToPremultipliedAlpha

bool G3D::Texture::Preprocess::convertToPremultipliedAlpha

After loading and before computing any MIP maps or uploading to the GPU, but after gamma adjustment and modulation, multiply the color values by the alpha value.

◆ gammaAdjust

float G3D::Texture::Preprocess::gammaAdjust

After brightening, each (unit-scale) pixel is raised to this power.

Many textures are drawn to look good when displayed on the screen in PhotoShop, which means that they are drawn with a document gamma of about 2.2.

If the document gamma is 2.2, set gammaAdjust to:

  • 2.2 for reflectivity, emissive, and environment maps (e.g., lambertian, glossy, etc.)
  • 1.0 for 2D elements, like fonts and full-screen images
  • 1.0 for computed data (e.g., normal maps, bump maps, GPGPU data)

To maintain maximum precision, author and store the original image files in a 1.0 gamma space, at which point no gamma correction is necessary.

◆ modulate

Color4 G3D::Texture::Preprocess::modulate

Multiplies color channels.

Useful for rescaling to make textures brighter or to tint textures as they are loaded. Modulation happens first of all preprocessing.

◆ offset

Color4 G3D::Texture::Preprocess::offset

Offset values by this amount.

Happens second in preprocessing.


documentation generated on Wed Nov 24 2021 08:02:01 using doxygen 1.8.15