本文整理汇总了C++中LLGLSLShader::uniform2fv方法的典型用法代码示例。如果您正苦于以下问题:C++ LLGLSLShader::uniform2fv方法的具体用法?C++ LLGLSLShader::uniform2fv怎么用?C++ LLGLSLShader::uniform2fv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLGLSLShader
的用法示例。
在下文中一共展示了LLGLSLShader::uniform2fv方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bind
QuadType bind()
{
if(!isEnabled())
{
return QUAD_NONE;
}
glh::matrix4f inv_proj(gGLModelView);
inv_proj.mult_left(gGLProjection);
inv_proj = inv_proj.inverse();
glh::matrix4f prev_proj(gGLPreviousModelView);
prev_proj.mult_left(gGLProjection);
LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions();
gPostMotionBlurProgram.bind();
gPostMotionBlurProgram.uniformMatrix4fv("prev_proj", 1, GL_FALSE, prev_proj.m);
gPostMotionBlurProgram.uniformMatrix4fv("inv_proj", 1, GL_FALSE, inv_proj.m);
gPostMotionBlurProgram.uniform2fv("screen_res", 1, screen_rect.mV);
gPostMotionBlurProgram.uniform1i("blur_strength", mStrength);
return QUAD_NORMAL;
}
示例2: shade
//.........这里部分代码省略.........
{
mWaterNormp->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
}
else
{
mWaterNormp->setFilteringOption(LLTexUnit::TFO_POINT);
}
S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
if (screentex > -1)
{
shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
shader->uniform1f(LLViewerShaderMgr::WATER_FOGDENSITY,
param_mgr->getFogDensity());
gPipeline.mWaterDis.bindTexture(0, screentex);
}
stop_glerror();
gGL.getTexUnit(screentex)->bind(&gPipeline.mWaterDis);
if (mVertexShaderLevel == 1)
{
sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue;
shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
}
F32 screenRes[] =
{
1.f/gGLViewport[2],
1.f/gGLViewport[3]
};
shader->uniform2fv("screenRes", 1, screenRes);
stop_glerror();
S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
stop_glerror();
light_dir.normVec();
sLightDir = light_dir;
light_diffuse *= 6.f;
//shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix);
shader->uniform1f(LLViewerShaderMgr::WATER_WATERHEIGHT, eyedepth);
shader->uniform1f(LLViewerShaderMgr::WATER_TIME, sTime);
shader->uniform3fv(LLViewerShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV);
shader->uniform3fv(LLViewerShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV);
shader->uniform1f(LLViewerShaderMgr::WATER_SPECULAR_EXP, light_exp);
shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV);
shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV);
shader->uniform3fv(LLViewerShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV);
shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV);
shader->uniform1f("fresnelScale", param_mgr->getFresnelScale());
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);