Support Forum G3D Web Page |
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 Preprocess & | defaults () |
static Preprocess | gamma (float g) |
Defaults + gamma adjust set to g. More... | |
static const Preprocess & | none () |
Default settings + computeMinMaxMean = false. More... | |
static const Preprocess & | normalMap () |
static const Preprocess & | quake () |
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 |
|
inline |
G3D::Texture::Preprocess::Preprocess | ( | const Any & | a | ) |
a | Must be in the form of a table of the fields or appear as a call to a static factory method, e.g.,: |
|
static |
|
static |
Defaults + gamma adjust set to g.
|
static |
Default settings + computeMinMaxMean = false.
|
static |
|
inline |
bool G3D::Texture::Preprocess::operator== | ( | const Preprocess & | other | ) | const |
|
static |
Brighten by 2 and adjust gamma by 1.6, the default values expected for Quake versions 1 - 3 textures.
Any G3D::Texture::Preprocess::toAny | ( | ) | const |
|
friend |
BumpMapPreprocess G3D::Texture::Preprocess::bumpMapPreprocess |
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.
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.
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:
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.
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.
Color4 G3D::Texture::Preprocess::offset |
Offset values by this amount.
Happens second in preprocessing.