LLShaderMgr Class Reference

#include <llglslshader.h>

Collaboration diagram for LLShaderMgr:

Collaboration graph
[legend]

List of all members.

Public Types

enum  EShaderClass {
  SHADER_LIGHTING, SHADER_OBJECT, SHADER_AVATAR, SHADER_ENVIRONMENT,
  SHADER_INTERFACE, SHADER_EFFECT, SHADER_WINDLIGHT, SHADER_WATER,
  SHADER_DEFERRED, SHADER_COUNT
}
enum  eGLSLReservedAttribs { MATERIAL_COLOR = 0, SPECULAR_COLOR, BINORMAL, END_RESERVED_ATTRIBS }
enum  eGLSLReservedUniforms {
  DIFFUSE_MAP = 0, SPECULAR_MAP, BUMP_MAP, ENVIRONMENT_MAP,
  CLOUD_NOISE_MAP, FULLBRIGHT, LIGHTNORM, SUNLIGHT_COLOR,
  AMBIENT, BLUE_HORIZON, BLUE_DENSITY, HAZE_HORIZON,
  HAZE_DENSITY, CLOUD_SHADOW, DENSITY_MULTIPLIER, DISTANCE_MULTIPLIER,
  MAX_Y, GLOW, CLOUD_COLOR, CLOUD_POS_DENSITY1,
  CLOUD_POS_DENSITY2, CLOUD_SCALE, GAMMA, SCENE_LIGHT_STRENGTH,
  END_RESERVED_UNIFORMS
}
enum  eShinyUniforms { SHINY_ORIGIN = END_RESERVED_UNIFORMS }
enum  eWaterUniforms {
  WATER_SCREENTEX = END_RESERVED_UNIFORMS, WATER_SCREENDEPTH, WATER_REFTEX, WATER_EYEVEC,
  WATER_TIME, WATER_WAVE_DIR1, WATER_WAVE_DIR2, WATER_LIGHT_DIR,
  WATER_SPECULAR, WATER_SPECULAR_EXP, WATER_FOGCOLOR, WATER_FOGDENSITY,
  WATER_REFSCALE, WATER_WATERHEIGHT
}
enum  eWLUniforms { WL_CAMPOSLOCAL = END_RESERVED_UNIFORMS, WL_WATERHEIGHT }
enum  eTerrainUniforms {
  TERRAIN_DETAIL0 = END_RESERVED_UNIFORMS, TERRAIN_DETAIL1, TERRAIN_DETAIL2, TERRAIN_DETAIL3,
  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 initAttribsAndUniforms (void)
static BOOL attachShaderFeatures (LLGLSLShader *shader)
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 loadShaderFile (const LLString &filename, S32 &shader_level, GLenum type)
static S32 getVertexShaderLevel (S32 type)
static BOOL loadBasicShaders ()
static BOOL loadShadersEffects ()
static BOOL loadShadersDeferred ()
static BOOL loadShadersObject ()
static BOOL loadShadersAvatar ()
static BOOL loadShadersEnvironment ()
static BOOL loadShadersWater ()
static BOOL loadShadersInterface ()
static BOOL loadShadersWindLight ()
static shader_iter beginShaders ()
static shader_iter endShaders ()

Static Public Attributes

static S32 sVertexShaderLevel [] = { 0 }
static S32 sMaxAvatarShaderLevel = 0

Static Private Attributes

static std::map< std::string,
GLhandleARB > 
sShaderObjects
static std::vector< std::string > sReservedAttribs
static std::vector< std::string > sReservedUniforms
static std::vector< std::string > sShinyUniforms
static std::vector< std::string > sWaterUniforms
static std::vector< std::string > sWLUniforms
static std::vector< std::string > sTerrainUniforms
static std::vector< std::string > sGlowUniforms
static std::vector< std::string > sGlowExtractUniforms
static std::vector< std::string > sAvatarAttribs
static std::vector< std::string > sAvatarUniforms
static LLGLSLShader *const sShaderList []
 Make sure WL Sky is the first program.
static const size_t sNumShaders = sizeof(sShaderList) / sizeof(sShaderList[0])

Friends

class LLGLSLShader

Classes

class  shader_iter


Detailed Description

Definition at line 136 of file llglslshader.h.


Member Enumeration Documentation

Enumerator:
SHADER_LIGHTING 
SHADER_OBJECT 
SHADER_AVATAR 
SHADER_ENVIRONMENT 
SHADER_INTERFACE 
SHADER_EFFECT 
SHADER_WINDLIGHT 
SHADER_WATER 
SHADER_DEFERRED 
SHADER_COUNT 

Definition at line 213 of file llglslshader.h.

Enumerator:
MATERIAL_COLOR 
SPECULAR_COLOR 
BINORMAL 
END_RESERVED_ATTRIBS 

Definition at line 227 of file llglslshader.h.

Enumerator:
DIFFUSE_MAP 
SPECULAR_MAP 
BUMP_MAP 
ENVIRONMENT_MAP 
CLOUD_NOISE_MAP 
FULLBRIGHT 
LIGHTNORM 
SUNLIGHT_COLOR 
AMBIENT 
BLUE_HORIZON 
BLUE_DENSITY 
HAZE_HORIZON 
HAZE_DENSITY 
CLOUD_SHADOW 
DENSITY_MULTIPLIER 
DISTANCE_MULTIPLIER 
MAX_Y 
GLOW 
CLOUD_COLOR 
CLOUD_POS_DENSITY1 
CLOUD_POS_DENSITY2 
CLOUD_SCALE 
GAMMA 
SCENE_LIGHT_STRENGTH 
END_RESERVED_UNIFORMS 

Definition at line 235 of file llglslshader.h.

Enumerator:
SHINY_ORIGIN 

Definition at line 264 of file llglslshader.h.

Enumerator:
WATER_SCREENTEX 
WATER_SCREENDEPTH 
WATER_REFTEX 
WATER_EYEVEC 
WATER_TIME 
WATER_WAVE_DIR1 
WATER_WAVE_DIR2 
WATER_LIGHT_DIR 
WATER_SPECULAR 
WATER_SPECULAR_EXP 
WATER_FOGCOLOR 
WATER_FOGDENSITY 
WATER_REFSCALE 
WATER_WATERHEIGHT 

Definition at line 269 of file llglslshader.h.

Enumerator:
WL_CAMPOSLOCAL 
WL_WATERHEIGHT 

Definition at line 287 of file llglslshader.h.

Enumerator:
TERRAIN_DETAIL0 
TERRAIN_DETAIL1 
TERRAIN_DETAIL2 
TERRAIN_DETAIL3 
TERRAIN_ALPHARAMP 

Definition at line 293 of file llglslshader.h.

Enumerator:
GLOW_DELTA 

Definition at line 302 of file llglslshader.h.

Enumerator:
AVATAR_WEIGHT 
AVATAR_CLOTHING 
AVATAR_WIND 
AVATAR_SINWAVE 
AVATAR_GRAVITY 

Definition at line 307 of file llglslshader.h.

Enumerator:
AVATAR_MATRIX 

Definition at line 316 of file llglslshader.h.


Member Function Documentation

void LLShaderMgr::initAttribsAndUniforms ( void   )  [static]

Definition at line 181 of file llglslshader.cpp.

References sAvatarAttribs, sAvatarUniforms, sGlowExtractUniforms, sGlowUniforms, sReservedAttribs, sReservedUniforms, sShinyUniforms, sTerrainUniforms, sWaterUniforms, and sWLUniforms.

Referenced by setShaders().

Here is the caller graph for this function:

BOOL LLShaderMgr::attachShaderFeatures ( LLGLSLShader shader  )  [static]

void LLShaderMgr::setShaders (  )  [static]

void LLShaderMgr::unloadShaders (  )  [static]

Definition at line 913 of file llglslshader.cpp.

References gPipeline, LLPipeline::mVertexShadersLoaded, SHADER_AVATAR, SHADER_ENVIRONMENT, SHADER_INTERFACE, SHADER_LIGHTING, SHADER_OBJECT, SHADER_WATER, sVertexShaderLevel, and LLGLSLShader::unload().

Referenced by LLPipeline::unloadShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 491 of file llglslshader.cpp.

References get_object_log(), LL_DEBUGS, LL_ENDL, LL_WARNS, and indra::base::lllog::log().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 634 of file llglslshader.cpp.

References dumpObjectLog(), FALSE, get_object_log(), gGL, LL_ENDL, LL_WARNS, indra::base::lllog::log(), LLGLImmediate::mMode, and LLStringBase< char >::toLower().

Referenced by LLGLSLShader::link().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 686 of file llglslshader.cpp.

References dumpObjectLog(), FALSE, LL_ENDL, and LL_WARNS.

Here is the call graph for this function:

GLhandleARB LLShaderMgr::loadShaderFile ( const LLString filename,
S32 shader_level,
GLenum  type 
) [static]

Definition at line 504 of file llglslshader.cpp.

References dumpObjectLog(), LLFile::fopen(), gDirUtilp, LLDir::getExpandedFilename(), i, LL_DEBUGS, LL_ENDL, LL_INFOS, LL_PATH_APP_SETTINGS, LL_WARNS, NULL, S32, sShaderObjects, and stop_glerror.

Referenced by loadBasicShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

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

BOOL LLShaderMgr::loadBasicShaders (  )  [static]

Definition at line 953 of file llglslshader.cpp.

References FALSE, LLSingleton< LLFeatureManager >::getInstance(), LLPipeline::getLightingDetail(), gPipeline, GPU_CLASS_1, i, loadShaderFile(), S32, SHADER_LIGHTING, SHADER_WATER, SHADER_WINDLIGHT, sVertexShaderLevel, and TRUE.

Referenced by setShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLShaderMgr::loadShadersEffects (  )  [static]

Definition at line 1153 of file llglslshader.cpp.

References LLGLSLShader::createShader(), FALSE, LLGLSLShader::mName, LLGLSLShader::mShaderFiles, LLGLSLShader::mShaderLevel, NULL, sGlowExtractUniforms, sGlowUniforms, SHADER_EFFECT, LLPipeline::sRenderGlow, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLShaderMgr::loadShadersDeferred (  )  [static]

Definition at line 1243 of file llglslshader.cpp.

References LLGLSLShader::createShader(), FALSE, LLGLSLShader::mName, LLGLSLShader::mShaderFiles, LLGLSLShader::mShaderLevel, NULL, SHADER_DEFERRED, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLShaderMgr::loadShadersObject (  )  [static]

BOOL LLShaderMgr::loadShadersAvatar (  )  [static]

BOOL LLShaderMgr::loadShadersEnvironment (  )  [static]

BOOL LLShaderMgr::loadShadersWater (  )  [static]

BOOL LLShaderMgr::loadShadersInterface (  )  [static]

Definition at line 1488 of file llglslshader.cpp.

References LLGLSLShader::createShader(), FALSE, LLGLSLShader::mName, LLGLSLShader::mShaderFiles, LLGLSLShader::mShaderLevel, NULL, SHADER_INTERFACE, sVertexShaderLevel, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLShaderMgr::loadShadersWindLight (  )  [static]

Definition at line 1517 of file llglslshader.cpp.

References LLGLSLShader::createShader(), FALSE, LLGLSLShader::mName, LLGLSLShader::mShaderFiles, LLGLSLShader::mShaderGroup, LLGLSLShader::mShaderLevel, NULL, LLGLSLShader::SG_SKY, SHADER_WINDLIGHT, sVertexShaderLevel, sWLUniforms, TRUE, and LLGLSLShader::unload().

Referenced by setShaders().

Here is the call graph for this function:

Here is the caller graph for this function:

static shader_iter LLShaderMgr::beginShaders (  )  [inline, static]

Definition at line 200 of file llglslshader.h.

References sShaderList.

Referenced by LLWLParamManager::propagateParameters(), LLWaterParamManager::propagateParameters(), LLWLParamManager::update(), and LLWaterParamManager::update().

Here is the caller graph for this function:

static shader_iter LLShaderMgr::endShaders (  )  [inline, static]

Definition at line 205 of file llglslshader.h.

References sNumShaders, and sShaderList.

Referenced by LLWLParamManager::propagateParameters(), LLWaterParamManager::propagateParameters(), LLWLParamManager::update(), and LLWaterParamManager::update().

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class LLGLSLShader [friend]

Definition at line 138 of file llglslshader.h.


Member Data Documentation

std::map< string, GLhandleARB > LLShaderMgr::sShaderObjects [static, private]

Definition at line 324 of file llglslshader.h.

Referenced by LLGLSLShader::attachObject(), loadShaderFile(), and setShaders().

vector< string > LLShaderMgr::sReservedAttribs [static, private]

Definition at line 327 of file llglslshader.h.

Referenced by initAttribsAndUniforms().

vector< string > LLShaderMgr::sReservedUniforms [static, private]

Definition at line 329 of file llglslshader.h.

Referenced by initAttribsAndUniforms().

vector< string > LLShaderMgr::sShinyUniforms [static, private]

Definition at line 331 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersObject().

vector< string > LLShaderMgr::sWaterUniforms [static, private]

Definition at line 334 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersWater().

vector< string > LLShaderMgr::sWLUniforms [static, private]

Definition at line 336 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersWindLight().

vector< string > LLShaderMgr::sTerrainUniforms [static, private]

vector< string > LLShaderMgr::sGlowUniforms [static, private]

Definition at line 342 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersEffects().

vector< string > LLShaderMgr::sGlowExtractUniforms [static, private]

Definition at line 344 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersEffects().

vector< string > LLShaderMgr::sAvatarAttribs [static, private]

Definition at line 347 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersAvatar().

vector< string > LLShaderMgr::sAvatarUniforms [static, private]

Definition at line 349 of file llglslshader.h.

Referenced by initAttribsAndUniforms(), and loadShadersAvatar().

LLGLSLShader *const LLShaderMgr::sShaderList [static, private]

const size_t LLShaderMgr::sNumShaders = sizeof(sShaderList) / sizeof(sShaderList[0]) [static, private]

Definition at line 356 of file llglslshader.h.

Referenced by endShaders().


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

Generated on Fri May 16 09:04:34 2008 for SecondLife by  doxygen 1.5.5