LLShaderMgr Class Reference

#include <llglslshader.h>

List of all members.

Public Types

 SHADER_LIGHTING
 SHADER_OBJECT
 SHADER_AVATAR
 SHADER_ENVIRONMENT
 SHADER_INTERFACE
 SHADER_COUNT
 MATERIAL_COLOR = 0
 SPECULAR_COLOR
 BINORMAL
 END_RESERVED_ATTRIBS
 DIFFUSE_MAP = 0
 SPECULAR_MAP
 BUMP_MAP
 ENVIRONMENT_MAP
 END_RESERVED_UNIFORMS
 SHINY_ORIGIN = END_RESERVED_UNIFORMS
 WATER_SCREENTEX = END_RESERVED_UNIFORMS
 WATER_EYEVEC
 WATER_TIME
 WATER_WAVE_DIR1
 WATER_WAVE_DIR2
 WATER_LIGHT_DIR
 WATER_SPECULAR
 WATER_SPECULAR_EXP
 WATER_FBSCALE
 WATER_REFSCALE
 TERRAIN_DETAIL0 = END_RESERVED_UNIFORMS
 TERRAIN_DETAIL1
 TERRAIN_ALPHARAMP
 GLOW_DELTA = END_RESERVED_UNIFORMS
 AVATAR_WEIGHT = END_RESERVED_ATTRIBS
 AVATAR_CLOTHING
 AVATAR_WIND
 AVATAR_SINWAVE
 AVATAR_GRAVITY
 AVATAR_MATRIX = END_RESERVED_UNIFORMS
enum  EShaderClass {
  SHADER_LIGHTING, SHADER_OBJECT, SHADER_AVATAR, SHADER_ENVIRONMENT,
  SHADER_INTERFACE, SHADER_COUNT
}
enum  eGLSLReservedAttribs { MATERIAL_COLOR = 0, SPECULAR_COLOR, BINORMAL, END_RESERVED_ATTRIBS }
enum  eGLSLReservedUniforms {
  DIFFUSE_MAP = 0, SPECULAR_MAP, BUMP_MAP, ENVIRONMENT_MAP,
  END_RESERVED_UNIFORMS
}
enum  eShinyUniforms { SHINY_ORIGIN = END_RESERVED_UNIFORMS }
enum  eWaterUniforms {
  WATER_SCREENTEX = END_RESERVED_UNIFORMS, WATER_EYEVEC, WATER_TIME, WATER_WAVE_DIR1,
  WATER_WAVE_DIR2, WATER_LIGHT_DIR, WATER_SPECULAR, WATER_SPECULAR_EXP,
  WATER_FBSCALE, WATER_REFSCALE
}
enum  eTerrainUniforms { TERRAIN_DETAIL0 = END_RESERVED_UNIFORMS, TERRAIN_DETAIL1, TERRAIN_ALPHARAMP }
enum  eGlowUniforms { GLOW_DELTA = END_RESERVED_UNIFORMS }
enum  eAvatarAttribs {
  AVATAR_WEIGHT = END_RESERVED_ATTRIBS, AVATAR_CLOTHING, AVATAR_WIND, AVATAR_SINWAVE,
  AVATAR_GRAVITY
}
enum  eAvatarUniforms { AVATAR_MATRIX = END_RESERVED_UNIFORMS }

Static Public Member Functions

static void setShaders ()
static void unloadShaders ()
static void dumpObjectLog (GLhandleARB ret, BOOL warns=TRUE)
static BOOL linkProgramObject (GLhandleARB obj, BOOL suppress_errors=FALSE)
static BOOL validateProgramObject (GLhandleARB obj)
static GLhandleARB loadShader (const LLString &filename, S32 cls, GLenum type)
static S32 getVertexShaderLevel (S32 type)
static S32 getMaxVertexShaderLevel (S32 type)
static BOOL loadShadersLighting ()
static BOOL loadShadersObject ()
static BOOL loadShadersAvatar ()
static BOOL loadShadersEnvironment ()
static BOOL loadShadersInterface ()

