Merge branch 'DRTVWR-546' of https://bitbucket.org/lindenlab/viewer
commit
4a59f6650f
|
|
@ -1312,9 +1312,9 @@
|
|||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>650e836255b6c2ecb93d3f1f7220051c</string>
|
||||
<string>dce3f3c01fddb400cb143c3283fe9259</string>
|
||||
<key>url</key>
|
||||
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55011/511905/glh_linear-0.0.0-common-538981.tar.bz2</string>
|
||||
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/82754/775367/glh_linear-0.0.0-common-560278.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>common</string>
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ if(NON_RELEASE_CRASH_REPORTING)
|
|||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1")
|
||||
endif()
|
||||
|
||||
# Don't bother with a MinSizeRel build.
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
# Don't bother with MinSizeRel or Debug builds.
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
|
||||
|
|
@ -82,17 +82,23 @@ if (WINDOWS)
|
|||
# CP changed to only append the flag for 32bit builds - on 64bit builds,
|
||||
# locally at least, the build output is spammed with 1000s of 'D9002'
|
||||
# warnings about this switch being ignored.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
# <FS:ND> Remove this, it's no option to cl.exe and causes a massive amount of warnings.
|
||||
#if( ADDRESS_SIZE EQUAL 32 )
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64")
|
||||
#endif()
|
||||
|
||||
# Preserve first-pass-through versions (ie no FORCE overwrite). Prevents recursive addition of /Zo (04/2021)
|
||||
set(OG_CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} CACHE STRING "OG_CXX_FLAGS_RELEASE")
|
||||
set(OG_CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} CACHE STRING "OG_CXX_FLAGS_RELWITHDEBINFO")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
|
||||
"${OG_CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
|
||||
CACHE STRING "C++ compiler release-with-debug options" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
|
||||
"${OG_CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
|
||||
CACHE STRING "C++ compiler release options" FORCE)
|
||||
|
||||
# zlib has assembly-language object files incompatible with SAFESEH
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099")
|
||||
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ bool LLGLManager::initGL()
|
|||
glGetIntegerv(GL_NUM_EXTENSIONS, &count);
|
||||
for (GLint i = 0; i < count; ++i)
|
||||
{
|
||||
std::string ext((const char*) glGetStringi(GL_EXTENSIONS, i));
|
||||
std::string ext = ll_safe_string((const char*) glGetStringi(GL_EXTENSIONS, i));
|
||||
str << ext << " ";
|
||||
LL_DEBUGS("GLExtensions") << ext << LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1444,7 +1444,11 @@ GLint LLGLSLShader::getUniformLocation(U32 index)
|
|||
GLint ret = -1;
|
||||
if (mProgramObject)
|
||||
{
|
||||
llassert(index < mUniform.size());
|
||||
if (index >= mUniform.size())
|
||||
{
|
||||
LL_WARNS_ONCE("Shader") << "Uniform index " << index << " out of bounds " << (S32)mUniform.size() << LL_ENDL;
|
||||
return ret;
|
||||
}
|
||||
return mUniform[index];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,215 +0,0 @@
|
|||
/*
|
||||
* glh_extensions.h
|
||||
* $LicenseInfo:firstyear=2006&license=mit$ (mit used here to satisfy validity checker)
|
||||
* Copyright (C) 2006, NVIDIA
|
||||
* From nVidia Corporation, downloaded 2006-12-18 from:
|
||||
* http://developer.nvidia.com/attach/8196
|
||||
* ("NVParse Library with Source (.zip) (2390 KB)")
|
||||
*
|
||||
* License (quoted from license_info.txt in aforementioned file):
|
||||
* "The files bison.exe, bison.simple, and flex.exe are covered by
|
||||
* the GPL. All other files in this distribution can be used however
|
||||
* you want."
|
||||
* $/LicenseInfo$
|
||||
|
||||
*/
|
||||
|
||||
#ifndef GLH_EXTENSIONS
|
||||
#define GLH_EXTENSIONS
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLE__
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "GL/wglext.h"
|
||||
#endif
|
||||
|
||||
#define CHECK_MEMORY(ptr) \
|
||||
if (NULL == ptr) { \
|
||||
printf("Error allocating memory in file %s, line %d\n", __FILE__, __LINE__); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
#ifdef GLH_EXT_SINGLE_FILE
|
||||
# define GLH_EXTENSIONS_SINGLE_FILE // have to do this because glh_genext.h unsets GLH_EXT_SINGLE_FILE
|
||||
#endif
|
||||
|
||||
#include "glh_genext.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef GLH_EXTENSIONS_SINGLE_FILE
|
||||
|
||||
class GLHExts
|
||||
{
|
||||
public:
|
||||
GLHExts()
|
||||
{
|
||||
mSysExts = NULL;
|
||||
// mUnsupportedExts = NULL;
|
||||
}
|
||||
~GLHExts()
|
||||
{
|
||||
if (mSysExts)
|
||||
{
|
||||
free(mSysExts);
|
||||
}
|
||||
// if (mUnsupportedExts)
|
||||
// {
|
||||
// free(mUnsupportedExts);
|
||||
// }
|
||||
}
|
||||
char *mSysExts;
|
||||
// char *mUnsupportedExts;
|
||||
};
|
||||
|
||||
GLHExts gGLHExts;
|
||||
|
||||
static int ExtensionExists(const char* extName, const char* sysExts)
|
||||
{
|
||||
char *padExtName = (char*)malloc(strlen(extName) + 2);
|
||||
strcat(strcpy(padExtName, extName), " ");
|
||||
|
||||
if (0 == strcmp(extName, "GL_VERSION_1_2")) {
|
||||
const char *version = (const char*)glGetString(GL_VERSION);
|
||||
if (strstr(version, "1.0") == version || strstr(version, "1.1") == version) {
|
||||
// <FS> Memleak fix by Drake Arconis
|
||||
free(padExtName);
|
||||
return FALSE;
|
||||
} else {
|
||||
// <FS> Memleak fix by Drake Arconis
|
||||
free(padExtName);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (strstr(sysExts, padExtName)) {
|
||||
free(padExtName);
|
||||
return TRUE;
|
||||
} else {
|
||||
free(padExtName);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static const char* EatWhiteSpace(const char *str)
|
||||
{
|
||||
for (; *str && (' ' == *str || '\t' == *str || '\n' == *str); str++);
|
||||
return str;
|
||||
}
|
||||
|
||||
static const char* EatNonWhiteSpace(const char *str)
|
||||
{
|
||||
for (; *str && (' ' != *str && '\t' != *str && '\n' != *str); str++);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
int glh_init_extensions(const char *origReqExts)
|
||||
{
|
||||
// Length of requested extensions string
|
||||
//unsigned reqExtsLen;
|
||||
char *reqExts;
|
||||
// Ptr for individual extensions within reqExts
|
||||
char *reqExt;
|
||||
int success = TRUE;
|
||||
|
||||
// build space-padded extension string
|
||||
if (NULL == gGLHExts.mSysExts) {
|
||||
const char *extensions = (const char*)glGetString(GL_EXTENSIONS);
|
||||
int sysExtsLen = (int)strlen(extensions);
|
||||
const char *winsys_extensions = 0;
|
||||
int winsysExtsLen = 0;
|
||||
#ifdef _WIN32
|
||||
{
|
||||
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0;
|
||||
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
|
||||
if(wglGetExtensionsStringARB)
|
||||
{
|
||||
winsys_extensions = wglGetExtensionsStringARB(wglGetCurrentDC());
|
||||
winsysExtsLen = (S32)strlen(winsys_extensions);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Add 2 bytes, one for padding space, one for terminating NULL
|
||||
gGLHExts.mSysExts = (char*)malloc(sysExtsLen + winsysExtsLen + 3);
|
||||
CHECK_MEMORY(gGLHExts.mSysExts);
|
||||
strcpy(gGLHExts.mSysExts, extensions);
|
||||
gGLHExts.mSysExts[sysExtsLen] = ' ';
|
||||
gGLHExts.mSysExts[sysExtsLen + 1] = 0;
|
||||
if (winsysExtsLen)
|
||||
{
|
||||
strcat(gGLHExts.mSysExts, winsys_extensions);
|
||||
}
|
||||
gGLHExts.mSysExts[sysExtsLen + 1 + winsysExtsLen] = ' ';
|
||||
gGLHExts.mSysExts[sysExtsLen + 1 + winsysExtsLen + 1] = 0;
|
||||
}
|
||||
|
||||
if (NULL == origReqExts)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
reqExts = strdup(origReqExts);
|
||||
/*
|
||||
reqExtsLen = (S32)strlen(reqExts);
|
||||
if (NULL == gGLHExts.mUnsupportedExts)
|
||||
{
|
||||
gGLHExts.mUnsupportedExts = (char*)malloc(reqExtsLen + 1);
|
||||
}
|
||||
else if (reqExtsLen > strlen(gGLHExts.mUnsupportedExts))
|
||||
{
|
||||
gGLHExts.mUnsupportedExts = (char*)realloc(gGLHExts.mUnsupportedExts, reqExtsLen + 1);
|
||||
}
|
||||
CHECK_MEMORY(gGLHExts.mUnsupportedExts);
|
||||
*gGLHExts.mUnsupportedExts = 0;
|
||||
*/
|
||||
|
||||
// Parse requested extension list
|
||||
for (reqExt = reqExts;
|
||||
(reqExt = (char*)EatWhiteSpace(reqExt)) && *reqExt;
|
||||
reqExt = (char*)EatNonWhiteSpace(reqExt))
|
||||
{
|
||||
char *extEnd = (char*)EatNonWhiteSpace(reqExt);
|
||||
char saveChar = *extEnd;
|
||||
*extEnd = (char)0;
|
||||
|
||||
if (!ExtensionExists(reqExt, gGLHExts.mSysExts) ||
|
||||
!glh_init_extension(reqExt)) {
|
||||
/*
|
||||
// add reqExt to end of unsupportedExts
|
||||
strcat(gGLHExts.mUnsupportedExts, reqExt);
|
||||
strcat(gGLHExts.mUnsupportedExts, " ");
|
||||
*/
|
||||
success = FALSE;
|
||||
}
|
||||
*extEnd = saveChar;
|
||||
}
|
||||
free(reqExts);
|
||||
return success;
|
||||
}
|
||||
|
||||
const char* glh_get_unsupported_extensions()
|
||||
{
|
||||
return "";
|
||||
// return (const char*)gGLHExts.mUnsupportedExts;
|
||||
}
|
||||
|
||||
#else
|
||||
int glh_init_extensions(const char *origReqExts);
|
||||
const char* glh_get_unsupported_extensions();
|
||||
#endif /* GLH_EXT_SINGLE_FILE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GLH_EXTENSIONS */
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -86,6 +86,14 @@ float getAmbientClamp();
|
|||
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance)
|
||||
{
|
||||
// SL-14895 inverted attenuation work-around
|
||||
// This routine is tweaked to match deferred lighting, but previously used an inverted la value. To reconstruct
|
||||
// that previous value now that the inversion is corrected, we reverse the calculations in LLPipeline::setupHWLights()
|
||||
// to recover the `adjusted_radius` value previously being sent as la.
|
||||
float falloff_factor = (12.0 * fa) - 9.0;
|
||||
float inverted_la = falloff_factor / la;
|
||||
// Yes, it makes me want to cry as well. DJH
|
||||
|
||||
vec3 col = vec3(0);
|
||||
|
||||
//get light vector
|
||||
|
|
@ -95,7 +103,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
|
|||
float dist = length(lv);
|
||||
float da = 1.0;
|
||||
|
||||
/*if (dist > la)
|
||||
/*if (dist > inverted_la)
|
||||
{
|
||||
return col;
|
||||
}
|
||||
|
|
@ -113,9 +121,9 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
|
|||
return col;
|
||||
}*/
|
||||
|
||||
if (dist > 0.0 && la > 0.0)
|
||||
if (dist > 0.0 && inverted_la > 0.0)
|
||||
{
|
||||
dist /= la;
|
||||
dist /= inverted_la;
|
||||
|
||||
//normalize light vector
|
||||
lv = normalize(lv);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,14 @@ float getAmbientClamp();
|
|||
|
||||
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance)
|
||||
{
|
||||
// SL-14895 inverted attenuation work-around
|
||||
// This routine is tweaked to match deferred lighting, but previously used an inverted la value. To reconstruct
|
||||
// that previous value now that the inversion is corrected, we reverse the calculations in LLPipeline::setupHWLights()
|
||||
// to recover the `adjusted_radius` value previously being sent as la.
|
||||
float falloff_factor = (12.0 * fa) - 9.0;
|
||||
float inverted_la = falloff_factor / la;
|
||||
// Yes, it makes me want to cry as well. DJH
|
||||
|
||||
vec3 col = vec3(0);
|
||||
|
||||
//get light vector
|
||||
|
|
@ -100,9 +108,9 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
|
|||
float dist = length(lv);
|
||||
float da = 1.0;
|
||||
|
||||
dist /= la;
|
||||
dist /= inverted_la;
|
||||
|
||||
if (dist > 0.0 && la > 0.0)
|
||||
if (dist > 0.0 && inverted_la > 0.0)
|
||||
{
|
||||
//normalize light vector
|
||||
lv = normalize(lv);
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ static void settings_modify()
|
|||
// [/RLVa:KB]
|
||||
LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater");
|
||||
LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
|
||||
LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred");
|
||||
LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred");
|
||||
LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
|
||||
LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4]
|
||||
gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,14 @@ void LLDrawPoolWater::endPostDeferredPass(S32 pass)
|
|||
void LLDrawPoolWater::renderDeferred(S32 pass)
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_WATER);
|
||||
|
||||
if (!LLPipeline::sRenderTransparentWater)
|
||||
{
|
||||
// Will render opaque water without use of ALM
|
||||
render(pass);
|
||||
return;
|
||||
}
|
||||
|
||||
deferred_render = TRUE;
|
||||
shade();
|
||||
deferred_render = FALSE;
|
||||
|
|
@ -347,6 +355,11 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
|
|||
LL_PROFILE_ZONE_SCOPED;
|
||||
LLVOSky *voskyp = gSky.mVOSkyp;
|
||||
|
||||
if (voskyp == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLGLSLShader* shader = NULL;
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2092,11 +2092,9 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
|
||||
////Deferred/SSAO/Shadows
|
||||
//BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
|
||||
//BOOL transparent_water = LLFeatureManager::getInstance()->isFeatureAvailable("RenderTransparentWater") && gSavedSettings.getBOOL("RenderTransparentWater");
|
||||
//BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
|
||||
//BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
|
||||
// bumpshiny &&
|
||||
// transparent_water &&
|
||||
// shaders &&
|
||||
// gGLManager.mHasFramebufferObject &&
|
||||
// gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
|
|
@ -2179,9 +2177,6 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
|
||||
bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE);
|
||||
|
||||
// Transparent Water
|
||||
LLCheckBoxCtrl* transparent_water_ctrl = getChild<LLCheckBoxCtrl>("TransparentWater");
|
||||
|
||||
// <FS:Ansariel> Does not exist
|
||||
//LLCheckBoxCtrl* ctrl_enhanced_skel = getChild<LLCheckBoxCtrl>("AvatarEnhancedSkeleton");
|
||||
//bool enhanced_skel_enabled = gSavedSettings.getBOOL("IncludeEnhancedSkeleton");
|
||||
|
|
@ -2236,7 +2231,6 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
|
||||
BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
|
||||
((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) &&
|
||||
((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) &&
|
||||
gGLManager.mHasFramebufferObject &&
|
||||
gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
(ctrl_wind_light->get()) ? TRUE : FALSE;
|
||||
|
|
|
|||
|
|
@ -275,7 +275,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
|
|||
|
||||
bool handleRenderTransparentWaterChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLRenderTarget::sUseFBO = newvalue.asBoolean();
|
||||
if (gPipeline.isInit())
|
||||
{
|
||||
gPipeline.updateRenderTransparentWater();
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ void LLViewerShaderMgr::setShaders()
|
|||
initAttribsAndUniforms();
|
||||
gPipeline.releaseGLBuffers();
|
||||
|
||||
LLPipeline::sWaterReflections = gGLManager.mHasCubeMap;
|
||||
LLPipeline::sWaterReflections = gGLManager.mHasCubeMap && LLPipeline::sRenderTransparentWater;
|
||||
LLPipeline::sRenderGlow = gSavedSettings.getBOOL("RenderGlow");
|
||||
LLPipeline::updateRenderDeferred();
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,9 @@ const F32 MIN_HOVER_Z = -2.0f;
|
|||
const F32 MIN_ATTACHMENT_COMPLEXITY = 0.f;
|
||||
const F32 DEFAULT_MAX_ATTACHMENT_COMPLEXITY = 1.0e6f;
|
||||
|
||||
const F32 FIRST_APPEARANCE_CLOUD_MIN_DELAY = 3.f; // seconds
|
||||
const F32 FIRST_APPEARANCE_CLOUD_MAX_DELAY = 45.f;
|
||||
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -697,6 +700,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
mVisuallyMuteSetting(AV_RENDER_NORMALLY),
|
||||
mMutedAVColor(LLColor4::white /* used for "uninitialize" */),
|
||||
mFirstFullyVisible(TRUE),
|
||||
mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY),
|
||||
mFullyLoaded(FALSE),
|
||||
mPreviousFullyLoaded(FALSE),
|
||||
mFullyLoadedInitialized(FALSE),
|
||||
|
|
@ -774,7 +778,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
|
||||
mCurrentGesticulationLevel = 0;
|
||||
|
||||
|
||||
mFirstSeenTimer.reset();
|
||||
mRuthTimer.reset();
|
||||
mRuthDebugTimer.reset();
|
||||
mDebugExistenceTimer.reset();
|
||||
|
|
@ -9072,16 +9076,35 @@ void LLVOAvatar::updateRuthTimer(bool loading)
|
|||
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
|
||||
{
|
||||
// We wait a little bit before giving the 'all clear', to let things to
|
||||
// settle down (models to snap into place, textures to get first packets)
|
||||
// settle down (models to snap into place, textures to get first packets).
|
||||
// And if viewer isn't aware of some parts yet, this gives them a chance
|
||||
// to arrive.
|
||||
const F32 LOADED_DELAY = 1.f;
|
||||
const F32 FIRST_USE_DELAY = 3.f;
|
||||
|
||||
if (loading)
|
||||
mFullyLoadedTimer.reset();
|
||||
if (loading)
|
||||
{
|
||||
mFullyLoadedTimer.reset();
|
||||
}
|
||||
|
||||
if (mFirstFullyVisible)
|
||||
{
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY);
|
||||
if (!isSelf() && loading)
|
||||
{
|
||||
// Note that textures can causes 60s delay on thier own
|
||||
// so this delay might end up on top of textures' delay
|
||||
mFirstUseDelaySeconds = llclamp(
|
||||
mFirstSeenTimer.getElapsedTimeF32(),
|
||||
FIRST_APPEARANCE_CLOUD_MIN_DELAY,
|
||||
FIRST_APPEARANCE_CLOUD_MAX_DELAY);
|
||||
|
||||
if (shouldImpostor())
|
||||
{
|
||||
// Impostors are less of a priority,
|
||||
// let them stay cloud longer
|
||||
mFirstUseDelaySeconds *= 1.25;
|
||||
}
|
||||
}
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -408,6 +408,9 @@ protected:
|
|||
|
||||
private:
|
||||
BOOL mFirstFullyVisible;
|
||||
F32 mFirstUseDelaySeconds;
|
||||
LLFrameTimer mFirstSeenTimer;
|
||||
|
||||
BOOL mFullyLoaded;
|
||||
BOOL mPreviousFullyLoaded;
|
||||
BOOL mFullyLoadedInitialized;
|
||||
|
|
|
|||
|
|
@ -1167,7 +1167,6 @@ void LLPipeline::updateRenderDeferred()
|
|||
RenderDeferred &&
|
||||
LLRenderTarget::sUseFBO &&
|
||||
LLPipeline::sRenderBump &&
|
||||
LLPipeline::sRenderTransparentWater &&
|
||||
RenderAvatarVP &&
|
||||
WindLightUseAtmosShaders &&
|
||||
(bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
|
||||
|
|
@ -6564,21 +6563,19 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
continue;
|
||||
}
|
||||
|
||||
LLVector3 light_pos(light->getRenderPosition());
|
||||
LLVector4 light_pos_gl(light_pos, 1.0f);
|
||||
|
||||
F32 light_radius = llmax(light->getLightRadius(), 0.001f);
|
||||
F32 size = light_radius * (sRenderDeferred ? 1.5f : 1.0f);
|
||||
LLVector3 light_pos(light->getRenderPosition());
|
||||
LLVector4 light_pos_gl(light_pos, 1.0f);
|
||||
|
||||
if (size <= 0.001f)
|
||||
F32 adjusted_radius = light->getLightRadius() * (sRenderDeferred ? 1.5f : 1.0f);
|
||||
if (adjusted_radius <= 0.001f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
F32 x = (3.f * (1.f + (light->getLightFalloff() * 2.0f))); // why this magic? probably trying to match a historic behavior.
|
||||
F32 linatten = x / (light_radius); // % of brightness at radius
|
||||
F32 x = (3.f * (1.f + (light->getLightFalloff() * 2.0f))); // why this magic? probably trying to match a historic behavior.
|
||||
F32 linatten = x / adjusted_radius; // % of brightness at radius
|
||||
|
||||
mHWLightColors[cur_light] = light_color;
|
||||
mHWLightColors[cur_light] = light_color;
|
||||
LLLightState* light_state = gGL.getLight(cur_light);
|
||||
|
||||
light_state->setPosition(light_pos_gl);
|
||||
|
|
@ -6587,7 +6584,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
|
|||
light_state->setConstantAttenuation(0.f);
|
||||
if (sRenderDeferred)
|
||||
{
|
||||
light_state->setLinearAttenuation(size);
|
||||
light_state->setLinearAttenuation(linatten);
|
||||
light_state->setQuadraticAttenuation(light->getLightFalloff(DEFERRED_LIGHT_FALLOFF) + 1.f); // get falloff to match for forward deferred rendering lights
|
||||
}
|
||||
else
|
||||
|
|
@ -9547,7 +9544,13 @@ inline float sgn(float a)
|
|||
void LLPipeline::generateWaterReflection(LLCamera& camera_in)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
|
||||
|
||||
if (!assertInitialized())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (LLPipeline::sWaterReflections && LLDrawPoolWater::sNeedsReflectionUpdate)
|
||||
{
|
||||
bool skip_avatar_update = false;
|
||||
if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
|
||||
|
|
@ -9767,19 +9770,13 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
|
|||
|
||||
//clip out geometry on the same side of water as the camera w/ enough margin to not include the water geo itself,
|
||||
// but not so much as to clip out parts of avatars that should be seen under the water in the distortion map
|
||||
LLPlane plane(-pnorm, water_dist);
|
||||
LLPlane plane(-pnorm, camera_is_underwater ? -water_height : water_dist);
|
||||
LLGLUserClipPlane clip_plane(plane, saved_modelview, saved_projection);
|
||||
|
||||
gGL.setColorMask(true, true);
|
||||
mWaterDis.clear();
|
||||
gGL.setColorMask(true, false);
|
||||
|
||||
// ignore clip plane if we're underwater and viewing distortion map of objects above waterline
|
||||
if (camera_is_underwater)
|
||||
{
|
||||
clip_plane.disable();
|
||||
}
|
||||
|
||||
if (reflection_detail >= WATER_REFLECT_NONE_WATER_TRANSPARENT)
|
||||
{
|
||||
updateCull(camera, mRefractedObjects, water_clip, &plane);
|
||||
|
|
@ -9832,6 +9829,29 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
|
|||
|
||||
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Initial sky pass is still needed even if water reflection is not rendering
|
||||
bool camera_is_underwater = LLViewerCamera::getInstance()->cameraUnderWater();
|
||||
if (!camera_is_underwater)
|
||||
{
|
||||
gPipeline.pushRenderTypeMask();
|
||||
{
|
||||
gPipeline.andRenderTypeMask(
|
||||
LLPipeline::RENDER_TYPE_SKY,
|
||||
LLPipeline::RENDER_TYPE_WL_SKY,
|
||||
LLPipeline::END_RENDER_TYPES);
|
||||
|
||||
LLCamera camera = camera_in;
|
||||
camera.setFar(camera_in.getFar() * 0.75f);
|
||||
|
||||
updateCull(camera, mSky);
|
||||
stateSort(camera, mSky);
|
||||
renderGeom(camera, TRUE);
|
||||
}
|
||||
gPipeline.popRenderTypeMask();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glh::matrix4f look(const LLVector3 pos, const LLVector3 dir, const LLVector3 up)
|
||||
|
|
|
|||
|
|
@ -1039,11 +1039,9 @@ void FloaterQuickPrefs::refreshSettings()
|
|||
sky_default_button->setEnabled(TRUE);
|
||||
|
||||
BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
|
||||
BOOL transparent_water = LLFeatureManager::getInstance()->isFeatureAvailable("RenderTransparentWater") && gSavedSettings.getBOOL("RenderTransparentWater");
|
||||
BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
|
||||
BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
|
||||
bumpshiny &&
|
||||
transparent_water &&
|
||||
shaders &&
|
||||
gGLManager.mHasFramebufferObject &&
|
||||
gSavedSettings.getBOOL("RenderAvatarVP") &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue