diff options
Diffstat (limited to 'indra')
27 files changed, 283 insertions, 361 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 0adb78236e..3bd1403576 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -28,7 +28,7 @@ #include "llmemtype.h" -#if 0 //DON'T use ll_aligned_foo now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals) +#if LL_DEBUG inline void* ll_aligned_malloc( size_t size, int align ) { void* mem = malloc( size + (align - 1) + sizeof(void*) ); @@ -95,7 +95,15 @@ inline void ll_aligned_free_32(void *p) free(p); // posix_memalign() is compatible with heap deallocator #endif } -#endif +#else // LL_DEBUG +// ll_aligned_foo are noops now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals) +#define ll_aligned_malloc( size, align ) malloc(size) +#define ll_aligned_free( ptr ) free(ptr) +#define ll_aligned_malloc_16 malloc +#define ll_aligned_free_16 free +#define ll_aligned_malloc_32 malloc +#define ll_aligned_free_32 free +#endif // LL_DEBUG class LL_COMMON_API LLMemory { diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 3e651cc02a..c504215ee5 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -1884,9 +1884,9 @@ LLVolume::~LLVolume() mProfilep = NULL; mVolumeFaces.clear(); - free(mHullPoints); + ll_aligned_free_16(mHullPoints); mHullPoints = NULL; - free(mHullIndices); + ll_aligned_free_16(mHullIndices); mHullIndices = NULL; } @@ -2008,7 +2008,7 @@ void LLVolumeFace::VertexData::init() { if (!mData) { - mData = (LLVector4a*) malloc(sizeof(LLVector4a)*2); + mData = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*2); } } @@ -2037,7 +2037,7 @@ const LLVolumeFace::VertexData& LLVolumeFace::VertexData::operator=(const LLVolu LLVolumeFace::VertexData::~VertexData() { - free(mData); + ll_aligned_free_16(mData); mData = NULL; } @@ -5219,7 +5219,7 @@ LLVolumeFace::LLVolumeFace() : mWeights(NULL), mOctree(NULL) { - mExtents = (LLVector4a*) malloc(sizeof(LLVector4a)*3); + mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); mCenter = mExtents+2; } @@ -5240,7 +5240,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mWeights(NULL), mOctree(NULL) { - mExtents = (LLVector4a*) malloc(sizeof(LLVector4a)*3); + mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); mCenter = mExtents+2; *this = src; } @@ -5290,7 +5290,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) } else { - free(mBinormals); + ll_aligned_free_16(mBinormals); mBinormals = NULL; } @@ -5301,7 +5301,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) } else { - free(mWeights); + ll_aligned_free_16(mWeights); mWeights = NULL; } } @@ -5319,7 +5319,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) LLVolumeFace::~LLVolumeFace() { - free(mExtents); + ll_aligned_free_16(mExtents); mExtents = NULL; freeData(); @@ -5327,17 +5327,17 @@ LLVolumeFace::~LLVolumeFace() void LLVolumeFace::freeData() { - free(mPositions); + ll_aligned_free_16(mPositions); mPositions = NULL; - free( mNormals); + ll_aligned_free_16( mNormals); mNormals = NULL; - free(mTexCoords); + ll_aligned_free_16(mTexCoords); mTexCoords = NULL; - free(mIndices); + ll_aligned_free_16(mIndices); mIndices = NULL; - free(mBinormals); + ll_aligned_free_16(mBinormals); mBinormals = NULL; - free(mWeights); + ll_aligned_free_16(mWeights); mWeights = NULL; delete mOctree; @@ -5854,21 +5854,21 @@ void LLVolumeFace::cacheOptimize() //allocate space for new buffer S32 num_verts = mNumVertices; - LLVector4a* pos = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); - LLVector4a* norm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + LLVector4a* pos = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + LLVector4a* norm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; - LLVector2* tc = (LLVector2*) malloc(size); + LLVector2* tc = (LLVector2*) ll_aligned_malloc_16(size); LLVector4a* wght = NULL; if (mWeights) { - wght = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + wght = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } LLVector4a* binorm = NULL; if (mBinormals) { - binorm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } //allocate mapping of old indices to new indices @@ -5905,11 +5905,11 @@ void LLVolumeFace::cacheOptimize() mIndices[i] = new_idx[mIndices[i]]; } - free(mPositions); - free(mNormals); - free(mTexCoords); - free(mWeights); - free(mBinormals); + ll_aligned_free_16(mPositions); + ll_aligned_free_16(mNormals); + ll_aligned_free_16(mTexCoords); + ll_aligned_free_16(mWeights); + ll_aligned_free_16(mBinormals); mPositions = pos; mNormals = norm; @@ -6630,23 +6630,23 @@ void LLVolumeFace::createBinormals() void LLVolumeFace::resizeVertices(S32 num_verts) { - free(mPositions); - free(mNormals); - free(mBinormals); - free(mTexCoords); + ll_aligned_free_16(mPositions); + ll_aligned_free_16(mNormals); + ll_aligned_free_16(mBinormals); + ll_aligned_free_16(mTexCoords); mBinormals = NULL; if (num_verts) { - mPositions = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + mPositions = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); assert_aligned(mPositions, 16); - mNormals = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + mNormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); assert_aligned(mNormals, 16); //pad texture coordinate block end to allow for QWORD reads S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; - mTexCoords = (LLVector2*) malloc(size); + mTexCoords = (LLVector2*) ll_aligned_malloc_16(size); assert_aligned(mTexCoords, 16); } else @@ -6682,7 +6682,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con //just clear binormals - free(mBinormals); + ll_aligned_free_16(mBinormals); mBinormals = NULL; mPositions[mNumVertices] = pos; @@ -6694,26 +6694,26 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con void LLVolumeFace::allocateBinormals(S32 num_verts) { - free(mBinormals); - mBinormals = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + ll_aligned_free_16(mBinormals); + mBinormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } void LLVolumeFace::allocateWeights(S32 num_verts) { - free(mWeights); - mWeights = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + ll_aligned_free_16(mWeights); + mWeights = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); } void LLVolumeFace::resizeIndices(S32 num_indices) { - free(mIndices); + ll_aligned_free_16(mIndices); if (num_indices) { //pad index block end to allow for QWORD reads S32 size = ((num_indices*sizeof(U16)) + 0xF) & ~0xF; - mIndices = (U16*) malloc(size); + mIndices = (U16*) ll_aligned_malloc_16(size); } else { diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 21b02fdb71..98a0a93084 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -315,7 +315,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) } else { - LL_DEBUGS("ShaderLoading") << log << LL_ENDL; + LL_INFOS("ShaderLoading") << log << LL_ENDL; } } } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index a5e4e2e59c..8c9171ccf4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -629,7 +629,7 @@ void LLVertexBuffer::createGLBuffer() { static int gl_buffer_idx = 0; mGLBuffer = ++gl_buffer_idx; - mMappedData = (U8*) malloc(size); + mMappedData = (U8*) ll_aligned_malloc_16(size); } } @@ -663,7 +663,7 @@ void LLVertexBuffer::createGLIndices() } else { - mMappedIndexData = (U8*) malloc(size); + mMappedIndexData = (U8*) ll_aligned_malloc_16(size); static int gl_buffer_idx = 0; mGLIndices = ++gl_buffer_idx; } @@ -686,7 +686,7 @@ void LLVertexBuffer::destroyGLBuffer() } else { - free(mMappedData); + ll_aligned_free_16(mMappedData); mMappedData = NULL; mEmpty = TRUE; } @@ -715,7 +715,7 @@ void LLVertexBuffer::destroyGLIndices() } else { - free(mMappedIndexData); + ll_aligned_free_16(mMappedIndexData); mMappedIndexData = NULL; mEmpty = TRUE; } @@ -848,8 +848,8 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) { if (!useVBOs()) { - free(mMappedData); - mMappedData = (U8*) malloc(newsize); + ll_aligned_free_16(mMappedData); + mMappedData = (U8*) ll_aligned_malloc_16(newsize); } mResized = TRUE; } @@ -869,8 +869,8 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) { if (!useVBOs()) { - free(mMappedIndexData); - mMappedIndexData = (U8*) malloc(new_index_size); + ll_aligned_free_16(mMappedIndexData); + mMappedIndexData = (U8*) ll_aligned_malloc_16(new_index_size); } mResized = TRUE; } @@ -911,8 +911,8 @@ void LLVertexBuffer::freeClientBuffer() { if(useVBOs() && sDisableVBOMapping && (mMappedData || mMappedIndexData)) { - free(mMappedData) ; - free(mMappedIndexData) ; + ll_aligned_free_16(mMappedData) ; + ll_aligned_free_16(mMappedIndexData) ; mMappedData = NULL ; mMappedIndexData = NULL ; } @@ -922,7 +922,7 @@ void LLVertexBuffer::allocateClientVertexBuffer() { if(!mMappedData) { - mMappedData = (U8*)malloc(getSize()); + mMappedData = (U8*)ll_aligned_malloc_16(getSize()); } } @@ -930,7 +930,7 @@ void LLVertexBuffer::allocateClientIndexBuffer() { if(!mMappedIndexData) { - mMappedIndexData = (U8*)malloc(getIndicesSize()); + mMappedIndexData = (U8*)ll_aligned_malloc_16(getIndicesSize()); } } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1c19a33c4e..1cc3cc04d6 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1164,7 +1164,7 @@ void LLTextBase::reflow() S32 first_line = getFirstVisibleLine(); // if scroll anchor not on first line, update it to first character of first line - if (!mLineInfoList.empty() + if ((first_line < mLineInfoList.size()) && (mScrollIndex < mLineInfoList[first_line].mDocIndexStart || mScrollIndex >= mLineInfoList[first_line].mDocIndexEnd)) { diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 447e3661db..cb2abc5bc0 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -536,20 +536,20 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits GLint fullscreenAttrib[] = { AGL_RGBA, - AGL_FULLSCREEN, - // AGL_NO_RECOVERY, // MBW -- XXX -- Not sure if we want this attribute - AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, - AGL_SAMPLES_ARB, mFSAASamples, - AGL_DOUBLEBUFFER, - AGL_CLOSEST_POLICY, - AGL_ACCELERATED, - AGL_RED_SIZE, 8, - AGL_GREEN_SIZE, 8, - AGL_BLUE_SIZE, 8, - AGL_ALPHA_SIZE, 8, - AGL_DEPTH_SIZE, 24, - AGL_STENCIL_SIZE, 8, - AGL_NONE + AGL_FULLSCREEN, + AGL_NO_RECOVERY, + AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, + AGL_SAMPLES_ARB, mFSAASamples, + AGL_DOUBLEBUFFER, + AGL_CLOSEST_POLICY, + AGL_ACCELERATED, + AGL_RED_SIZE, 8, + AGL_GREEN_SIZE, 8, + AGL_BLUE_SIZE, 8, + AGL_ALPHA_SIZE, 8, + AGL_DEPTH_SIZE, 24, + AGL_STENCIL_SIZE, 8, + AGL_NONE }; LL_DEBUGS("Window") << "createContext: creating fullscreen pixelformat" << LL_ENDL; @@ -562,21 +562,28 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits } else { + // NOTE from Leslie: + // + // AGL_NO_RECOVERY, when combined with AGL_ACCELERATED prevents software rendering + // fallback which means we won't hvae shaders that compile and link but then don't + // work. The drawback is that our shader compilation will be a bit more finicky though. + GLint windowedAttrib[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_CLOSEST_POLICY, - AGL_ACCELERATED, - AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, - AGL_SAMPLES_ARB, mFSAASamples, - AGL_RED_SIZE, 8, - AGL_GREEN_SIZE, 8, - AGL_BLUE_SIZE, 8, - AGL_ALPHA_SIZE, 8, - AGL_DEPTH_SIZE, 24, - AGL_STENCIL_SIZE, 8, - AGL_NONE + AGL_NO_RECOVERY, + AGL_DOUBLEBUFFER, + AGL_CLOSEST_POLICY, + AGL_ACCELERATED, + AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, + AGL_SAMPLES_ARB, mFSAASamples, + AGL_RED_SIZE, 8, + AGL_GREEN_SIZE, 8, + AGL_BLUE_SIZE, 8, + AGL_ALPHA_SIZE, 8, + AGL_DEPTH_SIZE, 24, + AGL_STENCIL_SIZE, 8, + AGL_NONE }; LL_DEBUGS("Window") << "createContext: creating windowed pixelformat" << LL_ENDL; diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index f1862f9d72..5bc2e1b7e6 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="1.0"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.9"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.9"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="128"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="9"/> <!--Low number--> <RenderMaxPartCount value="4096"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> - <!--Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--Sun Shadows--> - <RenderShadowDetail value="0"/> - + <!--Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--Sun Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index ad0073dfac..ca1dae0b86 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -4,17 +4,17 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="0.5"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.0"/> - <!--Default for now--> - <RenderAvatarMaxVisible value="3"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.0"/> + <!--Default for now--> + <RenderAvatarMaxVisible value="3"/> <!--NO SHADERS--> <RenderAvatarVP value="FALSE"/> <!--Short Range--> <RenderFarClip value="64"/> <!--Default for now--> <RenderFlexTimeFactor value="0.5"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="8"/> <!--Low number--> <RenderMaxPartCount value="1024"/> @@ -36,11 +36,10 @@ <VertexShaderEnable value="FALSE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> - <!--No Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--No Shadows--> - <RenderShadowDetail value="0"/> - + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 6c4afbd7f0..01822fe64c 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="0.5"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.75"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.75"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="96"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="8"/> <!--Low number--> <RenderMaxPartCount value="2048"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> - <!--No Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--No Shadows--> - <RenderShadowDetail value="0"/> - + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl deleted file mode 100644 index 7d9d6cc0b2..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file avatarAlphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ - -#version 120 - -uniform sampler2D diffuseMap; -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2D noiseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec4 vary_position; -varying vec3 vary_normal; - -void main() -{ - float shadow = 1.0; - vec4 pos = vary_position; - vec3 norm = normalize(vary_normal); - - vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - - if (pos.z > -shadow_clip.w) - { - - if (pos.z < -shadow_clip.z) - { - vec4 lpos = shadow_matrix[3]*pos; - shadow = shadow2DProj(shadowMap3, lpos).x; - } - else if (pos.z < -shadow_clip.y) - { - vec4 lpos = shadow_matrix[2]*pos; - shadow = shadow2DProj(shadowMap2, lpos).x; - } - else if (pos.z < -shadow_clip.x) - { - vec4 lpos = shadow_matrix[1]*pos; - shadow = shadow2DProj(shadowMap1, lpos).x; - } - else - { - vec4 lpos = shadow_matrix[0]*pos; - shadow = shadow2DProj(shadowMap0, lpos).x; - } - } - - - vec4 col = vec4(vary_ambient + vary_directional*shadow, gl_Color.a); - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index 5dfbb91393..a2a7dea20d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -22,11 +22,36 @@ vec3 scaleUpLight(vec3 light); varying vec3 vary_position; varying vec3 vary_ambient; varying vec3 vary_directional; -varying vec3 vary_normal; varying vec3 vary_fragcoord; +varying vec3 vary_pointlight_col; uniform float near_clip; +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +{ + //get light vector + vec3 lv = lp.xyz-v; + + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float dist2 = d*d/(la*la); + float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= calcDirectionalLight(n, lv); + + return da; +} + void main() { gl_TexCoord[0] = gl_MultiTexCoord0; @@ -49,7 +74,6 @@ void main() gl_Position = frag_pos; vary_position = pos.xyz; - vary_normal = norm; calcAtmospherics(pos.xyz); @@ -57,18 +81,20 @@ void main() vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb = scaleDownLight(col.rgb); + // Collect normal lights + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + vary_pointlight_col = col.rgb*gl_Color.rgb; + + col.rgb = vec3(0,0,0); + // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); + col.rgb = atmosAmbient(vec3(0.)); vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl new file mode 100644 index 0000000000..2e3e84dd15 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl @@ -0,0 +1,20 @@ +/** + * @file multiPointLightV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +#version 120 + +varying vec4 vary_fragcoord; + +void main() +{ + //transform vertex + vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vary_fragcoord = pos; + + gl_Position = pos; + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 25ff958107..cd91351ad4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -15,8 +15,6 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - // Inputs uniform mat4 shadow_matrix[6]; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl deleted file mode 100644 index 4671a54078..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file avatarAlphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ - -#version 120 - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2D diffuseMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2D noiseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; -uniform vec2 shadow_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_position; -varying vec3 vary_normal; - -uniform float shadow_bias; - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs); - - return shadow/5.0; -} - -void main() -{ - float shadow = 1.0; - vec4 pos = vec4(vary_position, 1.0); - vec3 norm = normalize(vary_normal); - - //vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 1.5); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 1.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 1.5); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.5); - } - } - - - vec4 col = vec4(vary_ambient + vary_directional*shadow, gl_Color.a); - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 30954a8677..495e86c8db 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -22,13 +22,38 @@ vec3 scaleUpLight(vec3 light); varying vec3 vary_position; varying vec3 vary_ambient; varying vec3 vary_directional; -varying vec3 vary_normal; varying vec3 vary_fragcoord; +varying vec3 vary_pointlight_col; uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +{ + //get light vector + vec3 lv = lp.xyz-v; + + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float dist2 = d*d/(la*la); + float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= calcDirectionalLight(n, lv); + + return da; +} + void main() { gl_TexCoord[0] = gl_MultiTexCoord0; @@ -51,7 +76,6 @@ void main() float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; - vary_normal = norm; calcAtmospherics(pos.xyz); @@ -59,18 +83,20 @@ void main() vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb = scaleDownLight(col.rgb); + // Collect normal lights + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + vary_pointlight_col = col.rgb*gl_Color.rgb; + + col.rgb = vec3(0,0,0); + // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); + col.rgb = atmosAmbient(vec3(0.)); vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 26bc83e0d4..4369b3b34f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -19,9 +19,6 @@ uniform sampler2DRectShadow shadowMap2; uniform sampler2DRectShadow shadowMap3; uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; // Inputs diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 08b16d787f..847b36b1ac 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -21,8 +21,6 @@ uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - // Inputs uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index 3d588cf57d..71459e5470 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="TRUE"/> <!--Default for now--> <RenderAvatarLODFactor value="1.0"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="1.0"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="1.0"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="256"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="9"/> <!--Low number--> <RenderMaxPartCount value="4096"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> - <!--Deferred Shading--> - <RenderDeferred value="TRUE"/> - <!--SSAO Enabled--> - <RenderDeferredSSAO value="TRUE"/> - <!--Full Shadows--> - <RenderShadowDetail value="2"/> - + <!--Deferred Shading--> + <RenderDeferred value="TRUE"/> + <!--SSAO Enabled--> + <RenderDeferredSSAO value="TRUE"/> + <!--Full Shadows--> + <RenderShadowDetail value="2"/> </settings> diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 6bdb1e1787..c075c660f3 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 22 +version 23 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -24,11 +24,11 @@ version 22 // list all RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 +RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 -RenderAvatarVP 1 0 +RenderAvatarVP 1 1 RenderCubeMap 1 1 RenderDelayVBUpdate 1 0 RenderFarClip 1 256 @@ -41,7 +41,7 @@ RenderLocalLights 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 @@ -49,23 +49,21 @@ RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 +UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderUseCleverUI 1 1 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 0.5 -Disregard128DefaultDrawDistance 1 1 -Disregard96DefaultDrawDistance 1 1 +RenderShaderLightingMaxLevel 1 3 SkyUseClassicClouds 1 1 -WatchdogDisabled 1 1 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 - +WatchdogDisabled 1 1 +RenderUseStreamVBO 1 1 // // Low Graphics Settings @@ -90,15 +88,13 @@ RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0.5 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 2 - +RenderShadowDetail 1 0 // // Mid Graphics Settings @@ -122,14 +118,12 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 2 - +RenderShadowDetail 1 0 // // High Graphics Settings (purty) @@ -153,7 +147,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 @@ -161,7 +154,6 @@ RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 - // // Ultra graphics (REALLY PURTY!) // @@ -177,14 +169,13 @@ RenderGlowResolutionPow 1 9 RenderLocalLights 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 @@ -192,7 +183,6 @@ RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 - // // Class Unknown Hardware (unknown) // @@ -229,9 +219,12 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -239,10 +232,14 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 +// // "Default" setups for safe, low, medium, high // list safe @@ -255,8 +252,11 @@ RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // CPU based feature masks @@ -278,6 +278,9 @@ RenderObjectBump 0 0 list OpenGLPre15 RenderVBOEnable 1 0 +list TexUnit8orLess +RenderDeferredSSAO 0 0 + list Intel RenderAnisotropic 1 0 RenderLocalLights 1 0 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index 08fb67a0c8..3339172a1a 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -152,7 +152,7 @@ WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 +RenderShadowDetail 1 2 // // Ultra graphics (REALLY PURTY!) @@ -181,7 +181,7 @@ WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 +RenderShadowDetail 1 2 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 6b45c5abb0..030d6e1110 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -63,6 +63,8 @@ void LLDrawPoolSky::prerender() void LLDrawPoolSky::render(S32 pass) { + gGL.flush(); + if (mDrawFace.empty()) { return; @@ -111,13 +113,14 @@ void LLDrawPoolSky::render(S32 pass) S32 face_count = (S32)mDrawFace.size(); + LLVertexBuffer::unbind(); + glColor4f(1,1,1,1); + for (S32 i = 0; i < llmin(6, face_count); ++i) { renderSkyCubeFace(i); } - LLGLEnable blend(GL_BLEND); - glPopMatrix(); } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9f0b34becc..524d2d74ef 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -753,6 +753,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("OpenGLPre30"); } + if (gGLManager.mNumTextureUnits <= 8) + { + maskFeatures("TexUnit8orLess"); + } // now mask by gpu string // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 18b7a48d7b..4b15695cbf 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -987,9 +987,15 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); // Avatar Render Mode LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); + + bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); + if (LLViewerShaderMgr::sInitialized) + { + S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; + avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; + } - S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; - ctrl_avatar_vp->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE); + ctrl_avatar_vp->setEnabled(avatar_vp_enabled); if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE || gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) @@ -1006,7 +1012,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders"); // radio set for terrain detail mode LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var - + ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 4b2c569cc3..450f9b2be7 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -770,7 +770,7 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ int nverts = mSharedData->mNumVertices; int nfloats = nverts * (2*4 + 3*3 + 2 + 4); //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) malloc(nfloats*4); + mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4); int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; @@ -799,7 +799,7 @@ LLPolyMesh::~LLPolyMesh() mJointRenderData[i] = NULL; } - free(mVertexData); + ll_aligned_free_16(mVertexData); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5f16dac7b9..fa329eb0ae 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3167,11 +3167,11 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh( &mesh, &res ); //copy res into phys_volume - phys_volume->mHullPoints = (LLVector4a*) malloc(sizeof(LLVector4a)*res.mNumVertices); + phys_volume->mHullPoints = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices); phys_volume->mNumHullPoints = res.mNumVertices; S32 idx_size = (res.mNumTriangles*3*2+0xF) & ~0xF; - phys_volume->mHullIndices = (U16*) malloc(idx_size); + phys_volume->mHullIndices = (U16*) ll_aligned_malloc_16(idx_size); phys_volume->mNumHullIndices = res.mNumTriangles*3; const F32* v = res.mVertexBase; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e81ee72c05..3e85802ba6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1051,7 +1051,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader"; gDeferredMultiLightProgram.mShaderFiles.clear(); - gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredMultiLightProgram.createShader(NULL, NULL); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 288d335e1d..6396bc042d 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -304,7 +304,7 @@ void LLSkyTex::createGLImage(S32 which) void LLSkyTex::bindTexture(BOOL curr) { - gGL.getTexUnit(0)->bind(mTexture[getWhich(curr)]); + gGL.getTexUnit(0)->bind(mTexture[getWhich(curr)], true); } /*************************************** |