Static Public Attributes

static S32 sVertexShaderLevel [] = { 0 }
static S32 sMaxVertexShaderLevel [] = { 0 }
static const char * sReservedAttribs []
static U32 sReservedAttribCount = LLShaderMgr::END_RESERVED_ATTRIBS
static const char * sReservedUniforms []
static U32 sReservedUniformCount = LLShaderMgr::END_RESERVED_UNIFORMS
static const char * sShinyUniforms []
static U32 sShinyUniformCount = sizeof(LLShaderMgr::sShinyUniforms)/sizeof(char*)
static const char * sWaterUniforms []
static U32 sWaterUniformCount = sizeof(LLShaderMgr::sWaterUniforms)/sizeof(char*)
static const char * sTerrainUniforms []
static U32 sTerrainUniformCount = sizeof(LLShaderMgr::sTerrainUniforms)/sizeof(char*)
static const char * sGlowUniforms []
static U32 sGlowUniformCount = sizeof(LLShaderMgr::sGlowUniforms)/sizeof(char*)
static const char * sAvatarAttribs []
static U32 sAvatarAttribCount = sizeof(LLShaderMgr::sAvatarAttribs)/sizeof(char*)
static const char * sAvatarUniforms []
static U32 sAvatarUniformCount = 1


Detailed Description

Definition at line 78 of file llglslshader.h.


Member Enumeration Documentation

enum LLShaderMgr::eAvatarAttribs

Enumerator:
AVATAR_WEIGHT 
AVATAR_CLOTHING 
AVATAR_WIND 
AVATAR_SINWAVE 
AVATAR_GRAVITY 

Definition at line 180 of file llglslshader.h.

enum LLShaderMgr::eAvatarUniforms

Enumerator:
AVATAR_MATRIX 

Definition at line 192 of file llglslshader.h.

enum LLShaderMgr::eGlowUniforms

Enumerator:
GLOW_DELTA 

Definition at line 171 of file llglslshader.h.

enum LLShaderMgr::eGLSLReservedAttribs

Enumerator:
MATERIAL_COLOR 
SPECULAR_COLOR 
BINORMAL 
END_RESERVED_ATTRIBS 

Definition at line 110 of file llglslshader.h.

enum LLShaderMgr::eGLSLReservedUniforms

Enumerator:
DIFFUSE_MAP 
SPECULAR_MAP 
BUMP_MAP 
ENVIRONMENT_MAP 
END_RESERVED_UNIFORMS 

Definition at line 121 of file llglslshader.h.

enum LLShaderMgr::EShaderClass

Enumerator:
SHADER_LIGHTING 
SHADER_OBJECT 
SHADER_AVATAR 
SHADER_ENVIRONMENT 
SHADER_INTERFACE 
SHADER_COUNT 

Definition at line 100 of file llglslshader.h.

enum LLShaderMgr::eShinyUniforms

Enumerator:
SHINY_ORIGIN 

Definition at line 133 of file llglslshader.h.

enum LLShaderMgr::eTerrainUniforms

Enumerator:
TERRAIN_DETAIL0 
TERRAIN_DETAIL1 
TERRAIN_ALPHARAMP 

Definition at line 160 of file llglslshader.h.

enum LLShaderMgr::eWaterUniforms

Enumerator:
WATER_SCREENTEX 
WATER_EYEVEC 
WATER_TIME 
WATER_WAVE_DIR1 
WATER_WAVE_DIR2 
WATER_LIGHT_DIR 
WATER_SPECULAR 
WATER_SPECULAR_EXP 
WATER_FBSCALE 
WATER_REFSCALE 

Definition at line 142 of file llglslshader.h.


Member Function Documentation

void LLShaderMgr::dumpObjectLog ( GLhandleARB  ret,
BOOL  warns = TRUE 
) [static]

Definition at line 193 of file llglslshader.cpp.

References get_object_log(), llendl, llinfos, and llwarns.

Referenced by linkProgramObject(), loadShader(), and validateProgramObject().

