LLPostProcess Class Reference

#include <llpostprocess.h>

Collaboration diagram for LLPostProcess:

Collaboration graph
[legend]

List of all members.

Public Types

enum  _QuadType { QUAD_NORMAL, QUAD_NOISE, QUAD_BLOOM_EXTRACT, QUAD_BLOOM_COMBINE }
typedef enum
LLPostProcess::_QuadType 
QuadType
typedef std::map< const char
*, GLuint > 
glslUniforms
 GLSL Shader Encapsulation Struct.

Public Member Functions

 LLPostProcess (void)
 ~LLPostProcess (void)
void apply (unsigned int width, unsigned int height)
void setSelectedEffect (std::string const &effectName)
LLString const & getSelectedEffect (void) const
void saveEffect (std::string const &effectName)

Static Public Member Functions

static void initClass (void)
 Perform global initialization for this class.
static void cleanupClass ()

Public Attributes

GLuint sceneRenderTexture
GLuint noiseTexture
GLuint tempBloomTexture
bool initialized
PostProcessTweaks tweaks
LLSD mAllEffects

Private Member Functions

void initialize (unsigned int width, unsigned int height)
 General functions.
void doEffects (void)
void applyShaders (void)
bool shadersEnabled (void)
void createNightVisionShader (void)
 Night Vision Functions.
void applyNightVisionShader (void)
void createBloomShader (void)
 Bloom Functions.
void applyBloomShader (void)
void createColorFilterShader (void)
 Color Filter Functions.
void applyColorFilterShader (void)
void getShaderUniforms (glslUniforms &uniforms, GLhandleARB &prog)
 OpenGL Helper Functions.
void createTexture (GLuint &texture, unsigned int width, unsigned int height)
void copyFrameBuffer (GLuint &texture, unsigned int width, unsigned int height)
void createNoiseTexture (GLuint &texture)
bool checkError (void)
void checkShaderError (GLhandleARB shader)
void drawOrthoQuad (unsigned int width, unsigned int height, QuadType type)
void viewOrthogonal (unsigned int width, unsigned int height)
void changeOrthogonal (unsigned int width, unsigned int height)
void viewPerspective (void)
void textureBlendReplace (void)
void textureBlendAdd (void)
void textureBlendSubtract (void)
void textureBlendAddSigned (void)
void textureBlendAlpha (void)
void textureBlendMultiply (void)
void textureBlendMultiplyX2 (void)

Private Attributes

std::string mShaderErrorString
 read in from file
unsigned int screenW
unsigned int screenH
float noiseTextureScale
glslUniforms nightVisionUniforms
 Shader Uniforms.
glslUniforms bloomExtractUniforms
glslUniforms bloomBlurUniforms
glslUniforms colorFilterUniforms
LLString mSelectedEffectName

Classes

struct  PostProcessTweaks


Detailed Description

Definition at line 40 of file llpostprocess.h.


Member Typedef Documentation

typedef std::map<const char *, GLuint> LLPostProcess::glslUniforms

GLSL Shader Encapsulation Struct.

Definition at line 52 of file llpostprocess.h.


Member Enumeration Documentation

Enumerator:
QUAD_NORMAL 
QUAD_NOISE 
QUAD_BLOOM_EXTRACT 
QUAD_BLOOM_COMBINE 

Definition at line 44 of file llpostprocess.h.


Constructor & Destructor Documentation

LLPostProcess::LLPostProcess ( void   ) 

NVG Defaults

Bloom Defaults

Color Filter Defaults

Definition at line 54 of file llpostprocess.cpp.

References LLSD::append(), LLSD::emptyArray(), LLSD::emptyMap(), gDirUtilp, LLDir::getExpandedFilename(), LLSD::has(), LL_DEBUGS2, LL_ENDL, LL_PATH_APP_SETTINGS, llifstream, mAllEffects, noiseTextureScale, setSelectedEffect(), LLSDSerialize::SIZE_UNLIMITED, and XML_FILENAME.

Referenced by initClass().

Here is the call graph for this function:

Here is the caller graph for this function:

LLPostProcess::~LLPostProcess ( void   ) 

Definition at line 110 of file llpostprocess.cpp.

References noiseTexture, sceneRenderTexture, and tempBloomTexture.


Member Function Documentation

void LLPostProcess::apply ( unsigned int  width,
unsigned int  height 
)

Definition at line 158 of file llpostprocess.cpp.

References doEffects(), initialize(), initialized, screenH, screenW, and shadersEnabled().

Here is the call graph for this function:

void LLPostProcess::initClass ( void   )  [static]

Perform global initialization for this class.

Definition at line 118 of file llpostprocess.cpp.

References LLPostProcess().

Referenced by idle_startup().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::cleanupClass (  )  [static]

Definition at line 132 of file llpostprocess.cpp.

References NULL.

Referenced by LLAppViewer::cleanup().

Here is the caller graph for this function:

void LLPostProcess::setSelectedEffect ( std::string const &  effectName  ) 

Definition at line 138 of file llpostprocess.cpp.

References mAllEffects, mSelectedEffectName, and tweaks.

Referenced by LLPostProcess(), and LLFloaterPostProcess::onLoadEffect().

Here is the caller graph for this function:

LLString const& LLPostProcess::getSelectedEffect ( void   )  const [inline]

Definition at line 210 of file llpostprocess.h.

References mSelectedEffectName.

Referenced by LLFloaterPostProcess::syncMenu().

Here is the caller graph for this function:

void LLPostProcess::saveEffect ( std::string const &  effectName  ) 

Definition at line 144 of file llpostprocess.cpp.

References gDirUtilp, LLDir::getExpandedFilename(), LL_PATH_APP_SETTINGS, llofstream, mAllEffects, tweaks, and XML_FILENAME.

Referenced by LLFloaterPostProcess::onSaveEffect(), and LLFloaterPostProcess::saveAlertCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::initialize ( unsigned int  width,
unsigned int  height 
) [private]

General functions.

Definition at line 168 of file llpostprocess.cpp.

References checkError(), createBloomShader(), createColorFilterShader(), createNightVisionShader(), createTexture(), initialized, sceneRenderTexture, screenH, and screenW.

Referenced by apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::doEffects ( void   )  [private]

Save GL State

Copy the screen buffer to the render texture

Clear the frame buffer.

Change to an orthogonal view

Change to a perspective view

Reset GL State

Definition at line 336 of file llpostprocess.cpp.

References applyShaders(), checkError(), copyFrameBuffer(), sceneRenderTexture, screenH, screenW, viewOrthogonal(), and viewPerspective().

Referenced by apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::applyShaders ( void   )  [private]

If any of the above shaders have been called update the frame buffer;

If any of the above shaders have been called update the frame buffer;

Definition at line 190 of file llpostprocess.cpp.

References applyBloomShader(), applyColorFilterShader(), applyNightVisionShader(), LLSD::asBoolean(), checkError(), copyFrameBuffer(), sceneRenderTexture, screenH, screenW, tweaks, LLPostProcess::PostProcessTweaks::useBloomShader(), LLPostProcess::PostProcessTweaks::useColorFilter(), and LLPostProcess::PostProcessTweaks::useNightVisionShader().

Referenced by doEffects().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLPostProcess::shadersEnabled ( void   )  [inline, private]

Definition at line 182 of file llpostprocess.cpp.

References LLSD::asBoolean(), tweaks, LLPostProcess::PostProcessTweaks::useBloomShader(), LLPostProcess::PostProcessTweaks::useColorFilter(), and LLPostProcess::PostProcessTweaks::useNightVisionShader().

Referenced by apply().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::createNightVisionShader ( void   )  [private]

Night Vision Functions.

Define uniform names

Definition at line 292 of file llpostprocess.cpp.

References createNoiseTexture(), nightVisionUniforms, and noiseTexture.

Referenced by initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::applyNightVisionShader ( void   )  [private]

void LLPostProcess::createBloomShader ( void   )  [private]

Bloom Functions.

Create Bloom Extract Shader

Create Bloom Blur Shader

Definition at line 309 of file llpostprocess.cpp.

References bloomBlurUniforms, bloomExtractUniforms, createTexture(), screenH, screenW, and tempBloomTexture.

Referenced by initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLPostProcess::applyBloomShader ( void   )  [private]

Definition at line 304 of file llpostprocess.cpp.

Referenced by applyShaders().

Here is the caller graph for this function:

void LLPostProcess::createColorFilterShader ( void   )  [private]

Color Filter Functions.

Define uniform names

Definition at line 245 of file llpostprocess.cpp.

References colorFilterUniforms.

Referenced by initialize().

Here is the caller graph for this function:

void LLPostProcess::applyColorFilterShader ( void   )  [private]

void LLPostProcess::getShaderUniforms ( glslUniforms uniforms,
GLhandleARB &  prog 
) [private]

OpenGL Helper Functions.

Find uniform locations and insert into map

Definition at line 327 of file llpostprocess.cpp.

References i.

Referenced by applyColorFilterShader(), and applyNightVisionShader().

Here is the caller graph for this function:

