From 65161e6b393a6df6fa0a932aeb940fb7ac7ea084 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 12 Dec 2016 18:24:46 +0200 Subject: MAINT-6125 - Mesh avatar deforms constantly MAINT-6910 - [MAINT-RC] Some mesh turns invisible when camera is moved on the Maint-RC viewer only - caused by fix for MAINT-6125. Commulative fix. Fixed for booth ticket's in indra/newview/llvovolume.cpp Remained fixed, it's a small code improvements which is not related to MAINT-6125, MAINT-6910 --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 5048799854..7e47471db6 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -509,7 +509,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } } - U32 map_tc[] = + static const U32 map_tc[] = { MAP_TEXCOORD1, MAP_TEXCOORD2, -- cgit v1.2.3 From 325c076d094140fddf11cb291ca45c8a1426f442 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 26 Oct 2017 18:33:08 +0300 Subject: MAINT-7213 Shared media (media as a texture) unusable with transparent mesh New outline selection around mesh objects. --- indra/llrender/CMakeLists.txt | 2 ++ indra/llrender/llgl.h | 17 +++++++++++++++++ indra/llrender/llglcommonfunc.cpp | 37 +++++++++++++++++++++++++++++++++++++ indra/llrender/llglcommonfunc.h | 30 ++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 indra/llrender/llglcommonfunc.cpp create mode 100644 indra/llrender/llglcommonfunc.h (limited to 'indra/llrender') diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 331f988382..07a0d8c402 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -51,6 +51,7 @@ set(llrender_SOURCE_FILES lltexture.cpp lluiimage.cpp llvertexbuffer.cpp + llglcommonfunc.cpp ) set(llrender_HEADER_FILES @@ -78,6 +79,7 @@ set(llrender_HEADER_FILES lltexture.h lluiimage.h llvertexbuffer.h + llglcommonfunc.h ) set_source_files_properties(${llrender_HEADER_FILES} diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index aa98b3f6bc..4c4302d05b 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -256,6 +256,9 @@ void clear_glerror(); if the existing GL state does not match the expected GL state. */ + +#include "boost/function.hpp" + class LLGLState { public: @@ -297,6 +300,20 @@ public: LLGLEnableAlphaReject(bool enable); }; +// Enable with functor +class LLGLEnableFunc : LLGLState +{ +public: + LLGLEnableFunc(LLGLenum state, bool enable, boost::function func) + : LLGLState(state, enable) + { + if (enable) + { + func(); + } + } +}; + /// TODO: Being deprecated. class LLGLEnable : public LLGLState { diff --git a/indra/llrender/llglcommonfunc.cpp b/indra/llrender/llglcommonfunc.cpp new file mode 100644 index 0000000000..e9ec28927f --- /dev/null +++ b/indra/llrender/llglcommonfunc.cpp @@ -0,0 +1,37 @@ +/** +* @file llglcommonfunc.cpp +* @brief Implementation of the LLGLCommonFunc. +* +* $LicenseInfo:firstyear=2001&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llglheaders.h" +#include "llglcommonfunc.h" + +namespace LLGLCommonFunc +{ + void selected_stencil_test() + { + glStencilFunc(GL_ALWAYS, 2, 0xffff); + glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); + } +} diff --git a/indra/llrender/llglcommonfunc.h b/indra/llrender/llglcommonfunc.h new file mode 100644 index 0000000000..f1f8ff7bc4 --- /dev/null +++ b/indra/llrender/llglcommonfunc.h @@ -0,0 +1,30 @@ +/** +* @file llphoenixfunc.h +* @brief File include common opengl code snippets +* +* $LicenseInfo:firstyear=2003&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +namespace LLGLCommonFunc +{ + void selected_stencil_test(); +} -- cgit v1.2.3 From df376c029936da11b3e1dda54f9c327de50440a8 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 26 Dec 2017 18:20:06 +0200 Subject: MAINT-6437 - Tile-Based Texture Animation Scales Incorrectly for Rigged Mesh when worn (MacOS only) FIXED. --- indra/llrender/llglslshader.cpp | 54 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 970502f2d6..97557267cf 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -744,24 +744,25 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) , even if the "diffuseMap" will be appear and use first in shader code. As example where this situation appear see: "Deferred Material Shader 28/29/30/31" - And tickets: MAINT-4165, MAINT-4839, MAINT-3568 + And tickets: MAINT-4165, MAINT-4839, MAINT-3568, MAINT-6437 */ S32 diffuseMap = glGetUniformLocationARB(mProgramObject, "diffuseMap"); + S32 specularMap = glGetUniformLocationARB(mProgramObject, "specularMap"); S32 bumpMap = glGetUniformLocationARB(mProgramObject, "bumpMap"); S32 environmentMap = glGetUniformLocationARB(mProgramObject, "environmentMap"); std::set skip_index; - if (-1 != diffuseMap && (-1 != bumpMap || -1 != environmentMap)) + if (-1 != diffuseMap && (-1 != specularMap || -1 != bumpMap || -1 != environmentMap)) { GLenum type; GLsizei length; GLint size = -1; char name[1024]; - diffuseMap = bumpMap = environmentMap = -1; + diffuseMap = specularMap = bumpMap = environmentMap = -1; for (S32 i = 0; i < activeCount; i++) { @@ -775,6 +776,18 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) continue; } + if (-1 == specularMap && std::string(name) == "specularMap") + { + specularMap = i; + continue; + } + + if (-1 == specularMap && std::string(name) == "specularMap") + { + specularMap = i; + continue; + } + if (-1 == bumpMap && std::string(name) == "bumpMap") { bumpMap = i; @@ -788,34 +801,29 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) } } + bool specularDiff = specularMap < diffuseMap && -1 != specularMap; bool bumpLessDiff = bumpMap < diffuseMap && -1 != bumpMap; bool envLessDiff = environmentMap < diffuseMap && -1 != environmentMap; - if (bumpLessDiff && envLessDiff) + if (specularDiff || bumpLessDiff || envLessDiff) { mapUniform(diffuseMap, uniforms); - mapUniform(bumpMap, uniforms); - mapUniform(environmentMap, uniforms); - skip_index.insert(diffuseMap); - skip_index.insert(bumpMap); - skip_index.insert(environmentMap); - } - else if (bumpLessDiff) - { - mapUniform(diffuseMap, uniforms); - mapUniform(bumpMap, uniforms); - skip_index.insert(diffuseMap); - skip_index.insert(bumpMap); - } - else if (envLessDiff) - { - mapUniform(diffuseMap, uniforms); - mapUniform(environmentMap, uniforms); + if (-1 != specularMap) { + mapUniform(specularMap, uniforms); + skip_index.insert(specularMap); + } - skip_index.insert(diffuseMap); - skip_index.insert(environmentMap); + if (-1 != bumpMap) { + mapUniform(bumpMap, uniforms); + skip_index.insert(bumpMap); + } + + if (-1 != environmentMap) { + mapUniform(environmentMap, uniforms); + skip_index.insert(environmentMap); + } } } -- cgit v1.2.3