S32 LLShaderMgr::getMaxVertexShaderLevel ( S32  type  )  [static]

Definition at line 167 of file llglslshader.cpp.

References sMaxVertexShaderLevel.

Referenced by LLPanelDisplay3::refreshEnabledState().

S32 LLShaderMgr::getVertexShaderLevel ( S32  type  )  [static]

Definition at line 162 of file llglslshader.cpp.

References sVertexShaderLevel.

Referenced by LLDrawPoolBump::beginShiny(), LLDrawPoolBump::endShiny(), LLVOAvatar::idleUpdate(), LLDrawPoolWater::prerender(), LLDrawPoolStars::prerender(), LLDrawPoolSky::prerender(), LLDrawPoolSimple::prerender(), LLDrawPoolGround::prerender(), LLDrawPoolBump::prerender(), LLDrawPoolAvatar::prerender(), LLDrawPoolAlpha::prerender(), and LLViewerJointMesh::updateGeometry().

BOOL LLShaderMgr::linkProgramObject ( GLhandleARB  obj,
BOOL  suppress_errors = FALSE 
) [static]

Definition at line 360 of file llglslshader.cpp.

References dumpObjectLog(), FALSE, get_object_log(), llendl, llwarns, and LLStringBase< char >::toLower().

Referenced by LLGLSLShader::link().

GLhandleARB LLShaderMgr::loadShader ( const LLString filename,
S32  cls,
GLenum  type 
) [static]

Definition at line 206 of file llglslshader.cpp.

References count, dumpObjectLog(), f, gDirUtilp, LLDir::getExpandedFilename(), glGetError, i, LL_PATH_APP_SETTINGS, llendl, llinfos, llwarns, NULL, S32, sMaxVertexShaderLevel, stop_glerror, and sVertexShaderLevel.

Referenced by loadShadersAvatar(), loadShadersEnvironment(), loadShadersInterface(), loadShadersLighting(), and loadShadersObject().

BOOL LLShaderMgr::loadShadersAvatar (  )  [static]

Definition at line 834 of file llglslshader.cpp.

References LLGLSLShader::attachObject(), LLGLSLShader::attachObjects(), FALSE, gAvatarEyeballProgram, gAvatarPickProgram, gAvatarProgram, gAvatarSkinVertex, gLightFragment, gLightVertex, gScatterFragment, gScatterVertex, llendl, llwarns, loadShader(), LLGLSLShader::mapAttributes(), LLGLSLShader::mapUniforms(), LLGLSLShader::mProgramObject, S32, sAvatarAttribCount, sAvatarAttribs, sAvatarUniformCount, sAvatarUniforms, SHADER_AVATAR, sMaxVertexShaderLevel, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

BOOL LLShaderMgr::loadShadersEnvironment (  )  [static]

Definition at line 600 of file llglslshader.cpp.

References LLGLSLShader::attachObject(), LLGLSLShader::attachObjects(), FALSE, gGlowProgram, gGroundProgram, gLightFragment, gLightVertex, gScatterFragment, gScatterVertex, gTerrainProgram, gWaterProgram, gWorldPointer, llendl, llwarns, loadShader(), LLGLSLShader::mapAttributes(), LLGLSLShader::mapUniforms(), LLGLSLShader::mProgramObject, S32, sGlowUniformCount, sGlowUniforms, SHADER_ENVIRONMENT, sMaxVertexShaderLevel, sTerrainUniformCount, sTerrainUniforms, sVertexShaderLevel, sWaterUniformCount, sWaterUniforms, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

BOOL LLShaderMgr::loadShadersInterface (  )  [static]

Definition at line 930 of file llglslshader.cpp.

References LLGLSLShader::attachObject(), FALSE, gHighlightProgram, llendl, llwarns, loadShader(), LLGLSLShader::mapAttributes(), LLGLSLShader::mapUniforms(), LLGLSLShader::mProgramObject, SHADER_INTERFACE, sMaxVertexShaderLevel, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

BOOL LLShaderMgr::loadShadersLighting (  )  [static]

Definition at line 557 of file llglslshader.cpp.