void LLPostProcess::createTexture ( GLuint &  texture,
unsigned int  width,
unsigned int  height 
) [private]

Definition at line 474 of file llpostprocess.cpp.

Referenced by createBloomShader(), and initialize().

Here is the caller graph for this function:

void LLPostProcess::copyFrameBuffer ( GLuint &  texture,
unsigned int  width,
unsigned int  height 
) [private]

Definition at line 367 of file llpostprocess.cpp.

Referenced by applyShaders(), and doEffects().

Here is the caller graph for this function:

void LLPostProcess::createNoiseTexture ( GLuint &  texture  )  [private]

Definition at line 492 of file llpostprocess.cpp.

References i, and NOISE_SIZE.

Referenced by createNightVisionShader().

Here is the caller graph for this function:

bool LLPostProcess::checkError ( void   )  [private]

Definition at line 513 of file llpostprocess.cpp.

References mShaderErrorString, and NULL.

Referenced by applyShaders(), checkShaderError(), doEffects(), and initialize().

Here is the caller graph for this function:

void LLPostProcess::checkShaderError ( GLhandleARB  shader  )  [private]

Could not allocate infolog buffer

Definition at line 541 of file llpostprocess.cpp.

References checkError(), mShaderErrorString, and NULL.

Here is the call graph for this function:

void LLPostProcess::drawOrthoQuad ( unsigned int  width,
unsigned int  height,
QuadType  type 
) [private]

Definition at line 373 of file llpostprocess.cpp.

References noiseTextureScale, QUAD_BLOOM_COMBINE, QUAD_BLOOM_EXTRACT, QUAD_NOISE, and screenH.

Referenced by applyColorFilterShader(), and applyNightVisionShader().

Here is the caller graph for this function:

void LLPostProcess::viewOrthogonal ( unsigned int  width,
unsigned int  height 
) [private]

Definition at line 449 of file llpostprocess.cpp.

Referenced by changeOrthogonal(), and doEffects().

Here is the caller graph for this function:

void LLPostProcess::changeOrthogonal ( unsigned int  width,
unsigned int  height 
) [private]

Definition at line 468 of file llpostprocess.cpp.

References viewOrthogonal(), and viewPerspective().

Here is the call graph for this function:

void LLPostProcess::viewPerspective ( void   )  [private]

Definition at line 460 of file llpostprocess.cpp.

Referenced by changeOrthogonal(), and doEffects().

Here is the caller graph for this function:

void LLPostProcess::textureBlendReplace ( void   )  [private]

Definition at line 569 of file llpostprocess.cpp.

void LLPostProcess::textureBlendAdd ( void   )  [private]

Definition at line 577 of file llpostprocess.cpp.

void LLPostProcess::textureBlendSubtract ( void   )  [private]

Definition at line 597 of file llpostprocess.cpp.

void LLPostProcess::textureBlendAddSigned ( void   )  [private]

Definition at line 587 of file llpostprocess.cpp.

void LLPostProcess::textureBlendAlpha ( void   )  [private]

Definition at line 607 of file llpostprocess.cpp.

void LLPostProcess::textureBlendMultiply ( void   )  [private]

Definition at line 619 of file llpostprocess.cpp.

void LLPostProcess::textureBlendMultiplyX2 ( void   )  [private]

Definition at line 629 of file llpostprocess.cpp.


Member Data Documentation

Definition at line 188 of file llpostprocess.h.

Referenced by createBloomShader(), and ~LLPostProcess().

Definition at line 189 of file llpostprocess.h.

Referenced by apply(), and initialize().

std::string LLPostProcess::mShaderErrorString [private]

read in from file

Definition at line 218 of file llpostprocess.h.

Referenced by checkError(), and checkShaderError().

unsigned int LLPostProcess::screenW [private]

unsigned int LLPostProcess::screenH [private]

Definition at line 222 of file llpostprocess.h.

Referenced by applyNightVisionShader(), drawOrthoQuad(), and LLPostProcess().

Shader Uniforms.

Definition at line 225 of file llpostprocess.h.

Referenced by applyNightVisionShader(), and createNightVisionShader().

Definition at line 226 of file llpostprocess.h.

Referenced by createBloomShader().

Definition at line 227 of file llpostprocess.h.

Referenced by createBloomShader().

Definition at line 228 of file llpostprocess.h.

Referenced by applyColorFilterShader(), and createColorFilterShader().

Definition at line 232 of file llpostprocess.h.

Referenced by getSelectedEffect(), and setSelectedEffect().


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

Generated on Fri May 16 08:59:57 2008 for SecondLife by  doxygen 1.5.5