Merged in SL-17274_view_dir (pull request #1029)
SL-17274: Add view_dir uniform Approved-by: Dave Parksmeow-7.2.2
commit
d995ac67ae
|
|
@ -1218,6 +1218,7 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||
mReservedUniforms.push_back("minimum_alpha");
|
||||
mReservedUniforms.push_back("emissive_brightness");
|
||||
|
||||
// Deferred
|
||||
mReservedUniforms.push_back("shadow_matrix");
|
||||
mReservedUniforms.push_back("env_mat");
|
||||
mReservedUniforms.push_back("shadow_clip");
|
||||
|
|
@ -1242,8 +1243,9 @@ void LLShaderMgr::initAttribsAndUniforms()
|
|||
mReservedUniforms.push_back("depth_cutoff");
|
||||
mReservedUniforms.push_back("norm_cutoff");
|
||||
mReservedUniforms.push_back("shadow_target_width");
|
||||
mReservedUniforms.push_back("view_dir"); // DEFERRED_VIEW_DIR
|
||||
|
||||
llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH+1);
|
||||
llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_VIEW_DIR+1);
|
||||
|
||||
mReservedUniforms.push_back("tc_scale");
|
||||
mReservedUniforms.push_back("rcp_screen_res");
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public:
|
|||
DEFERRED_DEPTH_CUTOFF, // "depth_cutoff"
|
||||
DEFERRED_NORM_CUTOFF, // "norm_cutoff"
|
||||
DEFERRED_SHADOW_TARGET_WIDTH, // "shadow_target_width"
|
||||
DEFERRED_VIEW_DIR, // "view_dir"
|
||||
|
||||
FXAA_TC_SCALE, // "tc_scale"
|
||||
FXAA_RCP_SCREEN_RES, // "rcp_screen_res"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file class2/deferred/softenLightF.glsl
|
||||
* @file class3/deferred/softenLightF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
|
|
@ -85,6 +85,8 @@ vec3 srgb_to_linear(vec3 c);
|
|||
vec4 applyWaterFogView(vec3 pos, vec4 color);
|
||||
#endif
|
||||
|
||||
uniform vec3 view_dir; // PBR
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 tc = vary_fragcoord.xy;
|
||||
|
|
|
|||
|
|
@ -8596,6 +8596,12 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target)
|
|||
soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0);
|
||||
soften_shader.uniform4fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV);
|
||||
|
||||
if(LLPipeline::sRenderPBR)
|
||||
{
|
||||
LLVector3 cameraAtAxis = LLViewerCamera::getInstance()->getAtAxis();
|
||||
soften_shader.uniform3fv(LLShaderMgr::DEFERRED_VIEW_DIR, 1, cameraAtAxis.mV);
|
||||
}
|
||||
|
||||
{
|
||||
LLGLDepthTest depth(GL_FALSE);
|
||||
LLGLDisable blend(GL_BLEND);
|
||||
|
|
|
|||
Loading…
Reference in New Issue