References FALSE, gLightFragment, gLightVertex, gScatterFragment, gScatterVertex, llendl, llwarns, loadShader(), SHADER_ENVIRONMENT, SHADER_LIGHTING, and TRUE.

Referenced by setShaders().

BOOL LLShaderMgr::loadShadersObject (  )  [static]

Definition at line 718 of file llglslshader.cpp.

References LLGLSLShader::attachObject(), LLGLSLShader::attachObjects(), FALSE, gLightFragment, gLightVertex, gObjectAlphaProgram, gObjectBumpProgram, gObjectShinyProgram, gObjectSimpleProgram, gScatterFragment, gScatterVertex, llendl, llwarns, loadShader(), LLGLSLShader::mapAttributes(), LLGLSLShader::mapUniforms(), LLGLSLShader::mProgramObject, S32, SHADER_OBJECT, sMaxVertexShaderLevel, sShinyUniformCount, sShinyUniforms, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

void LLShaderMgr::setShaders (  )  [static]

Definition at line 410 of file llglslshader.cpp.

References LLPipeline::canUseVertexShaders(), FALSE, LLControlGroup::getBOOL(), LLPipeline::getLightingDetail(), LLControlGroup::getS32(), gFeatureManagerp, gGLManager, gPipeline, gSavedSettings, gViewerWindow, i, LLFeatureList::isFeatureAvailable(), llmax(), loadShadersAvatar(), loadShadersEnvironment(), loadShadersLighting(), loadShadersObject(), LLGLManager::mHasCubeMap, LLGLManager::mHasFramebufferObject, LLPipeline::mInitialized, LLPipeline::mVertexShadersEnabled, LLPipeline::mVertexShadersLoaded, LLPipeline::resetVertexBuffers(), S32, LLPipeline::sDynamicReflections, LLControlGroup::setBOOL(), LLViewerWindow::setCursor(), LLPipeline::setLightingDetail(), LLControlGroup::setS32(), SHADER_AVATAR, SHADER_COUNT, SHADER_ENVIRONMENT, SHADER_LIGHTING, SHADER_OBJECT, sMaxVertexShaderLevel, LLPipeline::sRenderGlow, sVertexShaderLevel, TRUE, UI_CURSOR_ARROW, and UI_CURSOR_WAIT.

Referenced by LLReleaseGLBufferListener::handleEvent(), LLSetShaderListener::handleEvent(), LLPipeline::init(), LLPipeline::restoreGL(), and LLPipeline::setLightingDetail().

void LLShaderMgr::unloadShaders (  )  [static]

Definition at line 532 of file llglslshader.cpp.

References gAvatarEyeballProgram, gAvatarPickProgram, gAvatarProgram, gGlowProgram, gGroundProgram, gHighlightProgram, gLightFragment, gLightVertex, gObjectAlphaProgram, gObjectBumpProgram, gObjectShinyProgram, gObjectSimpleProgram, gPipeline, gScatterFragment, gScatterVertex, gTerrainProgram, gWaterProgram, LLPipeline::mVertexShadersLoaded, SHADER_AVATAR, SHADER_ENVIRONMENT, SHADER_INTERFACE, SHADER_LIGHTING, SHADER_OBJECT, sVertexShaderLevel, and LLGLSLShader::unload().

Referenced by LLPipeline::unloadShaders().

BOOL LLShaderMgr::validateProgramObject ( GLhandleARB  obj  )  [static]

Definition at line 388 of file llglslshader.cpp.

References dumpObjectLog(), FALSE, llendl, and llwarns.


Member Data Documentation

U32 LLShaderMgr::sAvatarAttribCount = sizeof(LLShaderMgr::sAvatarAttribs)/sizeof(char*) [static]

Definition at line 178 of file llglslshader.h.

Referenced by loadShadersAvatar().

const char * LLShaderMgr::sAvatarAttribs [static]

Initial value:

 
{
        "weight",
        "clothing",
        "gWindDir",
        "gSinWaveParams",
        "gGravity"
}

