本文整理汇总了C++中LLGLSLShader::unbind方法的典型用法代码示例。如果您正苦于以下问题:C++ LLGLSLShader::unbind方法的具体用法?C++ LLGLSLShader::unbind怎么用?C++ LLGLSLShader::unbind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLGLSLShader
的用法示例。
在下文中一共展示了LLGLSLShader::unbind方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void LLDrawPoolGlow::render(S32 pass)
{
LLFastTimer t(FTM_RENDER_GLOW);
LLGLEnable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST);
gGL.flush();
/// Get rid of z-fighting with non-glow pass.
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -1.0f);
gGL.setSceneBlendType(LLRender::BT_ADD);
U32 shader_level = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT);
//should never get here without basic shaders enabled
llassert(shader_level > 0);
LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram;
shader->bind();
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
gGL.setColorMask(false, true);
pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
gGL.setColorMask(true, false);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
if (shader_level > 0 && fullbright_shader)
{
shader->unbind();
}
}
示例2: applyColorFilterShader
void LLPostProcess::applyColorFilterShader(void)
{
if(gPostColorFilterProgram.mProgramObject == 0)
return;
gPostColorFilterProgram.bind();
gGL.getTexUnit(0)->bind(mSceneRenderTexture);
gPostColorFilterProgram.uniform1f("gamma", tweaks.getGamma());
gPostColorFilterProgram.uniform1f("brightness", tweaks.getBrightness());
gPostColorFilterProgram.uniform1f("contrast", tweaks.getContrast());
float baseI = (tweaks.getContrastBaseR() + tweaks.getContrastBaseG() + tweaks.getContrastBaseB()) / 3.0f;
baseI = tweaks.getContrastBaseIntensity() / ((baseI < 0.001f) ? 0.001f : baseI);
float baseR = tweaks.getContrastBaseR() * baseI;
float baseG = tweaks.getContrastBaseG() * baseI;
float baseB = tweaks.getContrastBaseB() * baseI;
gPostColorFilterProgram.uniform3fv("contrastBase", 1, LLVector3(baseR, baseG, baseB).mV);
gPostColorFilterProgram.uniform1f("saturation", tweaks.getSaturation());
gPostColorFilterProgram.uniform3fv("lumWeights", 1, LLVector3(LUMINANCE_R, LUMINANCE_G, LUMINANCE_B).mV);
/// Draw a screen space quad
drawOrthoQuad(QUAD_NORMAL);
gPostColorFilterProgram.unbind();
}
示例3: applyNightVisionShader
void LLPostProcess::applyNightVisionShader(void)
{
if(gPostNightVisionProgram.mProgramObject == 0)
return;
gPostNightVisionProgram.bind();
gGL.getTexUnit(0)->bind(mSceneRenderTexture);
gGL.getTexUnit(1)->bind(mNoiseTexture);
gPostNightVisionProgram.uniform1f("brightMult", tweaks.getBrightMult());
gPostNightVisionProgram.uniform1f("noiseStrength", tweaks.getNoiseStrength());
mNoiseTextureScale = 0.001f + ((100.f - tweaks.getNoiseSize()) / 100.f);
mNoiseTextureScale *= (mScreenHeight / NOISE_SIZE);
/// Draw a screen space quad
drawOrthoQuad(QUAD_NOISE);
gPostNightVisionProgram.unbind();
}
示例4: renderSkyHaze
void LLDrawPoolWLSky::renderSkyHaze(F32 camHeightLocal) const
{
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY))
{
LLGLSLShader* shader =
LLPipeline::sUnderWaterRender ?
&gObjectSimpleWaterProgram :
&gWLSkyProgram;
LLGLDisable blend(GL_BLEND);
shader->bind();
/// Render the skydome
renderDome(camHeightLocal, shader);
shader->unbind();
}
}
示例5: applyGaussBlurShader
void LLPostProcess::applyGaussBlurShader(void)
{
int pass_count = tweaks.getGaussBlurPasses();
if(!pass_count || gPostGaussianBlurProgram.mProgramObject == 0)
return;
gPostGaussianBlurProgram.bind();
gGL.getTexUnit(0)->bind(mSceneRenderTexture);
GLint horiz_pass = gPostGaussianBlurProgram.getUniformLocation("horizontalPass");
for(int i = 0;i<pass_count;++i)
{
for(int j = 0;j<2;++j)
{
if(i || j)
copyFrameBuffer();
glUniform1iARB(horiz_pass, j);
drawOrthoQuad(QUAD_NORMAL);
}
}
gPostGaussianBlurProgram.unbind();
}
示例6: renderSkyClouds
void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
{
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WL_CLOUDS))
{
LLGLSLShader* shader =
LLPipeline::sUnderWaterRender ?
&gObjectSimpleWaterProgram :
&gWLCloudProgram;
LLGLEnable blend(GL_BLEND);
LLGLSBlendFunc blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
gGL.getTexUnit(0)->bind(sCloudNoiseTexture);
shader->bind();
/// Render the skydome
renderDome(camHeightLocal, shader);
shader->unbind();
}
}
示例7: unbind
void unbind()
{
gPostMotionBlurProgram.unbind();
}
示例8: shade
//.........这里部分代码省略.........
shader->uniform1f("fresnelOffset", param_mgr->getFresnelOffset());
shader->uniform1f("blurMultiplier", param_mgr->getBlurMultiplier());
F32 sunAngle = llmax(0.f, light_dir.mV[2]);
F32 scaledAngle = 1.f - sunAngle;
shader->uniform1f("sunAngle", sunAngle);
shader->uniform1f("scaledAngle", scaledAngle);
shader->uniform1f("sunAngle2", 0.1f + 0.2f*sunAngle);
LLColor4 water_color;
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
F32 up_dot = camera_up * LLVector3::z_axis;
if (LLViewerCamera::getInstance()->cameraUnderWater())
{
water_color.setVec(1.f, 1.f, 1.f, 0.4f);
shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow());
}
else
{
water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot));
shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove());
}
if (water_color.mV[3] > 0.9f)
{
water_color.mV[3] = 0.9f;
}
glColor4fv(water_color.mV);
{
LLGLDisable cullface(GL_CULL_FACE);
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
if (voskyp->isReflFace(face))
{
continue;
}
LLVOWater* water = (LLVOWater*) face->getViewerObject();
gGL.getTexUnit(diffTex)->bind(face->getTexture());
sNeedsReflectionUpdate = TRUE;
if (water->getUseTexture())
{
sNeedsDistortionUpdate = TRUE;
face->renderIndexed();
}
else
{ //smash background faces to far clip plane
if (water->getIsEdgePatch())
{
if (deferred_render)
{
face->renderIndexed();
}
else
{
LLGLClampToFarClip far_clip(glh_get_current_projection());
face->renderIndexed();
}
}
else
{
sNeedsDistortionUpdate = TRUE;
face->renderIndexed();
}
}
}
}
shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
shader->disableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
shader->disableTexture(LLViewerShaderMgr::BUMP_MAP);
shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
shader->disableTexture(LLViewerShaderMgr::WATER_REFTEX);
shader->disableTexture(LLViewerShaderMgr::WATER_SCREENDEPTH);
if (deferred_render)
{
gPipeline.unbindDeferredShader(*shader);
}
else
{
shader->unbind();
}
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
if (!deferred_render)
{
gGL.setColorMask(true, false);
}
}