本文整理汇总了C++中LLGLSLShader::unload方法的典型用法代码示例。如果您正苦于以下问题:C++ LLGLSLShader::unload方法的具体用法?C++ LLGLSLShader::unload怎么用?C++ LLGLSLShader::unload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLGLSLShader
的用法示例。
在下文中一共展示了LLGLSLShader::unload方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadShadersInterface
BOOL LLViewerShaderMgr::loadShadersInterface()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_INTERFACE] == 0)
{
gHighlightProgram.unload();
return FALSE;
}
if (success)
{
gHighlightProgram.mName = "Highlight Shader";
gHighlightProgram.mShaderFiles.clear();
gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER_ARB));
gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB));
gHighlightProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
success = gHighlightProgram.createShader(NULL, NULL);
}
if( !success )
{
mVertexShaderLevel[SHADER_INTERFACE] = 0;
return FALSE;
}
return TRUE;
}
示例2: loadShadersEnvironment
BOOL LLViewerShaderMgr::loadShadersEnvironment()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_ENVIRONMENT] == 0)
{
gTerrainProgram.unload();
return FALSE;
}
if (success)
{
gTerrainProgram.mName = "Terrain Shader";
gTerrainProgram.mFeatures.calculatesLighting = true;
gTerrainProgram.mFeatures.calculatesAtmospherics = true;
gTerrainProgram.mFeatures.hasAtmospherics = true;
gTerrainProgram.mFeatures.hasGamma = true;
gTerrainProgram.mShaderFiles.clear();
gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainF.glsl", GL_FRAGMENT_SHADER_ARB));
gTerrainProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT];
success = gTerrainProgram.createShader(NULL, &mTerrainUniforms);
}
if (!success)
{
mVertexShaderLevel[SHADER_ENVIRONMENT] = 0;
return FALSE;
}
LLWorld::getInstance()->updateWaterObjects();
return TRUE;
}
示例3: loadShadersWindLight
BOOL LLViewerShaderMgr::loadShadersWindLight()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_WINDLIGHT] < 2)
{
gWLSkyProgram.unload();
gWLCloudProgram.unload();
return FALSE;
}
if (success)
{
gWLSkyProgram.mName = "Windlight Sky Shader";
//gWLSkyProgram.mFeatures.hasGamma = true;
gWLSkyProgram.mShaderFiles.clear();
gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyV.glsl", GL_VERTEX_SHADER_ARB));
gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT];
gWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY;
success = gWLSkyProgram.createShader(NULL, &mWLUniforms);
}
if (success)
{
gWLCloudProgram.mName = "Windlight Cloud Program";
//gWLCloudProgram.mFeatures.hasGamma = true;
gWLCloudProgram.mShaderFiles.clear();
gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsV.glsl", GL_VERTEX_SHADER_ARB));
gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT];
gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY;
success = gWLCloudProgram.createShader(NULL, &mWLUniforms);
}
return success;
}
示例4: loadShadersDeferred
BOOL LLViewerShaderMgr::loadShadersDeferred()
{
if (mVertexShaderLevel[SHADER_DEFERRED] == 0)
{
gDeferredDiffuseProgram.unload();
return FALSE;
}
BOOL success = TRUE;
if (success)
{
gDeferredDiffuseProgram.mName = "Deffered Diffuse Shader";
gDeferredDiffuseProgram.mShaderFiles.clear();
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredDiffuseProgram.createShader(NULL, NULL);
}
return success;
}
示例5: loadShadersDeferred
BOOL LLViewerShaderMgr::loadShadersDeferred()
{
if (mVertexShaderLevel[SHADER_DEFERRED] == 0)
{
gDeferredTreeProgram.unload();
gDeferredDiffuseProgram.unload();
gDeferredBumpProgram.unload();
gDeferredImpostorProgram.unload();
gDeferredTerrainProgram.unload();
gDeferredLightProgram.unload();
gDeferredMultiLightProgram.unload();
gDeferredSunProgram.unload();
gDeferredBlurLightProgram.unload();
gDeferredSoftenProgram.unload();
gDeferredShadowProgram.unload();
gDeferredAvatarShadowProgram.unload();
gDeferredAvatarProgram.unload();
gDeferredAvatarAlphaProgram.unload();
gDeferredAlphaProgram.unload();
gDeferredFullbrightProgram.unload();
gDeferredWaterProgram.unload();
return FALSE;
}
mVertexShaderLevel[SHADER_AVATAR] = 1;
BOOL success = TRUE;
if (success)
{
gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader";
gDeferredDiffuseProgram.mShaderFiles.clear();
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredDiffuseProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredDiffuseProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredBumpProgram.mName = "Deferred Bump Shader";
gDeferredBumpProgram.mShaderFiles.clear();
gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredBumpProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredTreeProgram.mName = "Deferred Tree Shader";
gDeferredTreeProgram.mShaderFiles.clear();
gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredTreeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredTreeProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredImpostorProgram.mName = "Deferred Impostor Shader";
gDeferredImpostorProgram.mShaderFiles.clear();
gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredImpostorProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredLightProgram.mName = "Deferred Light Shader";
gDeferredLightProgram.mShaderFiles.clear();
gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredLightProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader";
gDeferredMultiLightProgram.mShaderFiles.clear();
gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredMultiLightProgram.createShader(NULL, NULL);
}
if (success)
{
gDeferredSunProgram.mName = "Deferred Sun Shader";
gDeferredSunProgram.mShaderFiles.clear();
gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredSunProgram.createShader(NULL, NULL);
}
if (success)
{
//.........这里部分代码省略.........
示例6: loadShadersEffects
BOOL LLViewerShaderMgr::loadShadersEffects()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_EFFECT] == 0)
{
gGlowProgram.unload();
gGlowExtractProgram.unload();
gPostColorFilterProgram.unload();
gPostNightVisionProgram.unload();
return FALSE;
}
if (success)
{
gGlowProgram.mName = "Glow Shader (Post)";
gGlowProgram.mShaderFiles.clear();
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER_ARB));
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowProgram.createShader(NULL, &mGlowUniforms);
if (!success)
{
LLPipeline::sRenderGlow = FALSE;
}
}
if (success)
{
gGlowExtractProgram.mName = "Glow Extract Shader (Post)";
gGlowExtractProgram.mShaderFiles.clear();
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB));
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms);
if (!success)
{
LLPipeline::sRenderGlow = FALSE;
}
}
#if 0
// disabling loading of postprocess shaders until we fix
// ATI sampler2DRect compatibility.
//load Color Filter Shader
if (success)
{
vector<string> shaderUniforms;
shaderUniforms.reserve(7);
shaderUniforms.push_back("RenderTexture");
shaderUniforms.push_back("gamma");
shaderUniforms.push_back("brightness");
shaderUniforms.push_back("contrast");
shaderUniforms.push_back("contrastBase");
shaderUniforms.push_back("saturation");
shaderUniforms.push_back("lumWeights");
gPostColorFilterProgram.mName = "Color Filter Shader (Post)";
gPostColorFilterProgram.mShaderFiles.clear();
gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/colorFilterF.glsl", GL_FRAGMENT_SHADER_ARB));
gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
gPostColorFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gPostColorFilterProgram.createShader(NULL, &shaderUniforms);
}
//load Night Vision Shader
if (success)
{
vector<string> shaderUniforms;
shaderUniforms.reserve(5);
shaderUniforms.push_back("RenderTexture");
shaderUniforms.push_back("NoiseTexture");
shaderUniforms.push_back("brightMult");
shaderUniforms.push_back("noiseStrength");
shaderUniforms.push_back("lumWeights");
gPostNightVisionProgram.mName = "Night Vision Shader (Post)";
gPostNightVisionProgram.mShaderFiles.clear();
gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/nightVisionF.glsl", GL_FRAGMENT_SHADER_ARB));
gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms);
}
#endif
return success;
}
示例7: loadShadersWater
BOOL LLViewerShaderMgr::loadShadersWater()
{
BOOL success = TRUE;
BOOL terrainWaterSuccess = TRUE;
if (mVertexShaderLevel[SHADER_WATER] == 0)
{
gWaterProgram.unload();
gUnderWaterProgram.unload();
gTerrainWaterProgram.unload();
return FALSE;
}
if (success)
{
// load water shader
gWaterProgram.mName = "Water Shader";
gWaterProgram.mFeatures.calculatesAtmospherics = true;
gWaterProgram.mFeatures.hasGamma = true;
gWaterProgram.mFeatures.hasTransport = true;
gWaterProgram.mShaderFiles.clear();
gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB));
gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER_ARB));
gWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER];
success = gWaterProgram.createShader(NULL, &mWaterUniforms);
}
if (success)
{
//load under water vertex shader
gUnderWaterProgram.mName = "Underwater Shader";
gUnderWaterProgram.mFeatures.calculatesAtmospherics = true;
gUnderWaterProgram.mShaderFiles.clear();
gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB));
gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
gUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER];
gUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
success = gUnderWaterProgram.createShader(NULL, &mWaterUniforms);
}
if (success)
{
//load terrain water shader
gTerrainWaterProgram.mName = "Terrain Water Shader";
gTerrainWaterProgram.mFeatures.calculatesLighting = true;
gTerrainWaterProgram.mFeatures.calculatesAtmospherics = true;
gTerrainWaterProgram.mFeatures.hasAtmospherics = true;
gTerrainWaterProgram.mFeatures.hasWaterFog = true;
gTerrainWaterProgram.mShaderFiles.clear();
gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
gTerrainWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT];
gTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
terrainWaterSuccess = gTerrainWaterProgram.createShader(NULL, &mTerrainUniforms);
}
/// Keep track of water shader levels
if (gWaterProgram.mShaderLevel != mVertexShaderLevel[SHADER_WATER]
|| gUnderWaterProgram.mShaderLevel != mVertexShaderLevel[SHADER_WATER])
{
mVertexShaderLevel[SHADER_WATER] = llmin(gWaterProgram.mShaderLevel, gUnderWaterProgram.mShaderLevel);
}
if (!success)
{
mVertexShaderLevel[SHADER_WATER] = 0;
return FALSE;
}
// if we failed to load the terrain water shaders and we need them (using class2 water),
// then drop down to class1 water.
if (mVertexShaderLevel[SHADER_WATER] > 1 && !terrainWaterSuccess)
{
mVertexShaderLevel[SHADER_WATER]--;
return loadShadersWater();
}
LLWorld::getInstance()->updateWaterObjects();
return TRUE;
}
示例8: unloadShaders
void LLViewerShaderMgr::unloadShaders()
{
gObjectSimpleProgram.unload();
gObjectSimpleWaterProgram.unload();
gObjectFullbrightProgram.unload();
gObjectFullbrightWaterProgram.unload();
gObjectShinyProgram.unload();
gObjectFullbrightShinyProgram.unload();
gObjectShinyWaterProgram.unload();
gWaterProgram.unload();
gUnderWaterProgram.unload();
gTerrainProgram.unload();
gTerrainWaterProgram.unload();
gGlowProgram.unload();
gGlowExtractProgram.unload();
gAvatarProgram.unload();
gAvatarWaterProgram.unload();
gAvatarEyeballProgram.unload();
gAvatarPickProgram.unload();
gHighlightProgram.unload();
gWLSkyProgram.unload();
gWLCloudProgram.unload();
gPostColorFilterProgram.unload();
gPostNightVisionProgram.unload();
gDeferredDiffuseProgram.unload();
mVertexShaderLevel[SHADER_LIGHTING] = 0;
mVertexShaderLevel[SHADER_OBJECT] = 0;
mVertexShaderLevel[SHADER_AVATAR] = 0;
mVertexShaderLevel[SHADER_ENVIRONMENT] = 0;
mVertexShaderLevel[SHADER_WATER] = 0;
mVertexShaderLevel[SHADER_INTERFACE] = 0;
mVertexShaderLevel[SHADER_EFFECT] = 0;
mVertexShaderLevel[SHADER_WINDLIGHT] = 0;
gPipeline.mVertexShadersLoaded = 0;
}
示例9: loadShadersAvatar
BOOL LLViewerShaderMgr::loadShadersAvatar()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_AVATAR] == 0)
{
gAvatarProgram.unload();
gAvatarWaterProgram.unload();
gAvatarEyeballProgram.unload();
gAvatarPickProgram.unload();
return FALSE;
}
if (success)
{
gAvatarProgram.mName = "Avatar Shader";
gAvatarProgram.mFeatures.hasSkinning = true;
gAvatarProgram.mFeatures.calculatesAtmospherics = true;
gAvatarProgram.mFeatures.calculatesLighting = true;
gAvatarProgram.mFeatures.hasGamma = true;
gAvatarProgram.mFeatures.hasAtmospherics = true;
gAvatarProgram.mFeatures.hasLighting = true;
gAvatarProgram.mShaderFiles.clear();
gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB));
gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB));
gAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR];
success = gAvatarProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
if (success)
{
gAvatarWaterProgram.mName = "Avatar Water Shader";
gAvatarWaterProgram.mFeatures.hasSkinning = true;
gAvatarWaterProgram.mFeatures.calculatesAtmospherics = true;
gAvatarWaterProgram.mFeatures.calculatesLighting = true;
gAvatarWaterProgram.mFeatures.hasWaterFog = true;
gAvatarWaterProgram.mFeatures.hasAtmospherics = true;
gAvatarWaterProgram.mFeatures.hasLighting = true;
gAvatarWaterProgram.mShaderFiles.clear();
gAvatarWaterProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB));
gAvatarWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
// Note: no cloth under water:
gAvatarWaterProgram.mShaderLevel = llmin(mVertexShaderLevel[SHADER_AVATAR], 1);
gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
success = gAvatarWaterProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
}
/// Keep track of avatar levels
if (gAvatarProgram.mShaderLevel != mVertexShaderLevel[SHADER_AVATAR])
{
mMaxAvatarShaderLevel = mVertexShaderLevel[SHADER_AVATAR] = gAvatarProgram.mShaderLevel;
}
}
if (success)
{
gAvatarPickProgram.mName = "Avatar Pick Shader";
gAvatarPickProgram.mFeatures.hasSkinning = true;
gAvatarPickProgram.mShaderFiles.clear();
gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB));
gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB));
gAvatarPickProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR];
success = gAvatarPickProgram.createShader(&mAvatarAttribs, &mAvatarUniforms);
}
if (success)
{
gAvatarEyeballProgram.mName = "Avatar Eyeball Program";
gAvatarEyeballProgram.mFeatures.calculatesLighting = true;
gAvatarEyeballProgram.mFeatures.isSpecular = true;
gAvatarEyeballProgram.mFeatures.calculatesAtmospherics = true;
gAvatarEyeballProgram.mFeatures.hasGamma = true;
gAvatarEyeballProgram.mFeatures.hasAtmospherics = true;
gAvatarEyeballProgram.mFeatures.hasLighting = true;
gAvatarEyeballProgram.mShaderFiles.clear();
gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER_ARB));
gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER_ARB));
gAvatarEyeballProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR];
success = gAvatarEyeballProgram.createShader(NULL, NULL);
}
if( !success )
{
mVertexShaderLevel[SHADER_AVATAR] = 0;
mMaxAvatarShaderLevel = 0;
return FALSE;
}
return TRUE;
}
示例10: loadShadersObject
BOOL LLViewerShaderMgr::loadShadersObject()
{
BOOL success = TRUE;
if (mVertexShaderLevel[SHADER_OBJECT] == 0)
{
gObjectShinyProgram.unload();
gObjectFullbrightShinyProgram.unload();
gObjectShinyWaterProgram.unload();
gObjectSimpleProgram.unload();
gObjectSimpleWaterProgram.unload();
gObjectFullbrightProgram.unload();
gObjectFullbrightWaterProgram.unload();
return FALSE;
}
if (success)
{
gObjectSimpleProgram.mName = "Simple Shader";
gObjectSimpleProgram.mFeatures.calculatesLighting = true;
gObjectSimpleProgram.mFeatures.calculatesAtmospherics = true;
gObjectSimpleProgram.mFeatures.hasGamma = true;
gObjectSimpleProgram.mFeatures.hasAtmospherics = true;
gObjectSimpleProgram.mFeatures.hasLighting = true;
gObjectSimpleProgram.mShaderFiles.clear();
gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB));
gObjectSimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
success = gObjectSimpleProgram.createShader(NULL, NULL);
}
if (success)
{
gObjectSimpleWaterProgram.mName = "Simple Water Shader";
gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true;
gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true;
gObjectSimpleWaterProgram.mFeatures.hasLighting = true;
gObjectSimpleWaterProgram.mShaderFiles.clear();
gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB));
gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
gObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
success = gObjectSimpleWaterProgram.createShader(NULL, NULL);
}
if (success)
{
gObjectFullbrightProgram.mName = "Fullbright Shader";
gObjectFullbrightProgram.mFeatures.calculatesAtmospherics = true;
gObjectFullbrightProgram.mFeatures.hasGamma = true;
gObjectFullbrightProgram.mFeatures.hasTransport = true;
gObjectFullbrightProgram.mFeatures.isFullbright = true;
gObjectFullbrightProgram.mShaderFiles.clear();
gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB));
gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB));
gObjectFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
success = gObjectFullbrightProgram.createShader(NULL, NULL);
}
if (success)
{
gObjectFullbrightWaterProgram.mName = "Fullbright Water Shader";
gObjectFullbrightWaterProgram.mFeatures.calculatesAtmospherics = true;
gObjectFullbrightWaterProgram.mFeatures.isFullbright = true;
gObjectFullbrightWaterProgram.mFeatures.hasWaterFog = true;
gObjectFullbrightWaterProgram.mFeatures.hasTransport = true;
gObjectFullbrightWaterProgram.mShaderFiles.clear();
gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB));
gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
gObjectFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
gObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
success = gObjectFullbrightWaterProgram.createShader(NULL, NULL);
}
if (success)
{
gObjectShinyProgram.mName = "Shiny Shader";
gObjectShinyProgram.mFeatures.calculatesAtmospherics = true;
gObjectShinyProgram.mFeatures.calculatesLighting = true;
gObjectShinyProgram.mFeatures.hasGamma = true;
gObjectShinyProgram.mFeatures.hasAtmospherics = true;
gObjectShinyProgram.mFeatures.isShiny = true;
gObjectShinyProgram.mShaderFiles.clear();
gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB));
gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB));
gObjectShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
success = gObjectShinyProgram.createShader(NULL, &mShinyUniforms);
}
if (success)
{
gObjectShinyWaterProgram.mName = "Shiny Water Shader";
gObjectShinyWaterProgram.mFeatures.calculatesAtmospherics = true;
gObjectShinyWaterProgram.mFeatures.calculatesLighting = true;
gObjectShinyWaterProgram.mFeatures.isShiny = true;
gObjectShinyWaterProgram.mFeatures.hasWaterFog = true;
gObjectShinyWaterProgram.mFeatures.hasAtmospherics = true;
gObjectShinyWaterProgram.mShaderFiles.clear();
//.........这里部分代码省略.........