Definition at line 177 of file llglslshader.h.

Referenced by loadShadersAvatar().

U32 LLShaderMgr::sAvatarUniformCount = 1 [static]

Definition at line 190 of file llglslshader.h.

Referenced by loadShadersAvatar().

const char * LLShaderMgr::sAvatarUniforms [static]

Initial value:

 
{
        "matrixPalette"
}

Definition at line 189 of file llglslshader.h.

Referenced by loadShadersAvatar().

U32 LLShaderMgr::sGlowUniformCount = sizeof(LLShaderMgr::sGlowUniforms)/sizeof(char*) [static]

Definition at line 169 of file llglslshader.h.

Referenced by loadShadersEnvironment().

const char * LLShaderMgr::sGlowUniforms [static]

Initial value:

{
        "delta"
}

Definition at line 168 of file llglslshader.h.

Referenced by loadShadersEnvironment().

S32 LLShaderMgr::sMaxVertexShaderLevel = { 0 } [static]

Definition at line 95 of file llglslshader.h.

Referenced by getMaxVertexShaderLevel(), loadShader(), loadShadersAvatar(), loadShadersEnvironment(), loadShadersInterface(), loadShadersObject(), and setShaders().

U32 LLShaderMgr::sReservedAttribCount = LLShaderMgr::END_RESERVED_ATTRIBS [static]

Definition at line 98 of file llglslshader.h.

Referenced by LLGLSLShader::mapAttributes().

const char * LLShaderMgr::sReservedAttribs [static]

Initial value:

{
        "materialColor",
        "specularColor",
        "binormal"
}

Definition at line 97 of file llglslshader.h.

Referenced by LLGLSLShader::mapAttributes().

U32 LLShaderMgr::sReservedUniformCount = LLShaderMgr::END_RESERVED_UNIFORMS [static]

Definition at line 119 of file llglslshader.h.

const char * LLShaderMgr::sReservedUniforms [static]

Initial value:

{
        "diffuseMap",
        "specularMap",
        "bumpMap",
        "environmentMap",
        "scatterMap"
}

Definition at line 118 of file llglslshader.h.

U32 LLShaderMgr::sShinyUniformCount = sizeof(LLShaderMgr::sShinyUniforms)/sizeof(char*) [static]

Definition at line 131 of file llglslshader.h.

Referenced by loadShadersObject().

const char * LLShaderMgr::sShinyUniforms [static]

Initial value:

 
{
        "origin"
}

Definition at line 130 of file llglslshader.h.

Referenced by loadShadersObject().

U32 LLShaderMgr::sTerrainUniformCount = sizeof(LLShaderMgr::sTerrainUniforms)/sizeof(char*) [static]

Definition at line 158 of file llglslshader.h.

Referenced by loadShadersEnvironment().

const char * LLShaderMgr::sTerrainUniforms [static]

Initial value:

{
        "detail0",
        "detail1",
        "alphaRamp"
}

Definition at line 157 of file llglslshader.h.

Referenced by loadShadersEnvironment().

S32 LLShaderMgr::sVertexShaderLevel = { 0 } [static]

Definition at line 94 of file llglslshader.h.

Referenced by getVertexShaderLevel(), loadShader(), loadShadersAvatar(), loadShadersEnvironment(), loadShadersInterface(), loadShadersObject(), LLPipeline::renderHighlights(), setShaders(), and unloadShaders().

U32 LLShaderMgr::sWaterUniformCount = sizeof(LLShaderMgr::sWaterUniforms)/sizeof(char*) [static]

Definition at line 140 of file llglslshader.h.

Referenced by loadShadersEnvironment().

const char * LLShaderMgr::sWaterUniforms [static]

Initial value:

{
        "screenTex",
        "eyeVec",
        "time",
        "d1",
        "d2",
        "lightDir",
        "specular",
        "lightExp",
        "fbScale",
        "refScale"
}

Definition at line 139 of file llglslshader.h.

Referenced by loadShadersEnvironment().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:46 2010 for Second Life Viewer by  doxygen 1.4.7