TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
G3D::BumpMapPreprocess Class Reference

#include <BumpMapPreprocess.h>

Public Member Functions

 BumpMapPreprocess ()
 
 BumpMapPreprocess (const Any &any)
 
Any toAny () const
 
bool operator== (const BumpMapPreprocess &other) const
 

Public Attributes

bool lowPassFilter
 
float zExtentPixels
 
bool scaleZByNz
 

Detailed Description

Not in the BumpMap class to avoid a circular dependency between Texture and BumpMap. G3D::Image::computeNormalMap().

Constructor & Destructor Documentation

G3D::BumpMapPreprocess::BumpMapPreprocess ( )
inline
45 : lowPassFilter(false), zExtentPixels(-0.02f), scaleZByNz(false) {}
float zExtentPixels
Definition: BumpMapPreprocess.h:39
bool scaleZByNz
Definition: BumpMapPreprocess.h:43
bool lowPassFilter
Definition: BumpMapPreprocess.h:31

+ Here is the caller graph for this function:

G3D::BumpMapPreprocess::BumpMapPreprocess ( const Any any)
18  {
19  *this = BumpMapPreprocess();
20  for (Any::AnyTable::Iterator it = any.table().begin(); it.isValid(); ++it) {
21  const std::string& key = toLower(it->key);
22  if (key == "lowpassfilter") {
23  lowPassFilter = it->value;
24  } else if (key == "zextentpixels") {
25  zExtentPixels = it->value;
26  } else if (key == "scalezbynz") {
27  scaleZByNz = it->value;
28  } else {
29  any.verify(false, "Illegal key: " + it->key);
30  }
31  }
32 }
BumpMapPreprocess()
Definition: BumpMapPreprocess.h:45
bool any(float x)
Definition: g3dmath.h:424
std::string toLower(const std::string &x)
Definition: stringutils.cpp:223
float zExtentPixels
Definition: BumpMapPreprocess.h:39
bool scaleZByNz
Definition: BumpMapPreprocess.h:43
bool lowPassFilter
Definition: BumpMapPreprocess.h:31

+ Here is the call graph for this function:

Member Function Documentation

bool G3D::BumpMapPreprocess::operator== ( const BumpMapPreprocess other) const
inline
51  {
52  return
53  (lowPassFilter == other.lowPassFilter) &&
54  (zExtentPixels == other.zExtentPixels) &&
55  (scaleZByNz == other.scaleZByNz);
56  }
float zExtentPixels
Definition: BumpMapPreprocess.h:39
bool scaleZByNz
Definition: BumpMapPreprocess.h:43
bool lowPassFilter
Definition: BumpMapPreprocess.h:31
Any G3D::BumpMapPreprocess::toAny ( ) const
35  {
36  Any any(Any::TABLE, "BumpMapPreprocess");
37  any["lowPassFilter"] = lowPassFilter;
38  any["zExtentPixels"] = zExtentPixels;
39  any["scaleZByNz"] = scaleZByNz;
40  return any;
41 }
Definition: Any.h:187
bool any(float x)
Definition: g3dmath.h:424
float zExtentPixels
Definition: BumpMapPreprocess.h:39
bool scaleZByNz
Definition: BumpMapPreprocess.h:43
bool lowPassFilter
Definition: BumpMapPreprocess.h:31

+ Here is the call graph for this function:

Member Data Documentation

bool G3D::BumpMapPreprocess::lowPassFilter

If true, the elevations are box filtered after computing normals and before uploading, which produces better results for parallax offset mapping Defaults to false.

bool G3D::BumpMapPreprocess::scaleZByNz

After computing normals, scale the height by |N.z|, a trick that reduces texture swim in steep areas for parallax offset mapping. Defaults to false.

float G3D::BumpMapPreprocess::zExtentPixels

Height of the maximum ("white") value, in pixels, for the purpose of computing normals. A value of 255 means that a 255 x 255 bump image with a full black-to-white gradient will produce a 45-degree ramp (this also results in "cubic" voxels). A negative value means to set zExtentPixels to -zExtentPixels * max(width, height). The default is -0.02.


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