本文整理汇总了C++中LLGLSLShader::enableTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ LLGLSLShader::enableTexture方法的具体用法?C++ LLGLSLShader::enableTexture怎么用?C++ LLGLSLShader::enableTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLGLSLShader
的用法示例。
在下文中一共展示了LLGLSLShader::enableTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shade
void LLDrawPoolWater::shade()
{
if (!deferred_render)
{
gGL.setColorMask(true, true);
}
LLVOSky *voskyp = gSky.mVOSkyp;
if(voskyp == NULL)
{
return;
}
LLGLDisable blend(GL_BLEND);
LLColor3 light_diffuse(0,0,0);
F32 light_exp = 0.0f;
LLVector3 light_dir;
LLColor3 light_color;
if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS)
{
light_dir = gSky.getSunDirection();
light_dir.normVec();
light_color = gSky.getSunDiffuseColor();
if(gSky.mVOSkyp) {
light_diffuse = gSky.mVOSkyp->getSun().getColorCached();
light_diffuse.normVec();
}
light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0);
light_diffuse *= light_exp + 0.25f;
}
else
{
light_dir = gSky.getMoonDirection();
light_dir.normVec();
light_color = gSky.getMoonDiffuseColor();
light_diffuse = gSky.mVOSkyp->getMoon().getColorCached();
light_diffuse.normVec();
light_diffuse *= 0.5f;
light_exp = light_dir * LLVector3(light_dir.mV[0], light_dir.mV[1], 0);
}
light_exp *= light_exp;
light_exp *= light_exp;
light_exp *= light_exp;
light_exp *= light_exp;
light_exp *= 256.f;
light_exp = light_exp > 32.f ? light_exp : 32.f;
LLGLSLShader* shader;
F32 eyedepth = LLViewerCamera::getInstance()->getOrigin().mV[2] - gAgent.getRegion()->getWaterHeight();
if (deferred_render)
{
shader = &gDeferredWaterProgram;
}
else if (eyedepth < 0.f && LLPipeline::sWaterReflections)
{
shader = &gUnderWaterProgram;
}
else
{
shader = &gWaterProgram;
}
if (deferred_render)
{
gPipeline.bindDeferredShader(*shader);
}
else
{
shader->bind();
}
sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f;
S32 reftex = shader->enableTexture(LLViewerShaderMgr::WATER_REFTEX);
if (reftex > -1)
{
gGL.getTexUnit(reftex)->activate();
gGL.getTexUnit(reftex)->bind(&gPipeline.mWaterRef);
gGL.getTexUnit(0)->activate();
}
//bind normal map
S32 bumpTex = shader->enableTexture(LLViewerShaderMgr::BUMP_MAP);
LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
// change mWaterNormp if needed
if (mWaterNormp->getID() != param_mgr->getNormalMapID())
{
mWaterNormp = LLViewerTextureManager::getFetchedTexture(param_mgr->getNormalMapID());
}
mWaterNormp->addTextureStats(1024.f*1024.f);
//.........这里部分代码省略.........