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

Public Types

enum  Channels {
  RGB,
  R,
  G,
  B,
  RasL,
  GasL,
  BasL,
  AasL,
  MeanRGBasL,
  Luminance
}
 Which channels to display. More...
 

Public Member Functions

 Visualization (Channels c=RGB, float g=1.0f, float mn=0.0f, float mx=1.0f, bool mod1=false, bool motVec=false)
 Defaults to linear data on [0, 1]: packed normal maps, reflectance maps, etc. More...
 
 Visualization (const Any &a)
 Accepts the name of any static factory method as an Any::ARRAY, e.g., "v = sRGB()" or a table, e.g., "v = Texture::Visualization { documentGamma = 2.2, ... }". More...
 
Matrix4 colorShiftMatrix ()
 Returns the matrix corresponding to the color shift implied by channels. More...
 
bool operator== (const Visualization &v) const
 
void setShaderArgs (UniformTable &args)
 Sets the following arguments: More...
 
Any toAny () const
 

Static Public Member Functions

static const VisualizationbumpInAlpha ()
 For bump map packed in an alpha channel. More...
 
static const Visualizationdefaults ()
 
static const VisualizationdepthBuffer ()
 For a hyperbolic depth map in the red channel (e.g., a shadow map). More...
 
static const VisualizationlinearRGB ()
 Linear RGB map. More...
 
static const VisualizationmotionVectors ()
 For motion vectors. More...
 
static const VisualizationpackedUnitVector ()
 Unit vectors packed into RGB channels, e.g. More...
 
static const Visualizationradiance ()
 Radiance map. More...
 
static const Visualizationreflectivity ()
 Reflectivity map. More...
 
static const VisualizationsRGB ()
 For photographs and other images with document gamma of about 2.2. More...
 
static const VisualizationtextureCoordinates ()
 
static const VisualizationunitVector ()
 For signed unit vectors, like a GBuffer's normals, on the range [-1, 1] for RGB channels. More...
 

Public Attributes

Channels channels
 
float documentGamma
 Texture's gamma. More...
 
bool invertIntensity
 If true, show as 1 - (adjusted value) More...
 
int layer
 For a texture array, the coordinate of the layer to display. More...
 
float max
 Highest expected value. More...
 
float min
 Lowest value to visualize. More...
 
int mipLevel
 The mipLevel to display. More...
 
bool mod1 = false
 Wrap values at 1 for visualization, intended for texture coordinates. More...
 
float motionVectorScale = 1.0f
 1.0 = stretch a unit vector to maxMotionVectorLength in the visualization. More...
 
float motionVectorSpacing = 24.0f
 Tile size for arrow visualization. More...
 
bool showMotionVectors = false
 Visualize motion vectors/flow. More...
 

Member Enumeration Documentation

◆ Channels

Which channels to display.

Enumerator
RGB 

RGB as a color.

Red only.

Green only.

Blue only.

RasL 

Red as grayscale.

GasL 

Green as grayscale.

BasL 

Blue as grayscale.

AasL 

Alpha as grayscale.

MeanRGBasL 

RGB mean as luminance: (R + G + B) / 3; visualizes the net reflectance or energy of a texture.

Luminance 

(Perceptual) Luminance; visualizes the brightness people perceive of an image.

Constructor & Destructor Documentation

◆ Visualization() [1/2]

G3D::Texture::Visualization::Visualization ( Channels  c = RGB,
float  g = 1.0f,
float  mn = 0.0f,
float  mx = 1.0f,
bool  mod1 = false,
bool  motVec = false 
)

Defaults to linear data on [0, 1]: packed normal maps, reflectance maps, etc.

◆ Visualization() [2/2]

G3D::Texture::Visualization::Visualization ( const Any a)

Accepts the name of any static factory method as an Any::ARRAY, e.g., "v = sRGB()" or a table, e.g., "v = Texture::Visualization { documentGamma = 2.2, ... }".

Member Function Documentation

◆ bumpInAlpha()

static const Visualization& G3D::Texture::Visualization::bumpInAlpha ( )
static

For bump map packed in an alpha channel.

◆ colorShiftMatrix()

Matrix4 G3D::Texture::Visualization::colorShiftMatrix ( )

Returns the matrix corresponding to the color shift implied by channels.

◆ defaults()

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

◆ depthBuffer()

static const Visualization& G3D::Texture::Visualization::depthBuffer ( )
static

For a hyperbolic depth map in the red channel (e.g., a shadow map).

◆ linearRGB()

static const Visualization& G3D::Texture::Visualization::linearRGB ( )
inlinestatic

Linear RGB map.

Same as defaults()

◆ motionVectors()

static const Visualization& G3D::Texture::Visualization::motionVectors ( )
static

For motion vectors.

◆ operator==()

bool G3D::Texture::Visualization::operator== ( const Visualization v) const
inline

◆ packedUnitVector()

static const Visualization& G3D::Texture::Visualization::packedUnitVector ( )
inlinestatic

Unit vectors packed into RGB channels, e.g.

a normal map. Same as defaults()

◆ radiance()

static const Visualization& G3D::Texture::Visualization::radiance ( )
inlinestatic

Radiance map.

Same as defaults()

◆ reflectivity()

static const Visualization& G3D::Texture::Visualization::reflectivity ( )
inlinestatic

Reflectivity map.

Same as defaults()

◆ setShaderArgs()

void G3D::Texture::Visualization::setShaderArgs ( UniformTable args)

Sets the following arguments:

float mipLevel float adjustGamma float bias float scale float invertIntensity mat4 colorShift

macro LAYER

◆ sRGB()

static const Visualization& G3D::Texture::Visualization::sRGB ( )
static

For photographs and other images with document gamma of about 2.2.

Note that this does not actually match true sRGB values, which have a non-linear gamma.

◆ textureCoordinates()

static const Visualization& G3D::Texture::Visualization::textureCoordinates ( )
static

◆ toAny()

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

◆ unitVector()

static const Visualization& G3D::Texture::Visualization::unitVector ( )
static

For signed unit vectors, like a GBuffer's normals, on the range [-1, 1] for RGB channels.

Member Data Documentation

◆ channels

Channels G3D::Texture::Visualization::channels

Referenced by operator==().

◆ documentGamma

float G3D::Texture::Visualization::documentGamma

Texture's gamma.

Texels will be converted to pixels by p = t^(g/2.2)

Referenced by operator==().

◆ invertIntensity

bool G3D::Texture::Visualization::invertIntensity

If true, show as 1 - (adjusted value)

Referenced by operator==().

◆ layer

int G3D::Texture::Visualization::layer

For a texture array, the coordinate of the layer to display.

Otherwise just 0.

Referenced by operator==().

◆ max

float G3D::Texture::Visualization::max

Highest expected value.

Referenced by operator==().

◆ min

float G3D::Texture::Visualization::min

Lowest value to visualize.

Referenced by operator==().

◆ mipLevel

int G3D::Texture::Visualization::mipLevel

The mipLevel to display.

Referenced by operator==().

◆ mod1

bool G3D::Texture::Visualization::mod1 = false

Wrap values at 1 for visualization, intended for texture coordinates.

Referenced by operator==().

◆ motionVectorScale

float G3D::Texture::Visualization::motionVectorScale = 1.0f

1.0 = stretch a unit vector to maxMotionVectorLength in the visualization.

Referenced by operator==().

◆ motionVectorSpacing

float G3D::Texture::Visualization::motionVectorSpacing = 24.0f

Tile size for arrow visualization.

Referenced by operator==().

◆ showMotionVectors

bool G3D::Texture::Visualization::showMotionVectors = false

Visualize motion vectors/flow.

Referenced by operator==().


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