diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-03 17:18:39 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-03 17:18:39 -0600 |
commit | 830cb6b66551025285120fb628f0b5ebf3841756 (patch) | |
tree | 668e10bab4f075bca49f006017e7dfccfd8096ce /indra | |
parent | 4259ea79535e88ef6d8ec8415c53c28d0c2d89ac (diff) |
SL-19148 Decruft some forward shaders and drawpools. Fix HUDs being in wrong color space.
Diffstat (limited to 'indra')
66 files changed, 298 insertions, 2481 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index faa45d59b9..1e3f539c81 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -87,7 +87,6 @@ LLShaderFeatures::LLShaderFeatures() , calculatesAtmospherics(false) , hasLighting(false) , isAlphaLighting(false) - , isShiny(false) , isFullbright(false) , isSpecular(false) , hasWaterFog(false) diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 6c18282fec..f7bba35758 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -40,7 +40,6 @@ public: bool calculatesAtmospherics; bool hasLighting; // implies no transport (it's possible to have neither though) bool isAlphaLighting; // indicates lighting shaders need not be linked in (lighting performed directly in alpha shader to match deferred lighting functions) - bool isShiny; bool isFullbright; // implies no lighting bool isSpecular; bool hasWaterFog; // implies no gamma diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 6e3d89eedc..e9daf7cb75 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -296,9 +296,6 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) { return FALSE; } - - // Test hasFullbright and hasShiny and attach fullbright and - // fullbright shiny atmos transport if we split them out. } // NOTE order of shader object attaching is VERY IMPORTANT!!! @@ -390,30 +387,11 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) } } } - // NOTE order of shader object attaching is VERY IMPORTANT!!! else if (features->isFullbright) { - if (features->isShiny && features->hasWaterFog) - { - if (features->disableTextureIndex) - { - if (!shader->attachFragmentObject("lighting/lightFullbrightShinyWaterNonIndexedF.glsl")) - { - return FALSE; - } - } - else - { - if (!shader->attachFragmentObject("lighting/lightFullbrightShinyWaterF.glsl")) - { - return FALSE; - } - shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); - } - } - else if (features->hasWaterFog) + if (features->hasWaterFog) { if (features->disableTextureIndex) { @@ -445,26 +423,6 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } } - - else if (features->isShiny) - { - if (features->disableTextureIndex) - { - if (!shader->attachFragmentObject("lighting/lightFullbrightShinyNonIndexedF.glsl")) - { - return FALSE; - } - } - else - { - if (!shader->attachFragmentObject("lighting/lightFullbrightShinyF.glsl")) - { - return FALSE; - } - shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); - } - } - else { if (features->disableTextureIndex) @@ -505,50 +463,6 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) } } } - - // NOTE order of shader object attaching is VERY IMPORTANT!!! - else if (features->isShiny) - { - - if (features->hasWaterFog) - { - if (features->disableTextureIndex) - { - if (!shader->attachFragmentObject("lighting/lightShinyWaterNonIndexedF.glsl")) - { - return FALSE; - } - } - else - { - if (!shader->attachFragmentObject("lighting/lightShinyWaterF.glsl")) - { - return FALSE; - } - shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); - } - } - - else - { - if (features->disableTextureIndex) - { - if (!shader->attachFragmentObject("lighting/lightShinyNonIndexedF.glsl")) - { - return FALSE; - } - } - else - { - if (!shader->attachFragmentObject("lighting/lightShinyF.glsl")) - { - return FALSE; - } - shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); - } - } - } - if (features->mIndexedTextureChannels <= 1) { if (!shader->attachVertexObject("objects/nonindexedTextureV.glsl")) @@ -1422,7 +1336,6 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("single_mie_scattering_texture"); mReservedUniforms.push_back("irradiance_texture"); mReservedUniforms.push_back("blend_factor"); - mReservedUniforms.push_back("no_atmo"); mReservedUniforms.push_back("moisture_level"); mReservedUniforms.push_back("droplet_radius"); mReservedUniforms.push_back("ice_level"); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index a224b2a19b..3c8bef635a 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -255,7 +255,6 @@ public: ILLUMINANCE_TEX, // "irradiance_texture" BLEND_FACTOR, // "blend_factor" - NO_ATMO, // "no_atmo" MOISTURE_LEVEL, // "moisture_level" DROPLET_RADIUS, // "droplet_radius" ICE_LEVEL, // "ice_level" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 085bac0042..1588f16f07 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -186,7 +186,6 @@ set(viewer_SOURCE_FILES lldrawpoolalpha.cpp lldrawpoolavatar.cpp lldrawpoolbump.cpp - lldrawpoolground.cpp lldrawpoolmaterials.cpp lldrawpoolpbropaque.cpp lldrawpoolsimple.cpp @@ -718,7 +717,6 @@ set(viewer_SOURCE_FILES llvoavatarself.cpp llvocache.cpp llvograss.cpp - llvoground.cpp llvoicecallhandler.cpp llvoicechannel.cpp llvoiceclient.cpp @@ -834,7 +832,6 @@ set(viewer_HEADER_FILES lldrawpoolbump.h lldrawpoolmaterials.h lldrawpoolpbropaque.h - lldrawpoolground.h lldrawpoolsimple.h lldrawpoolsky.h lldrawpoolterrain.h @@ -1358,7 +1355,6 @@ set(viewer_HEADER_FILES llvoavatarself.h llvocache.h llvograss.h - llvoground.h llvoicechannel.h llvoiceclient.h llvoicevisualizer.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4a12d239ed..bbf04a6889 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10073,17 +10073,6 @@ <key>Value</key> <real>1.3</real> </map> - <key>RenderGround</key> - <map> - <key>Comment</key> - <string>Determines whether we can render the ground pool or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>DisableAllRenderTypes</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 73e5b401c0..afe504743d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -27,19 +27,15 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif #if !defined(HAS_DIFFUSE_LOOKUP) uniform sampler2D diffuseMap; #endif -VARYING vec3 vary_position; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec3 vary_position; +in vec4 vertex_color; +in vec2 vary_texcoord0; #ifdef WATER_FOG vec4 applyWaterFogView(vec3 pos, vec4 color); @@ -68,7 +64,7 @@ void main() #ifdef HAS_DIFFUSE_LOOKUP vec4 color = diffuseLookup(vary_texcoord0.xy); #else - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 color = texture(diffuseMap, vary_texcoord0.xy); #endif float final_alpha = color.a * vertex_color.a; @@ -91,7 +87,10 @@ void main() color.a = final_alpha; #endif - frag_color.rgb = srgb_to_linear(color.rgb); +#ifndef IS_HUD + color.rgb = srgb_to_linear(color.rgb); +#endif + frag_color.rgb = color.rgb; frag_color.a = color.a; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index f693323d45..850f7ebb38 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -22,85 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -/*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -#ifndef HAS_DIFFUSE_LOOKUP -uniform sampler2D diffuseMap; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; -VARYING vec3 vary_position; - -uniform samplerCube environmentMap; +//debug stub -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() -uniform int no_atmo; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); -vec3 fullbrightScaleSoftClip(vec3 light); - -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); - -vec3 linear_to_srgb(vec3 c); -vec3 srgb_to_linear(vec3 c); +out vec4 frag_color; -// See: -// class1\deferred\fullbrightShinyF.glsl -// class1\lighting\lightFullbrightShinyF.glsl void main() { -#ifdef HAS_DIFFUSE_LOOKUP - vec4 color = diffuseLookup(vary_texcoord0.xy); -#else - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); -#endif - - color.rgb *= vertex_color.rgb; - - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; - vec3 pos = vary_position.xyz; - - calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - float env_intensity = vertex_color.a; - - //color.rgb = srgb_to_linear(color.rgb); - color.rgb = mix(color.rgb, envColor.rgb, env_intensity); - color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); - color.rgb = fullbrightScaleSoftClip(color.rgb); - } - -/* - // NOTE: HUD objects will be full bright. Uncomment if you want "some" environment lighting effecting these HUD objects. - else - { - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - float env_intensity = vertex_color.a; - color.rgb = mix(color.rgb, envColor.rgb, env_intensity); - } -*/ - - color.a = 1.0; - - //color.rgb = linear_to_srgb(color.rgb); - - frag_color = color; + frag_color = vec4(0.25, 0.5, 0, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index 0bb48061e0..b2c83a0f44 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -31,9 +31,6 @@ out vec4 frag_color; uniform float minimum_alpha; -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; -uniform int no_atmo; - vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); @@ -51,12 +48,8 @@ void default_lighting() color *= vertex_color; - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { - color.rgb = atmosLighting(color.rgb); - color.rgb = scaleSoftClip(color.rgb); - } + color.rgb = atmosLighting(color.rgb); + color.rgb = scaleSoftClip(color.rgb); frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl index ad2170bbd3..00749213db 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl @@ -32,9 +32,6 @@ out vec4 frag_color; uniform float minimum_alpha; uniform float texture_gamma; // either 1.0 or 2.2; see: "::TEXTURE_GAMMA" -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() -uniform int no_atmo; - vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -54,16 +51,8 @@ void fullbright_lighting() color.rgb = pow(color.rgb, vec3(texture_gamma)); - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { - color.rgb = fullbrightAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); - } - - //*TODO: Are we missing an inverse pow() here? - // class1\lighting\lightFullbrightF.glsl has: - // color.rgb = pow(color.rgb, vec3(1.0/texture_gamma)); + color.rgb = fullbrightAtmosTransport(color.rgb); + color.rgb = fullbrightScaleSoftClip(color.rgb); frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index 89be8195f0..b9dc332043 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -34,9 +34,6 @@ VARYING vec2 vary_texcoord0; uniform float texture_gamma; -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; -uniform int no_atmo; - vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -46,12 +43,8 @@ void fullbright_lighting() color.rgb = pow(color.rgb, vec3(texture_gamma)); - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { - color.rgb = fullbrightAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); - } + color.rgb = fullbrightAtmosTransport(color.rgb); + color.rgb = fullbrightScaleSoftClip(color.rgb); color.rgb = pow(color.rgb, vec3(1.0/texture_gamma)); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index 5e966293c6..092a7088da 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -35,9 +35,6 @@ VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() -uniform int no_atmo; - vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -49,23 +46,11 @@ void fullbright_shiny_lighting() vec4 color = diffuseLookup(vary_texcoord0.xy); color.rgb *= vertex_color.rgb; - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - } -/* - // NOTE: HUD objects will be full bright. Uncomment if you want "some" environment lighting effecting these HUD objects. - else - { - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low - } -*/ color.a = 1.0; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index f621a00785..cbbb206bc1 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -23,15 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; +in vec4 vertex_color; +in vec2 vary_texcoord0; +in vec3 vary_texcoord1; uniform samplerCube environmentMap; @@ -39,7 +34,7 @@ vec3 scaleSoftClip(vec3 light); vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); -void shiny_lighting() +vec4 shiny_lighting() { vec4 color = diffuseLookup(vary_texcoord0.xy); color.rgb *= vertex_color.rgb; @@ -51,6 +46,6 @@ void shiny_lighting() color.rgb = scaleSoftClip(color.rgb); color.a = 1.0; - frag_color = color; + return color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl index 2b6f414005..f2a4665514 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl @@ -23,15 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; +in vec4 vertex_color; +in vec2 vary_texcoord0; +in vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -52,6 +47,6 @@ void shiny_lighting() color.rgb = scaleSoftClip(color.rgb); color.a = 1.0; - frag_color = color; + return color; } diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl deleted file mode 100644 index f8f88e2577..0000000000 --- a/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file shinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, 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$ - */ - - - -void shiny_lighting(); - -void main() -{ - shiny_lighting(); -} diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl deleted file mode 100644 index 3ad7bcaa50..0000000000 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file shinyV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, 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$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 texture_matrix1; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -void passTextureIndex(); -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color); - -void calcAtmospherics(vec3 inPositionEye); - -uniform vec4 origin; - -#ifdef HAS_SKIN -mat4 getObjectSkinnedTransform(); -uniform mat4 projection_matrix; -#endif - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - -#ifdef HAS_SKIN - mat4 mat = getObjectSkinnedTransform(); - mat = modelview_matrix * mat; - vec4 pos = mat * vert; - gl_Position = projection_matrix * pos; - vec3 norm = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz); -#else - vec4 pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vec3 norm = normalize(normal_matrix * normal); -#endif - vec3 ref = reflect(pos.xyz, -norm); - - vary_texcoord0 = (texture_matrix0*vec4(texcoord0,0,1)).xy; - vary_texcoord1 = (texture_matrix1 * vec4(ref,1.0)).xyz; - - calcAtmospherics(pos.xyz); - - vertex_color = calcLighting(pos.xyz, norm, diffuse_color); -} diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl deleted file mode 100644 index 1e72e23eef..0000000000 --- a/indra/newview/app_settings/shaders/class1/objects/shinyWaterF.glsl +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @file shinyWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, 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$ - */ - - - -void shiny_lighting_water(); - -void main() -{ - shiny_lighting_water(); -} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 2025174f7d..ad8179af29 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -28,9 +28,6 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() -uniform int no_atmo; - ATTRIBUTE vec3 position; void passTextureIndex(); ATTRIBUTE vec2 texcoord0; @@ -58,30 +55,21 @@ void main() passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 1) - { - vertex_color = diffuse_color; - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - } - else - { + #ifdef HAS_SKIN - mat4 mat = getObjectSkinnedTransform(); - mat = modelview_matrix * mat; + mat4 mat = getObjectSkinnedTransform(); + mat = modelview_matrix * mat; - vec4 pos = mat * vert; - vec3 norm = normalize((mat*vec4(normal.xyz+vert.xyz,1.0)).xyz-pos.xyz); + vec4 pos = mat * vert; + vec3 norm = normalize((mat*vec4(normal.xyz+vert.xyz,1.0)).xyz-pos.xyz); - gl_Position = projection_matrix * pos; + gl_Position = projection_matrix * pos; #else - vec4 pos = (modelview_matrix * vert); - vec3 norm = normalize(normal_matrix * normal); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + vec3 norm = normalize(normal_matrix * normal); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); #endif - calcAtmospherics(pos.xyz); - - vertex_color = calcLighting(pos.xyz, norm, diffuse_color); - } + calcAtmospherics(pos.xyz); + vertex_color = calcLighting(pos.xyz, norm, diffuse_color); } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl index 206a51db27..fd69165945 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersF.glsl @@ -25,11 +25,9 @@ uniform vec4 sunlight_color; uniform vec4 light_ambient; -uniform int no_atmo; vec3 atmosAmbient() { - if (no_atmo == 1) return vec3(0.16); return light_ambient.rgb; } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl index c266f9732f..4179eaa9eb 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -25,11 +25,9 @@ uniform vec4 sunlight_color; uniform vec4 light_ambient; -uniform int no_atmo; vec3 atmosAmbient() { - if (no_atmo == 1) return vec3(0.66); return light_ambient.rgb; } diff --git a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl index fc51e81177..b1db147572 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -uniform int no_atmo; - vec3 scaleSoftClipFrag(vec3 light) { // For compatibility with lower cards. Do nothing. diff --git a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl index a937d9fa99..fb864d1951 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/transportF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -uniform int no_atmo; - vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) { /* stub function for fallback compatibility on class1 hardware */ diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 7435f1c0e1..e2694e060e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -300,6 +300,9 @@ void main() #endif // #else // FOR_IMPOSTOR +#ifdef IS_HUD + color.rgb = linear_to_srgb(color.rgb); +#endif frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl index 1463d507bc..6668a00841 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl @@ -27,17 +27,11 @@ vec3 getAdditiveColor(); vec3 getAtmosAttenuation(); vec3 scaleSoftClipFrag(vec3 light); -uniform int no_atmo; - vec3 srgb_to_linear(vec3 col); vec3 linear_to_srgb(vec3 col); vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten) { - if (no_atmo == 1) - { - return light; - } light *= atten.r; light += additive; return light * 2.0; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl index ba02070e45..f9f625ecdb 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl @@ -45,7 +45,6 @@ uniform float max_y; uniform vec3 glow; uniform float scene_light_strength; uniform mat3 ssao_effect_mat; -uniform int no_atmo; uniform float sun_moon_glow_factor; float getAmbientClamp() { return 1.0f; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl index 5788871744..800d08047a 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersF.glsl @@ -26,11 +26,9 @@ // Output variables uniform float scene_light_strength; -uniform int no_atmo; vec3 atmosFragAmbient(vec3 light, vec3 amblit) { - if (no_atmo == 1) return light; return amblit + light / 2.0; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl index 9c42b84eca..257a76c663 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsHelpersV.glsl @@ -33,11 +33,9 @@ vec3 getAtmosAttenuation(); vec3 getPositionEye(); uniform float scene_light_strength; -uniform int no_atmo; vec3 atmosAmbient() { - if (no_atmo == 1) return vec3(0.16); return getAmblitColor(); } diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl index a32a572461..9a9b179e6a 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl @@ -23,7 +23,6 @@ * $/LicenseInfo$ */ uniform float gamma; -uniform int no_atmo; vec3 getAtmosAttenuation(); vec3 getAdditiveColor(); @@ -33,10 +32,6 @@ vec3 linear_to_srgb(vec3 col); vec3 scaleSoftClipFragLinear(vec3 light) { // identical to non-linear version and that's probably close enough - if (no_atmo == 1) - { - return light; - } //soft clip effect: light = 1. - clamp(light, vec3(0.), vec3(1.)); light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side @@ -45,10 +40,6 @@ vec3 scaleSoftClipFragLinear(vec3 light) vec3 scaleSoftClipFrag(vec3 light) { - if (no_atmo == 1) - { - return light; - } //soft clip effect: light = 1. - clamp(light, vec3(0.), vec3(1.)); light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index ecf0430a88..c509d865ba 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -30,8 +30,6 @@ vec3 getAdditiveColor(); vec3 getAtmosAttenuation(); -uniform int no_atmo; - vec3 srgb_to_linear(vec3 col); vec3 linear_to_srgb(vec3 col); diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index 160d360256..b90de7609b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -43,9 +43,6 @@ VARYING vec3 vary_position; uniform samplerCube environmentMap; -// render_hud_attachments() -> HUD objects set LLShaderMgr::NO_ATMO; used in LLDrawPoolAlpha::beginRenderPass() -uniform int no_atmo; - vec3 fullbrightShinyAtmosTransport(vec3 light); vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); vec3 fullbrightScaleSoftClip(vec3 light); @@ -59,12 +56,8 @@ vec3 srgb_to_linear(vec3 c); void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv, vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity); -void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm); void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity); -// See: -// class1\deferred\fullbrightShinyF.glsl -// class1\lighting\lightFullbrightShinyF.glsl void main() { #ifdef HAS_DIFFUSE_LOOKUP @@ -76,32 +69,32 @@ void main() color.rgb *= vertex_color.rgb; // SL-9632 HUDs are affected by Atmosphere - if (no_atmo == 0) - { - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; - vec3 pos = vary_position; - calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); - - float env_intensity = vertex_color.a; - - vec3 ambenv; - vec3 glossenv; - vec3 legacyenv; - vec3 norm = normalize(vary_texcoord1.xyz); - vec4 spec = vec4(0,0,0,0); - sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity); - applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity); - - color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); - color.rgb = fullbrightScaleSoftClip(color.rgb); - } +#ifndef IS_HUD + + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + vec3 pos = vary_position; + calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); + + float env_intensity = vertex_color.a; + + vec3 ambenv; + vec3 glossenv; + vec3 legacyenv; + vec3 norm = normalize(vary_texcoord1.xyz); + vec4 spec = vec4(0,0,0,0); + sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, vec2(0), pos.xyz, norm.xyz, spec.a, env_intensity); + applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity); + + color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); + color.rgb = fullbrightScaleSoftClip(color.rgb); + color.rgb = srgb_to_linear(color.rgb); +#endif color.a = 1.0; - - color.rgb = srgb_to_linear(color.rgb); + frag_color = color; } diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 360f4d5fc4..0f8dcf7f73 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -41,7 +41,6 @@ RenderFlexTimeFactor 1 1.0 RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 -RenderGround 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 RenderLocalLights 1 1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 40e4436763..afe95c86d9 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -41,7 +41,6 @@ RenderFlexTimeFactor 1 1.0 RenderFogRatio 1 4.0 RenderGamma 1 0 RenderGlowResolutionPow 1 9 -RenderGround 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 RenderLocalLights 1 1 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9018a5f168..af4c68e41f 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -940,11 +940,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { gSky.mVOSkyp->setRegion(regionp); } - if (gSky.mVOGroundp) - { - gSky.mVOGroundp->setRegion(regionp); - } - + if (regionp->capabilitiesReceived()) { regionp->requestSimulatorFeatures(); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 7d869562ca..45df4d0eee 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -499,7 +499,6 @@ void LLDrawable::makeActive() pcode == LLViewerObject::LL_VO_SURFACE_PATCH || pcode == LLViewerObject::LL_VO_PART_GROUP || pcode == LLViewerObject::LL_VO_HUD_PART_GROUP || - pcode == LLViewerObject::LL_VO_GROUND || pcode == LLViewerObject::LL_VO_SKY) { LL_ERRS() << "Static viewer object has active drawable!" << LL_ENDL; @@ -984,8 +983,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector) bool rebuild = (!volume && getRenderType() != LLPipeline::RENDER_TYPE_TREE && getRenderType() != LLPipeline::RENDER_TYPE_TERRAIN && - getRenderType() != LLPipeline::RENDER_TYPE_SKY && - getRenderType() != LLPipeline::RENDER_TYPE_GROUND); + getRenderType() != LLPipeline::RENDER_TYPE_SKY); if (rebuild) { diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index e35e889a69..7fe8b02cc5 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -36,7 +36,6 @@ #include "lldrawpoolavatar.h" #include "lldrawpoolbump.h" #include "lldrawpoolmaterials.h" -#include "lldrawpoolground.h" #include "lldrawpoolpbropaque.h" #include "lldrawpoolsimple.h" #include "lldrawpoolsky.h" @@ -80,9 +79,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) case POOL_FULLBRIGHT: poolp = new LLDrawPoolFullbright(); break; - case POOL_INVISIBLE: - poolp = new LLDrawPoolInvisible(); - break; case POOL_GLOW: poolp = new LLDrawPoolGlow(); break; @@ -109,9 +105,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0) case POOL_WATER: poolp = new LLDrawPoolWater(); break; - case POOL_GROUND: - poolp = new LLDrawPoolGround(); - break; case POOL_BUMP: poolp = new LLDrawPoolBump(); break; diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 7050723116..a60d09c154 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -54,7 +54,6 @@ public: // based on fill rate and likelihood to occlude future passes (faster, large occluders first). // POOL_SIMPLE = 1, - POOL_GROUND, POOL_FULLBRIGHT, POOL_BUMP, POOL_TERRAIN, @@ -66,7 +65,6 @@ public: POOL_FULLBRIGHT_ALPHA_MASK, POOL_SKY, POOL_WL_SKY, - POOL_INVISIBLE, // see below * POOL_AVATAR, POOL_CONTROL_AV, // Animesh POOL_GLOW, @@ -76,11 +74,6 @@ public: POOL_ALPHA_POST_WATER, POOL_ALPHA, // note there is no actual "POOL_ALPHA" but pre-water and post-water pools consume POOL_ALPHA faces NUM_POOL_TYPES, - // * invisiprims work by rendering to the depth buffer but not the color buffer, occluding anything rendered after them - // - and the LLDrawPool types enum controls what order things are rendered in - // - so, it has absolute control over what invisprims block - // ...invisiprims being rendered in pool_invisible - // ...shiny/bump mapped objects in rendered in POOL_BUMP }; LLDrawPool(const U32 type); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index d3d5235770..a7ce1a9f87 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -113,7 +113,6 @@ static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma, bool d { shader->bind(); } - shader->uniform1i(LLShaderMgr::NO_ATMO, (LLPipeline::sRenderingHUDs) ? 1 : 0); shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f / 2.2f)); if (LLPipeline::sRenderingHUDs) @@ -173,16 +172,25 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass) } // prepare shaders - emissive_shader = (LLPipeline::sRenderDeferred) ? &gDeferredEmissiveProgram : - (LLPipeline::sUnderWaterRender) ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; + llassert(LLPipeline::sRenderDeferred); + + emissive_shader = &gDeferredEmissiveProgram; + prepare_alpha_shader(emissive_shader, true, false, water_sign); - fullbright_shader = (LLPipeline::sImpostorRender) ? &gDeferredFullbrightAlphaMaskProgram : - (LLPipeline::sUnderWaterRender) ? &gDeferredFullbrightWaterAlphaProgram : &gDeferredFullbrightAlphaMaskAlphaProgram; + fullbright_shader = + (LLPipeline::sImpostorRender) ? &gDeferredFullbrightAlphaMaskProgram : + (LLPipeline::sUnderWaterRender) ? &gDeferredFullbrightWaterAlphaProgram : + (LLPipeline::sRenderingHUDs) ? &gHUDFullbrightAlphaMaskAlphaProgram : + &gDeferredFullbrightAlphaMaskAlphaProgram; prepare_alpha_shader(fullbright_shader, true, true, water_sign); - simple_shader = (LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram : - (LLPipeline::sUnderWaterRender) ? &gDeferredAlphaWaterProgram : &gDeferredAlphaProgram; + simple_shader = + (LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram : + (LLPipeline::sUnderWaterRender) ? &gDeferredAlphaWaterProgram : + (LLPipeline::sRenderingHUDs) ? &gHUDAlphaProgram : + &gDeferredAlphaProgram; + prepare_alpha_shader(simple_shader, false, true, water_sign); //prime simple shader (loads shadow relevant uniforms) LLGLSLShader* materialShader = LLPipeline::sUnderWaterRender ? gDeferredMaterialWaterProgram : gDeferredMaterialProgram; @@ -193,8 +201,11 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass) prepare_alpha_shader(&gDeferredPBRAlphaProgram, false, true, water_sign); - // first pass, render rigged objects only and render to depth buffer - forwardRender(true); + if (!LLPipeline::sRenderingHUDs) + { + // first pass, render rigged objects only and render to depth buffer + forwardRender(true); + } // second pass, regular forward alpha rendering forwardRender(); @@ -222,54 +233,6 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass) deferred_render = FALSE; } -//set some generic parameters for forward (non-deferred) rendering -static void prepare_forward_shader(LLGLSLShader* shader, F32 minimum_alpha) -{ - shader->bind(); - shader->setMinimumAlpha(minimum_alpha); - shader->uniform1i(LLShaderMgr::NO_ATMO, LLPipeline::sRenderingHUDs ? 1 : 0); - - //also prepare rigged variant - if (shader->mRiggedVariant && shader->mRiggedVariant != shader) - { - prepare_forward_shader(shader->mRiggedVariant, minimum_alpha); - } -} - -void LLDrawPoolAlpha::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; - - simple_shader = (LLPipeline::sImpostorRender) ? &gObjectSimpleImpostorProgram : - (LLPipeline::sUnderWaterRender) ? &gObjectSimpleWaterProgram : &gObjectSimpleAlphaMaskProgram; - - fullbright_shader = (LLPipeline::sImpostorRender) ? &gObjectFullbrightAlphaMaskProgram : - (LLPipeline::sUnderWaterRender) ? &gObjectFullbrightWaterProgram : &gObjectFullbrightAlphaMaskProgram; - - emissive_shader = (LLPipeline::sImpostorRender) ? &gObjectEmissiveProgram : - (LLPipeline::sUnderWaterRender) ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; - - F32 minimum_alpha = MINIMUM_ALPHA; - if (LLPipeline::sImpostorRender) - { - minimum_alpha = MINIMUM_IMPOSTOR_ALPHA; - } - - prepare_forward_shader(fullbright_shader, minimum_alpha); - prepare_forward_shader(simple_shader, minimum_alpha); - - for (int i = 0; i < LLMaterial::SHADER_COUNT; ++i) - { - prepare_forward_shader(LLPipeline::sUnderWaterRender ? &gDeferredMaterialWaterProgram[i] : &gDeferredMaterialProgram[i], minimum_alpha); - } - - //first pass -- rigged only and drawn to depth buffer - forwardRender(true); - - //second pass -- non-rigged, no depth buffer writes - forwardRender(); -} - void LLDrawPoolAlpha::forwardRender(bool rigged) { gPipeline.enableLightsDynamic(); @@ -707,7 +670,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged) light_enabled = TRUE; } - if (deferred_render && mat) + if (LLPipeline::sRenderingHUDs) + { + target_shader = fullbright_shader; + } + else if (deferred_render && mat) { U32 mask = params.mShaderMask; diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 2c1ec30958..b6cf54a7dd 100644 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -58,7 +58,6 @@ public: /*virtual*/ void renderPostDeferred(S32 pass); /*virtual*/ S32 getNumPasses() { return 1; } - virtual void render(S32 pass = 0); void forwardRender(bool write_depth = false); /*virtual*/ void prerender(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8a3ab20ab4..9820202f9b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -520,14 +520,6 @@ void LLDrawPoolAvatar::beginRigid() { //eyeballs render with the specular shader sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); - if (LLPipeline::sRenderingHUDs) - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0); - } } } else @@ -586,14 +578,6 @@ void LLDrawPoolAvatar::beginDeferredRigid() sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); - if (LLPipeline::sRenderingHUDs) - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0); - } } void LLDrawPoolAvatar::endDeferredRigid() @@ -641,14 +625,6 @@ void LLDrawPoolAvatar::beginSkinned() sVertexProgram->bind(); sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); - if (LLPipeline::sRenderingHUDs) - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0); - } gGL.getTexUnit(0)->activate(); } else @@ -658,14 +634,6 @@ void LLDrawPoolAvatar::beginSkinned() // software skinning, use a basic shader for windlight. // TODO: find a better fallback method for software skinning. sVertexProgram->bind(); - if (LLPipeline::sRenderingHUDs) - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0); - } } } @@ -708,15 +676,6 @@ void LLDrawPoolAvatar::beginDeferredSkinned() sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); - if (LLPipeline::sRenderingHUDs) - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - sVertexProgram->uniform1i(LLShaderMgr::NO_ATMO, 0); - } - sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gGL.getTexUnit(0)->activate(); } diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index f5d0412993..965aa39338 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -210,90 +210,6 @@ S32 LLDrawPoolBump::numBumpPasses() return 1; } -S32 LLDrawPoolBump::getNumPasses() -{ - return numBumpPasses(); -} - -void LLDrawPoolBump::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP); - - if (!gPipeline.hasRenderType(LLDrawPool::POOL_SIMPLE)) - { - return; - } - - for (int i = 0; i < 2; ++i) - { - mRigged = i == 1; - - // first pass -- shiny - beginShiny(); - renderShiny(); - endShiny(); - - //second pass -- fullbright shiny - if (mShaderLevel > 1) - { - beginFullbrightShiny(); - renderFullbrightShiny(); - endFullbrightShiny(); - } - - //third pass -- bump - beginBump(); - renderBump(LLRenderPass::PASS_BUMP); - endBump(); - } -} - - -//static -void LLDrawPoolBump::beginShiny() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY); - - mShiny = TRUE; - sVertexMask = VERTEX_MASK_SHINY; - // Second pass: environment map - if (mShaderLevel > 1) - { - sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD0; - } - - if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectShinyWaterProgram; - } - else - { - shader = &gObjectShinyProgram; - } - - if (mRigged) - { - llassert(shader->mRiggedVariant); - shader = shader->mRiggedVariant; - } - - shader->bind(); - if (LLPipeline::sRenderingHUDs) - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 0); - } - - bindCubeMap(shader, mShaderLevel, diffuse_channel, cube_channel); - - if (mShaderLevel > 1) - { //indexed texture rendering, channel 0 is always diffuse - diffuse_channel = 0; - } -} //static void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel) @@ -342,38 +258,6 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di } } -void LLDrawPoolBump::renderShiny() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY); - - if( gSky.mVOSkyp->getCubeMap() && !LLPipeline::sReflectionProbesEnabled ) - { - LLGLEnable blend_enable(GL_BLEND); - if (mShaderLevel > 1) - { - if (mRigged) - { - LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_SHINY_RIGGED, true, true); - } - else - { - LLRenderPass::pushBatches(LLRenderPass::PASS_SHINY, true, true); - } - } - else - { - if (mRigged) - { - gPipeline.renderRiggedGroups(this, LLRenderPass::PASS_SHINY_RIGGED, true); - } - else - { - gPipeline.renderGroups(this, LLRenderPass::PASS_SHINY, true); - } - } - } -} - //static void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& diffuse_channel, S32& cube_channel) { @@ -399,21 +283,6 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& } } -void LLDrawPoolBump::endShiny() -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY); - - unbindCubeMap(shader, mShaderLevel, diffuse_channel, cube_channel); - if (shader) - { - shader->unbind(); - } - - diffuse_channel = -1; - cube_channel = 0; - mShiny = FALSE; -} - void LLDrawPoolBump::beginFullbrightShiny() { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY); @@ -421,22 +290,11 @@ void LLDrawPoolBump::beginFullbrightShiny() sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD0; // Second pass: environment map - - if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectFullbrightShinyWaterProgram; - } - else - { - if (LLPipeline::sRenderDeferred) - { - shader = &gDeferredFullbrightShinyProgram; - } - else - { - shader = &gObjectFullbrightShinyProgram; - } - } + shader = &gDeferredFullbrightShinyProgram; + if (LLPipeline::sRenderingHUDs) + { + shader = &gHUDFullbrightShinyProgram; + } if (mRigged) { @@ -466,15 +324,7 @@ void LLDrawPoolBump::beginFullbrightShiny() LLVector4(gGLModelView+8), LLVector4(gGLModelView+12)); shader->bind(); - if (LLPipeline::sRenderingHUDs) - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 0); - } - + LLVector3 vec = LLVector3(gShinyOrigin) * mat; LLVector4 vec4(vec, gShinyOrigin.mV[3]); shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV); @@ -682,18 +532,7 @@ void LLDrawPoolBump::endBump(U32 pass) S32 LLDrawPoolBump::getNumDeferredPasses() { -#if 0 //DEPRECATED -- RenderObjectBump should always be TRUE - if (gSavedSettings.getBOOL("RenderObjectBump")) - { - return 1; - } - else - { - return 0; - } -#else return 1; -#endif } void LLDrawPoolBump::renderDeferred(S32 pass) @@ -754,8 +593,11 @@ void LLDrawPoolBump::renderDeferred(S32 pass) void LLDrawPoolBump::renderPostDeferred(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL - for (int i = 0; i < 2; ++i) + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + + S32 num_passes = LLPipeline::sRenderingHUDs ? 1 : 2; // skip rigged pass when rendering HUDs + + for (int i = 0; i < num_passes; ++i) { // two passes -- static and rigged mRigged = (i == 1); @@ -1446,24 +1288,3 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_text } } -void LLDrawPoolInvisible::render(S32 pass) -{ //render invisiprims - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_INVISIBLE); - - if (gPipeline.shadersLoaded()) - { - gOcclusionProgram.bind(); - } - - U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; - //glStencilMask(0); //deprecated - gGL.setColorMask(false, false); - pushBatches(LLRenderPass::PASS_INVISIBLE, invisi_mask, FALSE); - gGL.setColorMask(true, false); - //glStencilMask(0xFFFFFFFF); //deprecated - - if (gPipeline.shadersLoaded()) - { - gOcclusionProgram.unbind(); - } -} diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h index 4400308451..840af0c99d 100644 --- a/indra/newview/lldrawpoolbump.h +++ b/indra/newview/lldrawpoolbump.h @@ -52,8 +52,6 @@ public: LLDrawPoolBump(); - virtual void render(S32 pass = 0) override; - virtual S32 getNumPasses() override; /*virtual*/ void prerender() override; void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false) override; @@ -62,10 +60,6 @@ public: S32 numBumpPasses(); - void beginShiny(); - void renderShiny(); - void endShiny(); - void beginFullbrightShiny(); void renderFullbrightShiny(); void endFullbrightShiny(); @@ -167,25 +161,4 @@ private: extern LLBumpImageList gBumpImageList; -class LLDrawPoolInvisible : public LLRenderPass -{ -public: - LLDrawPoolInvisible() : LLRenderPass(LLDrawPool::POOL_INVISIBLE) { } - - enum - { - VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX - }; - - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } - - virtual void prerender() { } - - virtual void render(S32 pass = 0); - virtual void beginRenderPass( S32 pass ) { } - virtual void endRenderPass( S32 pass ) { } - virtual S32 getNumPasses() {return 1;} -}; - - #endif // LL_LLDRAWPOOLBUMP_H diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp deleted file mode 100644 index 5b74264dab..0000000000 --- a/indra/newview/lldrawpoolground.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @file lldrawpoolground.cpp - * @brief LLDrawPoolGround class implementation - * - * $LicenseInfo:firstyear=2002&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 "llviewerprecompiledheaders.h" - -#include "lldrawpoolground.h" - -#include "llviewercontrol.h" - -#include "lldrawable.h" -#include "llface.h" -#include "llsky.h" -#include "llviewercamera.h" -#include "llviewerwindow.h" -#include "llworld.h" -#include "pipeline.h" -#include "llagent.h" -#include "llviewerregion.h" -#include "llviewershadermgr.h" - -LLDrawPoolGround::LLDrawPoolGround() : - LLFacePool(POOL_GROUND) -{ -} - -void LLDrawPoolGround::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); -} - -void LLDrawPoolGround::render(S32 pass) -{ - if (mDrawFace.empty() || !gSavedSettings.getBOOL("RenderGround")) - { - return; - } - - LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - F32 water_height = gAgent.getRegion()->getWaterHeight(); - gGL.pushMatrix(); - LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); - gGL.translatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height)); - - LLFace *facep = mDrawFace[0]; - - LLOverrideFaceColor col(this, gSky.mVOSkyp->getGLFogColor()); - facep->renderIndexed(); - - gGL.popMatrix(); -} - diff --git a/indra/newview/lldrawpoolground.h b/indra/newview/lldrawpoolground.h deleted file mode 100644 index 15b1dc60a2..0000000000 --- a/indra/newview/lldrawpoolground.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file lldrawpoolground.h - * @brief LLDrawPoolGround class definition - * - * $LicenseInfo:firstyear=2002&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$ - */ - -#ifndef LL_LLDRAWPOOLGROUND_H -#define LL_LLDRAWPOOLGROUND_H - -#include "lldrawpool.h" - - -class LLDrawPoolGround : public LLFacePool -{ -public: - enum - { - VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_TEXCOORD0 - }; - - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } - - LLDrawPoolGround(); - - /*virtual*/ void prerender(); - /*virtual*/ void render(S32 pass = 0); -}; - -#endif // LL_LLDRAWPOOLGROUND_H diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp index 735f32ddbb..6a7e05ac74 100644 --- a/indra/newview/lldrawpoolmaterials.cpp +++ b/indra/newview/lldrawpoolmaterials.cpp @@ -98,15 +98,6 @@ void LLDrawPoolMaterials::beginDeferredPass(S32 pass) } gPipeline.bindDeferredShader(*mShader); - - if (LLPipeline::sRenderingHUDs) - { - mShader->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - mShader->uniform1i(LLShaderMgr::NO_ATMO, 0); - } } void LLDrawPoolMaterials::endDeferredPass(S32 pass) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 7a8b2b4b35..3d92a2f348 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -46,15 +46,6 @@ static LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS_DEFERRED("Deferred Grass") static void setup_simple_shader(LLGLSLShader* shader) { shader->bind(); - - if (LLPipeline::sRenderingHUDs) - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - shader->uniform1i(LLShaderMgr::NO_ATMO, 0); - } } static void setup_glow_shader(LLGLSLShader* shader) @@ -79,13 +70,9 @@ static void setup_fullbright_shader(LLGLSLShader* shader) void LLDrawPoolGlow::renderPostDeferred(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW); - render(&gDeferredEmissiveProgram); -} + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; + LLGLSLShader* shader = &gDeferredEmissiveProgram; -void LLDrawPoolGlow::render(LLGLSLShader* shader) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); gGL.flush(); @@ -110,93 +97,11 @@ void LLDrawPoolGlow::render(LLGLSLShader* shader) gGL.setSceneBlendType(LLRender::BT_ALPHA); } -S32 LLDrawPoolGlow::getNumPasses() -{ - return 1; -} - -void LLDrawPoolGlow::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; - LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; - render(shader); -} - LLDrawPoolSimple::LLDrawPoolSimple() : LLRenderPass(POOL_SIMPLE) { } -void LLDrawPoolSimple::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - -S32 LLDrawPoolSimple::getNumPasses() -{ - return 1; -} - -void LLDrawPoolSimple::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE); - - LLGLDisable blend(GL_BLEND); - - LLGLSLShader* shader = nullptr; - if (LLPipeline::sImpostorRender) - { - shader = &gObjectSimpleImpostorProgram; - } - else if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectSimpleWaterProgram; - } - else - { - shader = &gObjectSimpleProgram; - } - - { //render simple - - gPipeline.enableLightsDynamic(); - - // first pass -- static objects - { - setup_simple_shader(shader); - pushBatches(LLRenderPass::PASS_SIMPLE, true, true); - - if (LLPipeline::sRenderDeferred) - { //if deferred rendering is enabled, bump faces aren't registered as simple - //render bump faces here as simple so bump faces will appear under water - pushBatches(LLRenderPass::PASS_BUMP, true, true); - pushBatches(LLRenderPass::PASS_MATERIAL, true, true); - pushBatches(LLRenderPass::PASS_SPECMAP, true, true); - pushBatches(LLRenderPass::PASS_NORMMAP, true, true); - pushBatches(LLRenderPass::PASS_NORMSPEC, true, true); - } - } - - //second pass, rigged - { - shader = shader->mRiggedVariant; - setup_simple_shader(shader); - pushRiggedBatches(LLRenderPass::PASS_SIMPLE_RIGGED, true, true); - - if (LLPipeline::sRenderDeferred) - { //if deferred rendering is enabled, bump faces aren't registered as simple - //render bump faces here as simple so bump faces will appear under water - pushRiggedBatches(LLRenderPass::PASS_BUMP_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_MATERIAL_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_SPECMAP_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_NORMMAP_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_NORMSPEC_RIGGED, true, true); - } - } - } -} - - static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK("Alpha Mask"); LLDrawPoolAlphaMask::LLDrawPoolAlphaMask() : @@ -204,76 +109,11 @@ LLDrawPoolAlphaMask::LLDrawPoolAlphaMask() : { } -void LLDrawPoolAlphaMask::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - -void LLDrawPoolAlphaMask::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; - LLGLDisable blend(GL_BLEND); - - LLGLSLShader* shader = nullptr; - if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectSimpleWaterAlphaMaskProgram; - } - else - { - shader = &gObjectSimpleAlphaMaskProgram; - } - - // render static - setup_simple_shader(shader); - pushMaskBatches(LLRenderPass::PASS_ALPHA_MASK, true, true); - pushMaskBatches(LLRenderPass::PASS_MATERIAL_ALPHA_MASK, true, true); - pushMaskBatches(LLRenderPass::PASS_SPECMAP_MASK, true, true); - pushMaskBatches(LLRenderPass::PASS_NORMMAP_MASK, true, true); - pushMaskBatches(LLRenderPass::PASS_NORMSPEC_MASK, true, true); - - // render rigged - setup_simple_shader(shader->mRiggedVariant); - pushRiggedMaskBatches(LLRenderPass::PASS_ALPHA_MASK_RIGGED, true, true); - pushRiggedMaskBatches(LLRenderPass::PASS_MATERIAL_ALPHA_MASK_RIGGED, true, true); - pushRiggedMaskBatches(LLRenderPass::PASS_SPECMAP_MASK_RIGGED, true, true); - pushRiggedMaskBatches(LLRenderPass::PASS_NORMMAP_MASK_RIGGED, true, true); - pushRiggedMaskBatches(LLRenderPass::PASS_NORMSPEC_MASK_RIGGED, true, true); -} - LLDrawPoolFullbrightAlphaMask::LLDrawPoolFullbrightAlphaMask() : LLRenderPass(POOL_FULLBRIGHT_ALPHA_MASK) { } -void LLDrawPoolFullbrightAlphaMask::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - -void LLDrawPoolFullbrightAlphaMask::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK); - - LLGLSLShader* shader = nullptr; - if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectFullbrightWaterAlphaMaskProgram; - } - else - { - shader = &gObjectFullbrightAlphaMaskProgram; - } - - // render static - setup_fullbright_shader(shader); - pushMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, true, true); - - // render rigged - setup_fullbright_shader(shader->mRiggedVariant); - pushRiggedMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK_RIGGED, true, true); -} - //=============================== //DEFERRED IMPLEMENTATION //=============================== @@ -322,102 +162,13 @@ LLDrawPoolGrass::LLDrawPoolGrass() : } -void LLDrawPoolGrass::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - - -void LLDrawPoolGrass::beginRenderPass(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS); - stop_glerror(); - - if (LLPipeline::sUnderWaterRender) - { - simple_shader = &gObjectAlphaMaskNonIndexedWaterProgram; - } - else - { - simple_shader = &gObjectAlphaMaskNonIndexedProgram; - } - - if (mShaderLevel > 0) - { - simple_shader->bind(); - simple_shader->setMinimumAlpha(0.5f); - if (LLPipeline::sRenderingHUDs) - { - simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - simple_shader->uniform1i(LLShaderMgr::NO_ATMO, 0); - } - } - else - { - gGL.flush(); - LLGLSLShader::unbind(); - } -} - -void LLDrawPoolGrass::endRenderPass(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS); - LLRenderPass::endRenderPass(pass); - - if (mShaderLevel > 0) - { - simple_shader->unbind(); - } - else - { - gGL.flush(); - } -} - -void LLDrawPoolGrass::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; - LLGLDisable blend(GL_BLEND); - - { - //LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS); - LLGLEnable test(GL_ALPHA_TEST); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - //render grass - LLRenderPass::pushBatches(LLRenderPass::PASS_GRASS, getVertexDataMask()); - } -} - -void LLDrawPoolGrass::beginDeferredPass(S32 pass) -{ - -} - -void LLDrawPoolGrass::endDeferredPass(S32 pass) -{ - -} - void LLDrawPoolGrass::renderDeferred(S32 pass) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; { - //LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS_DEFERRED); gDeferredNonIndexedDiffuseAlphaMaskProgram.bind(); gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f); - if (LLPipeline::sRenderingHUDs) - { - gDeferredNonIndexedDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 1); - } - else - { - gDeferredNonIndexedDiffuseAlphaMaskProgram.uniform1i(LLShaderMgr::NO_ATMO, 0); - } - //render grass LLRenderPass::pushBatches(LLRenderPass::PASS_GRASS, getVertexDataMask()); } @@ -430,18 +181,16 @@ LLDrawPoolFullbright::LLDrawPoolFullbright() : { } -void LLDrawPoolFullbright::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - - void LLDrawPoolFullbright::renderPostDeferred(S32 pass) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT); LLGLSLShader* shader = nullptr; - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderingHUDs) + { + shader = &gHUDFullbrightProgram; + } + else if (LLPipeline::sUnderWaterRender) { shader = &gDeferredFullbrightWaterProgram; } @@ -456,47 +205,12 @@ void LLDrawPoolFullbright::renderPostDeferred(S32 pass) setup_fullbright_shader(shader); pushBatches(LLRenderPass::PASS_FULLBRIGHT, true, true); - // render rigged - setup_fullbright_shader(shader->mRiggedVariant); - pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_RIGGED, true, true); -} - -void LLDrawPoolFullbright::render(S32 pass) -{ //render fullbright - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - stop_glerror(); - LLGLSLShader* shader = nullptr; - if (LLPipeline::sUnderWaterRender) - { - shader = &gObjectFullbrightWaterProgram; - } - else + if (!LLPipeline::sRenderingHUDs) { - shader = &gObjectFullbrightProgram; + // render rigged + setup_fullbright_shader(shader->mRiggedVariant); + pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_RIGGED, true, true); } - - // render static - setup_fullbright_shader(shader); - pushBatches(LLRenderPass::PASS_FULLBRIGHT, true, true); - pushBatches(LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE, true, true); - pushBatches(LLRenderPass::PASS_SPECMAP_EMISSIVE, true, true); - pushBatches(LLRenderPass::PASS_NORMMAP_EMISSIVE, true, true); - pushBatches(LLRenderPass::PASS_NORMSPEC_EMISSIVE, true, true); - - // render rigged - setup_fullbright_shader(shader->mRiggedVariant); - pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_SPECMAP_EMISSIVE_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_NORMMAP_EMISSIVE_RIGGED, true, true); - pushRiggedBatches(LLRenderPass::PASS_NORMSPEC_EMISSIVE_RIGGED, true, true); -} - -S32 LLDrawPoolFullbright::getNumPasses() -{ - return 1; } void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) @@ -506,32 +220,28 @@ void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) LLGLSLShader* shader = nullptr; if (LLPipeline::sRenderingHUDs) { - shader = &gDeferredFullbrightAlphaMaskProgram; + shader = &gHUDFullbrightAlphaMaskProgram; } - else if (LLPipeline::sRenderDeferred) + else if (LLPipeline::sUnderWaterRender) { - if (LLPipeline::sUnderWaterRender) - { - shader = &gDeferredFullbrightAlphaMaskWaterProgram; - } - else - { - shader = &gDeferredFullbrightAlphaMaskProgram; - } + shader = &gDeferredFullbrightAlphaMaskWaterProgram; } else { - shader = &gObjectFullbrightAlphaMaskProgram; + shader = &gDeferredFullbrightAlphaMaskProgram; } - LLGLDisable blend(GL_BLEND); + LLGLDisable blend(GL_BLEND); // render static setup_fullbright_shader(shader); pushMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, true, true); - // render rigged - setup_fullbright_shader(shader->mRiggedVariant); - pushRiggedMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK_RIGGED, true, true); + if (!LLPipeline::sRenderingHUDs) + { + // render rigged + setup_fullbright_shader(shader->mRiggedVariant); + pushRiggedMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK_RIGGED, true, true); + } } diff --git a/indra/newview/lldrawpoolsimple.h b/indra/newview/lldrawpoolsimple.h index cccbe5e495..dd817b7226 100644 --- a/indra/newview/lldrawpoolsimple.h +++ b/indra/newview/lldrawpoolsimple.h @@ -47,11 +47,6 @@ public: S32 getNumDeferredPasses() override; void renderDeferred(S32 pass) override; - - /// We need two passes so we can handle emissive materials separately. - S32 getNumPasses() override; - void render(S32 pass = 0) override; - void prerender() override; }; class LLDrawPoolGrass : public LLRenderPass @@ -68,17 +63,8 @@ public: LLDrawPoolGrass(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); - - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /// We need two passes so we can handle emissive materials separately. - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); + S32 getNumDeferredPasses() override { return 1; } + void renderDeferred(S32 pass) override; }; class LLDrawPoolAlphaMask : public LLRenderPass @@ -97,11 +83,6 @@ public: /*virtual*/ S32 getNumDeferredPasses() { return 1; } /*virtual*/ void renderDeferred(S32 pass); - - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); - }; class LLDrawPoolFullbrightAlphaMask : public LLRenderPass @@ -119,10 +100,6 @@ public: /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } /*virtual*/ void renderPostDeferred(S32 pass); - - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); }; @@ -139,13 +116,8 @@ public: LLDrawPoolFullbright(); - /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } - /*virtual*/ void renderPostDeferred(S32 pass); - - /*virtual*/ S32 getNumPasses(); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); - + S32 getNumPostDeferredPasses() override { return 1; } + void renderPostDeferred(S32 pass) override; }; class LLDrawPoolGlow : public LLRenderPass @@ -162,17 +134,8 @@ public: virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } - virtual void prerender() { } - - /*virtual*/ S32 getNumPostDeferredPasses() { return 1; } - /*virtual*/ void renderPostDeferred(S32 pass); - - void render(LLGLSLShader* shader); - - /*virtual*/ S32 getNumPasses(); - - void render(S32 pass = 0); - + S32 getNumPostDeferredPasses() override { return 1; } + void renderPostDeferred(S32 pass) override; }; #endif // LL_LLDRAWPOOLSIMPLE_H diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 61a8e20b54..7fa72abb5c 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -50,94 +50,6 @@ LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : mTexturep->setAddressMode(LLTexUnit::TAM_WRAP); } -void LLDrawPoolTree::prerender() -{ - mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); -} - -void LLDrawPoolTree::beginRenderPass(S32 pass) -{ - LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES); - - if (LLPipeline::sUnderWaterRender) - { - shader = &gTreeWaterProgram; - } - else - { - shader = &gTreeProgram; - } - - if (gPipeline.shadersLoaded()) - { - shader->bind(); - shader->setMinimumAlpha(0.5f); - gGL.diffuseColor4f(1,1,1,1); - } - else - { - gPipeline.enableLightsDynamic(); - gGL.flush(); - } -} - -void LLDrawPoolTree::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED; - - if (mDrawFace.empty()) - { - return; - } - - LLGLState test(GL_ALPHA_TEST, 0); - - gGL.getTexUnit(sDiffTex)->bindFast(mTexturep); - mTexturep->addTextureStats(1024.f * 1024.f); // <=== keep Linden tree textures at full res - - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); - iter != mDrawFace.end(); iter++) - { - LLFace *face = *iter; - LLVertexBuffer* buff = face->getVertexBuffer(); - - if(buff) - { - LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix); - - if (model_matrix != gGLLastMatrix) - { - gGLLastMatrix = model_matrix; - gGL.loadMatrix(gGLModelView); - if (model_matrix) - { - llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW); - gGL.multMatrix((GLfloat*) model_matrix->mMatrix); - } - gPipeline.mMatrixOpCount++; - } - - buff->setBuffer(); - buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); - } - } -} - -void LLDrawPoolTree::endRenderPass(S32 pass) -{ - LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES); - - if (gPipeline.canUseWindLightShadersOnObjects()) - { - shader->unbind(); - } - - if (mShaderLevel <= 0) - { - gGL.flush(); - } -} - //============================================ // deferred implementation //============================================ @@ -153,7 +65,44 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass) void LLDrawPoolTree::renderDeferred(S32 pass) { LL_PROFILE_ZONE_SCOPED; - render(pass); + LL_PROFILE_ZONE_SCOPED; + + if (mDrawFace.empty()) + { + return; + } + + LLGLState test(GL_ALPHA_TEST, 0); + + gGL.getTexUnit(sDiffTex)->bindFast(mTexturep); + mTexturep->addTextureStats(1024.f * 1024.f); // <=== keep Linden tree textures at full res + + for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); + iter != mDrawFace.end(); iter++) + { + LLFace* face = *iter; + LLVertexBuffer* buff = face->getVertexBuffer(); + + if (buff) + { + LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix); + + if (model_matrix != gGLLastMatrix) + { + gGLLastMatrix = model_matrix; + gGL.loadMatrix(gGLModelView); + if (model_matrix) + { + llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW); + gGL.multMatrix((GLfloat*)model_matrix->mMatrix); + } + gPipeline.mMatrixOpCount++; + } + + buff->setBuffer(); + buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts() - 1, buff->getNumIndices(), 0); + } + } } void LLDrawPoolTree::endDeferredPass(S32 pass) @@ -182,7 +131,7 @@ void LLDrawPoolTree::beginShadowPass(S32 pass) void LLDrawPoolTree::renderShadow(S32 pass) { - render(pass); + renderDeferred(pass); } void LLDrawPoolTree::endShadowPass(S32 pass) @@ -196,14 +145,6 @@ void LLDrawPoolTree::endShadowPass(S32 pass) BOOL LLDrawPoolTree::verify() const { -/* BOOL ok = TRUE; - - if (!ok) - { - printDebugInfo(); - } - return ok;*/ - return TRUE; } diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index 13f9ec8dce..496445692c 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -45,8 +45,6 @@ public: LLDrawPoolTree(LLViewerTexture *texturep); - /*virtual*/ void prerender(); - /*virtual*/ S32 getNumDeferredPasses() { return 1; } /*virtual*/ void beginDeferredPass(S32 pass); /*virtual*/ void endDeferredPass(S32 pass); @@ -57,10 +55,6 @@ public: /*virtual*/ void endShadowPass(S32 pass); /*virtual*/ void renderShadow(S32 pass); - /*virtual*/ void beginRenderPass( S32 pass ); - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ S32 getNumPasses() { return 1; } /*virtual*/ BOOL verify() const; /*virtual*/ LLViewerTexture *getTexture(); /*virtual*/ LLViewerTexture *getDebugTexture(); diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 9fe1b64d3d..8023435eba 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -69,51 +69,14 @@ LLViewerTexture *LLDrawPoolWLSky::getDebugTexture() return NULL; } -void LLDrawPoolWLSky::beginRenderPass( S32 pass ) -{ - sky_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gWLSkyProgram; - - cloud_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gWLCloudProgram; - - sun_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gWLSunProgram; - - moon_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gWLMoonProgram; -} - -void LLDrawPoolWLSky::endRenderPass( S32 pass ) -{ - sky_shader = nullptr; - cloud_shader = nullptr; - sun_shader = nullptr; - moon_shader = nullptr; -} - void LLDrawPoolWLSky::beginDeferredPass(S32 pass) { sky_shader = &gDeferredWLSkyProgram; cloud_shader = &gDeferredWLCloudProgram; - sun_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gDeferredWLSunProgram; + sun_shader = &gDeferredWLSunProgram; - moon_shader = - LLPipeline::sUnderWaterRender ? - &gObjectFullbrightNoColorWaterProgram : - &gDeferredWLMoonProgram; + moon_shader = &gDeferredWLMoonProgram; } void LLDrawPoolWLSky::endDeferredPass(S32 pass) @@ -124,11 +87,6 @@ void LLDrawPoolWLSky::endDeferredPass(S32 pass) moon_shader = nullptr; } -void LLDrawPoolWLSky::renderFsSky(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const -{ - gSky.mVOWLSkyp->drawFsSky(); -} - void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const { llassert_always(NULL != shader); @@ -213,74 +171,6 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca } } -void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightLocal) const -{ - LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); - - if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY)) - { - LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - LLGLSPipelineDepthTestSkyBox sky(true, false); - sky_shader->bind(); - sky_shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, 1); - sky_shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, psky->getSunMoonGlowFactor()); - renderDome(origin, camHeightLocal, sky_shader); - sky_shader->unbind(); - } -} - -void LLDrawPoolWLSky::renderStars(const LLVector3& camPosLocal) const -{ - LLGLSPipelineBlendSkyBox gls_skybox(true, false); - - // *NOTE: have to have bound the cloud noise texture already since register - // combiners blending below requires something to be bound - // and we might as well only bind once. - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - - // *NOTE: we divide by two here and GL_ALPHA_SCALE by two below to avoid - // clamping and allow the star_alpha param to brighten the stars. - LLColor4 star_alpha(LLColor4::black); - - star_alpha.mV[3] = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 512.f; - - // If star brightness is not set, exit - if( star_alpha.mV[3] < 0.001 ) - { - LL_DEBUGS("SKY") << "star_brightness below threshold." << LL_ENDL; - return; - } - - LLViewerTexture* tex_a = gSky.mVOSkyp->getBloomTex(); - LLViewerTexture* tex_b = gSky.mVOSkyp->getBloomTexNext(); - - if (tex_a && (!tex_b || (tex_a == tex_b))) - { - // Bind current and next sun textures - gGL.getTexUnit(0)->bind(tex_a); - } - else if (tex_b && !tex_a) - { - gGL.getTexUnit(0)->bind(tex_b); - } - else if (tex_b != tex_a) - { - gGL.getTexUnit(0)->bind(tex_a); - } - - gGL.pushMatrix(); - gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]); - gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); - gStarsProgram.bind(); - gStarsProgram.uniform1f(sCustomAlpha, star_alpha.mV[3]); - - gSky.mVOWLSkyp->drawStars(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.popMatrix(); - gStarsProgram.unbind(); // SL-14113 was gCustomAlphaProgram - } - void LLDrawPoolWLSky::renderStarsDeferred(const LLVector3& camPosLocal) const { if (!gSky.mVOSkyp) @@ -406,65 +296,10 @@ void LLDrawPoolWLSky::renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32 } } -void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const -{ - if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp && gSky.mVOSkyp->getCloudNoiseTex()) - { - LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - - LLGLSPipelineBlendSkyBox pipeline(true, true); - - cloudshader->bind(); - - LLPointer<LLViewerTexture> cloud_noise = gSky.mVOSkyp->getCloudNoiseTex(); - LLPointer<LLViewerTexture> cloud_noise_next = gSky.mVOSkyp->getCloudNoiseTexNext(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); - - F32 cloud_variance = psky ? psky->getCloudVariance() : 0.0f; - F32 blend_factor = psky ? psky->getBlendFactor() : 0.0f; - - // if we even have sun disc textures to work with... - if (cloud_noise || cloud_noise_next) - { - if (cloud_noise && (!cloud_noise_next || (cloud_noise == cloud_noise_next))) - { - // Bind current and next sun textures - cloudshader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, cloud_noise, LLTexUnit::TT_TEXTURE); - blend_factor = 0; - } - else if (cloud_noise_next && !cloud_noise) - { - cloudshader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, cloud_noise_next, LLTexUnit::TT_TEXTURE); - blend_factor = 0; - } - else if (cloud_noise_next != cloud_noise) - { - cloudshader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, cloud_noise, LLTexUnit::TT_TEXTURE); - cloudshader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, cloud_noise_next, LLTexUnit::TT_TEXTURE); - } - } - - cloudshader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); - cloudshader->uniform1f(LLShaderMgr::CLOUD_VARIANCE, cloud_variance); - cloudshader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, psky->getSunMoonGlowFactor()); - - /// Render the skydome - renderDome(camPosLocal, camHeightLocal, cloudshader); - - cloudshader->unbind(); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); - } -} - void LLDrawPoolWLSky::renderHeavenlyBodies() { if (!gSky.mVOSkyp) return; - //LLGLSPipelineBlendSkyBox gls_skybox(true, false); LLGLSPipelineBlendSkyBox gls_skybox(true, true); // SL-14113 we need moon to write to depth to clip stars behind LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); @@ -602,29 +437,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) gGL.setColorMask(true, true); } -void LLDrawPoolWLSky::render(S32 pass) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY); - if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY)) - { - return; - } - const F32 camHeightLocal = LLEnvironment::instance().getCamHeight(); - LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); - - renderSkyHaze(origin, camHeightLocal); - renderHeavenlyBodies(); - renderStars(origin); - renderSkyClouds(origin, camHeightLocal, cloud_shader); - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -} - -void LLDrawPoolWLSky::prerender() -{ - //LL_INFOS() << "wlsky prerendering pass." << LL_ENDL; -} LLViewerTexture* LLDrawPoolWLSky::getTexture() { diff --git a/indra/newview/lldrawpoolwlsky.h b/indra/newview/lldrawpoolwlsky.h index 324886ed42..c26d0a1e23 100644 --- a/indra/newview/lldrawpoolwlsky.h +++ b/indra/newview/lldrawpoolwlsky.h @@ -51,11 +51,6 @@ public: /*virtual*/ void renderDeferred(S32 pass); /*virtual*/ LLViewerTexture *getDebugTexture(); - /*virtual*/ void beginRenderPass( S32 pass ); - /*virtual*/ void endRenderPass( S32 pass ); - /*virtual*/ S32 getNumPasses() { return 1; } - /*virtual*/ void render(S32 pass = 0); - /*virtual*/ void prerender(); /*virtual*/ U32 getVertexDataMask() { return SKY_VERTEX_DATA_MASK; } /*virtual*/ BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct! /*virtual*/ S32 getShaderLevel() const { return mShaderLevel; } @@ -69,17 +64,12 @@ public: static void cleanupGL(); static void restoreGL(); private: - void renderFsSky(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const; void renderDome(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const; - void renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightLocal) const; - void renderSkyClouds(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const; - void renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 camHeightLocal) const; void renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const; void renderStarsDeferred(const LLVector3& camPosLocal) const; - void renderStars(const LLVector3& camPosLocal) const; void renderHeavenlyBodies(); }; diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index ac7dbcacaa..c5d49a81f1 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -85,7 +85,6 @@ void LLSky::cleanup() { mVOSkyp = NULL; mVOWLSkyp = NULL; - mVOGroundp = NULL; } void LLSky::destroyGL() @@ -114,12 +113,10 @@ void LLSky::restoreGL() void LLSky::resetVertexBuffers() { - if (gSky.mVOSkyp.notNull() && gSky.mVOGroundp.notNull()) + if (gSky.mVOSkyp.notNull()) { gPipeline.resetVertexBuffers(gSky.mVOSkyp->mDrawable); - gPipeline.resetVertexBuffers(gSky.mVOGroundp->mDrawable); gPipeline.markRebuild(gSky.mVOSkyp->mDrawable, LLDrawable::REBUILD_ALL, TRUE); - gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE); } if (gSky.mVOWLSkyp.notNull()) { @@ -208,9 +205,6 @@ void LLSky::init() mVOSkyp->init(); gPipeline.createObject(mVOSkyp.get()); - mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, NULL); - gPipeline.createObject(mVOGroundp.get()); - gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); mUpdatedThisFrame = TRUE; diff --git a/indra/newview/llsky.h b/indra/newview/llsky.h index ec0de1fbfd..cce645e2be 100644 --- a/indra/newview/llsky.h +++ b/indra/newview/llsky.h @@ -34,7 +34,6 @@ #include "v4color.h" #include "v4coloru.h" #include "llvosky.h" -#include "llvoground.h" class LLViewerCamera; @@ -88,7 +87,6 @@ public: public: LLPointer<LLVOSky> mVOSkyp; // Pointer to the LLVOSky object (only one, ever!) - LLPointer<LLVOGround> mVOGroundp; LLPointer<LLVOWLSky> mVOWLSkyp; protected: diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 32d76e690d..9f877ab5a9 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2845,8 +2845,7 @@ void renderTexelDensity(LLDrawable* drawable) } LLGLEnable _(GL_BLEND); - //gObjectFullbrightProgram.bind(); - + LLMatrix4 checkerboard_matrix; S32 discard_level = -1; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 80ba54ab6c..a0c7afa1bd 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -642,7 +642,6 @@ bool LLToolPie::walkToClickedLocation() mPick = saved_pick; return false; } - return true; } bool LLToolPie::teleportToClickedLocation() diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 5ddd8c78f7..3ecbc73c2d 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -171,8 +171,7 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) if (!status) { gPipeline.clearRenderTypeMask(LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::RENDER_TYPE_GROUND, - LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_GRASS, LLPipeline::RENDER_TYPE_TREE, LLPipeline::RENDER_TYPE_WATER, @@ -186,7 +185,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) else { gPipeline.setRenderTypeMask(LLPipeline::RENDER_TYPE_WL_SKY, - LLPipeline::RENDER_TYPE_GROUND, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_GRASS, LLPipeline::RENDER_TYPE_TREE, diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bc722f496f..5a3f2f22b8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -764,10 +764,6 @@ U32 render_type_from_string(std::string render_type) { return LLPipeline::RENDER_TYPE_WATER; } - else if ("ground" == render_type) - { - return LLPipeline::RENDER_TYPE_GROUND; - } else if ("volume" == render_type) { return LLPipeline::RENDER_TYPE_VOLUME; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9492604d7d..fa7d829784 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -84,7 +84,6 @@ #include "llvoavatar.h" #include "llvoavatarself.h" #include "llvograss.h" -#include "llvoground.h" #include "llvolume.h" #include "llvolumemessage.h" #include "llvopartgroup.h" @@ -163,7 +162,6 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco && pcode != LL_VO_VOID_WATER && pcode != LL_VO_WL_SKY && pcode != LL_VO_SKY - && pcode != LL_VO_GROUND && pcode != LL_VO_PART_GROUP ) { @@ -235,8 +233,6 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco res = new LLVOVoidWater(id, pcode, regionp); break; case LL_VO_WATER: res = new LLVOWater(id, pcode, regionp); break; - case LL_VO_GROUND: - res = new LLVOGround(id, pcode, regionp); break; case LL_VO_PART_GROUP: res = new LLVOPartGroup(id, pcode, regionp); break; case LL_VO_HUD_PART_GROUP: diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 93b17361ab..560c51139b 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -672,7 +672,6 @@ public: LL_VO_SKY = LL_PCODE_APP | 0x60, LL_VO_VOID_WATER = LL_PCODE_APP | 0x70, LL_VO_WATER = LL_PCODE_APP | 0x80, - LL_VO_GROUND = LL_PCODE_APP | 0x90, LL_VO_PART_GROUP = LL_PCODE_APP | 0xa0, LL_VO_TRIANGLE_TORUS = LL_PCODE_APP | 0xb0, LL_VO_HUD_PART_GROUP = LL_PCODE_APP | 0xc0, diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 90b06fa133..3c2208c727 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -97,49 +97,12 @@ LLGLSLShader gCopyProgram; LLGLSLShader gCopyDepthProgram; //object shaders -LLGLSLShader gObjectSimpleProgram; -LLGLSLShader gSkinnedObjectSimpleProgram; -LLGLSLShader gObjectSimpleImpostorProgram; -LLGLSLShader gSkinnedObjectSimpleImpostorProgram; LLGLSLShader gObjectPreviewProgram; LLGLSLShader gPhysicsPreviewProgram; -LLGLSLShader gObjectSimpleWaterProgram; -LLGLSLShader gSkinnedObjectSimpleWaterProgram; -LLGLSLShader gObjectSimpleAlphaMaskProgram; -LLGLSLShader gSkinnedObjectSimpleAlphaMaskProgram; -LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; -LLGLSLShader gSkinnedObjectSimpleWaterAlphaMaskProgram; -LLGLSLShader gObjectFullbrightProgram; -LLGLSLShader gSkinnedObjectFullbrightProgram; -LLGLSLShader gObjectFullbrightWaterProgram; -LLGLSLShader gSkinnedObjectFullbrightWaterProgram; -LLGLSLShader gObjectEmissiveProgram; -LLGLSLShader gSkinnedObjectEmissiveProgram; -LLGLSLShader gObjectEmissiveWaterProgram; -LLGLSLShader gSkinnedObjectEmissiveWaterProgram; LLGLSLShader gObjectFullbrightAlphaMaskProgram; LLGLSLShader gSkinnedObjectFullbrightAlphaMaskProgram; -LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; -LLGLSLShader gSkinnedObjectFullbrightWaterAlphaMaskProgram; -LLGLSLShader gObjectFullbrightShinyProgram; -LLGLSLShader gSkinnedObjectFullbrightShinyProgram; -LLGLSLShader gObjectFullbrightShinyWaterProgram; -LLGLSLShader gSkinnedObjectFullbrightShinyWaterProgram; -LLGLSLShader gObjectShinyProgram; -LLGLSLShader gSkinnedObjectShinyProgram; -LLGLSLShader gObjectShinyWaterProgram; -LLGLSLShader gSkinnedObjectShinyWaterProgram; LLGLSLShader gObjectBumpProgram; LLGLSLShader gSkinnedObjectBumpProgram; -LLGLSLShader gTreeProgram; -LLGLSLShader gTreeWaterProgram; -LLGLSLShader gObjectFullbrightNoColorProgram; -LLGLSLShader gObjectFullbrightNoColorWaterProgram; - -LLGLSLShader gObjectSimpleNonIndexedTexGenProgram; -LLGLSLShader gObjectSimpleNonIndexedTexGenWaterProgram; -LLGLSLShader gObjectAlphaMaskNonIndexedProgram; -LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; LLGLSLShader gObjectAlphaMaskNoColorProgram; LLGLSLShader gObjectAlphaMaskNoColorWaterProgram; @@ -224,6 +187,7 @@ LLGLSLShader gDeferredAvatarShadowProgram; LLGLSLShader gDeferredAvatarAlphaShadowProgram; LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; LLGLSLShader gDeferredAlphaProgram; +LLGLSLShader gHUDAlphaProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; LLGLSLShader gDeferredAlphaImpostorProgram; LLGLSLShader gDeferredSkinnedAlphaImpostorProgram; @@ -231,8 +195,11 @@ LLGLSLShader gDeferredAlphaWaterProgram; LLGLSLShader gDeferredSkinnedAlphaWaterProgram; LLGLSLShader gDeferredAvatarEyesProgram; LLGLSLShader gDeferredFullbrightProgram; +LLGLSLShader gHUDFullbrightProgram; LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +LLGLSLShader gHUDFullbrightAlphaMaskProgram; LLGLSLShader gDeferredFullbrightAlphaMaskAlphaProgram; +LLGLSLShader gHUDFullbrightAlphaMaskAlphaProgram; LLGLSLShader gDeferredFullbrightWaterProgram; LLGLSLShader gDeferredSkinnedFullbrightWaterProgram; LLGLSLShader gDeferredFullbrightWaterAlphaProgram; @@ -253,6 +220,7 @@ LLGLSLShader gDeferredWLSunProgram; LLGLSLShader gDeferredWLMoonProgram; LLGLSLShader gDeferredStarProgram; LLGLSLShader gDeferredFullbrightShinyProgram; +LLGLSLShader gHUDFullbrightShinyProgram; LLGLSLShader gDeferredSkinnedFullbrightShinyProgram; LLGLSLShader gDeferredSkinnedFullbrightProgram; LLGLSLShader gDeferredSkinnedFullbrightAlphaMaskProgram; @@ -295,69 +263,37 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWLSunProgram); mShaderList.push_back(&gWLMoonProgram); mShaderList.push_back(&gAvatarProgram); - mShaderList.push_back(&gObjectShinyProgram); - mShaderList.push_back(&gSkinnedObjectShinyProgram); mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gWaterEdgeProgram); mShaderList.push_back(&gAvatarEyeballProgram); - mShaderList.push_back(&gObjectSimpleProgram); - mShaderList.push_back(&gSkinnedObjectSimpleProgram); - mShaderList.push_back(&gObjectSimpleImpostorProgram); - mShaderList.push_back(&gSkinnedObjectSimpleImpostorProgram); mShaderList.push_back(&gObjectPreviewProgram); mShaderList.push_back(&gImpostorProgram); - mShaderList.push_back(&gObjectFullbrightNoColorProgram); - mShaderList.push_back(&gObjectFullbrightNoColorWaterProgram); - mShaderList.push_back(&gObjectSimpleAlphaMaskProgram); - mShaderList.push_back(&gSkinnedObjectSimpleAlphaMaskProgram); mShaderList.push_back(&gObjectBumpProgram); mShaderList.push_back(&gSkinnedObjectBumpProgram); - mShaderList.push_back(&gObjectEmissiveProgram); - mShaderList.push_back(&gSkinnedObjectEmissiveProgram); - mShaderList.push_back(&gObjectEmissiveWaterProgram); - mShaderList.push_back(&gSkinnedObjectEmissiveWaterProgram); - mShaderList.push_back(&gObjectFullbrightProgram); - mShaderList.push_back(&gSkinnedObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightAlphaMaskProgram); mShaderList.push_back(&gSkinnedObjectFullbrightAlphaMaskProgram); - mShaderList.push_back(&gObjectFullbrightShinyProgram); - mShaderList.push_back(&gSkinnedObjectFullbrightShinyProgram); - mShaderList.push_back(&gObjectFullbrightShinyWaterProgram); - mShaderList.push_back(&gSkinnedObjectFullbrightShinyWaterProgram); - mShaderList.push_back(&gObjectSimpleNonIndexedTexGenProgram); - mShaderList.push_back(&gObjectSimpleNonIndexedTexGenWaterProgram); - mShaderList.push_back(&gObjectAlphaMaskNonIndexedProgram); - mShaderList.push_back(&gObjectAlphaMaskNonIndexedWaterProgram); mShaderList.push_back(&gObjectAlphaMaskNoColorProgram); mShaderList.push_back(&gObjectAlphaMaskNoColorWaterProgram); - mShaderList.push_back(&gTreeProgram); - mShaderList.push_back(&gTreeWaterProgram); mShaderList.push_back(&gTerrainProgram); mShaderList.push_back(&gTerrainWaterProgram); - mShaderList.push_back(&gObjectSimpleWaterProgram); - mShaderList.push_back(&gSkinnedObjectSimpleWaterProgram); - mShaderList.push_back(&gObjectFullbrightWaterProgram); - mShaderList.push_back(&gSkinnedObjectFullbrightWaterProgram); - mShaderList.push_back(&gObjectSimpleWaterAlphaMaskProgram); - mShaderList.push_back(&gSkinnedObjectSimpleWaterAlphaMaskProgram); - mShaderList.push_back(&gObjectFullbrightWaterAlphaMaskProgram); - mShaderList.push_back(&gSkinnedObjectFullbrightWaterAlphaMaskProgram); mShaderList.push_back(&gAvatarWaterProgram); - mShaderList.push_back(&gObjectShinyWaterProgram); - mShaderList.push_back(&gSkinnedObjectShinyWaterProgram); mShaderList.push_back(&gUnderWaterProgram); mShaderList.push_back(&gDeferredSunProgram); mShaderList.push_back(&gDeferredSoftenProgram); mShaderList.push_back(&gDeferredSoftenWaterProgram); mShaderList.push_back(&gDeferredAlphaProgram); + mShaderList.push_back(&gHUDAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredAlphaImpostorProgram); mShaderList.push_back(&gDeferredSkinnedAlphaImpostorProgram); mShaderList.push_back(&gDeferredAlphaWaterProgram); mShaderList.push_back(&gDeferredSkinnedAlphaWaterProgram); mShaderList.push_back(&gDeferredFullbrightProgram); + mShaderList.push_back(&gHUDFullbrightProgram); mShaderList.push_back(&gDeferredFullbrightAlphaMaskProgram); + mShaderList.push_back(&gHUDFullbrightAlphaMaskProgram); mShaderList.push_back(&gDeferredFullbrightAlphaMaskAlphaProgram); + mShaderList.push_back(&gHUDFullbrightAlphaMaskAlphaProgram); mShaderList.push_back(&gDeferredFullbrightWaterProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightWaterProgram); mShaderList.push_back(&gDeferredFullbrightWaterAlphaProgram); @@ -365,6 +301,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredFullbrightAlphaMaskWaterProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightAlphaMaskWaterProgram); mShaderList.push_back(&gDeferredFullbrightShinyProgram); + mShaderList.push_back(&gHUDFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightAlphaMaskProgram); @@ -682,54 +619,17 @@ void LLViewerShaderMgr::unloadShaders() gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); - gObjectFullbrightNoColorProgram.unload(); - gObjectFullbrightNoColorWaterProgram.unload(); - gObjectSimpleProgram.unload(); - gSkinnedObjectSimpleProgram.unload(); - gObjectSimpleImpostorProgram.unload(); - gSkinnedObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); gPhysicsPreviewProgram.unload(); gImpostorProgram.unload(); - gObjectSimpleAlphaMaskProgram.unload(); - gSkinnedObjectSimpleAlphaMaskProgram.unload(); gObjectBumpProgram.unload(); gSkinnedObjectBumpProgram.unload(); - gObjectSimpleWaterProgram.unload(); - gSkinnedObjectSimpleWaterProgram.unload(); - gObjectSimpleWaterAlphaMaskProgram.unload(); - gSkinnedObjectSimpleWaterAlphaMaskProgram.unload(); - gObjectFullbrightProgram.unload(); - gSkinnedObjectFullbrightProgram.unload(); - gObjectFullbrightWaterProgram.unload(); - gSkinnedObjectFullbrightWaterProgram.unload(); - gObjectEmissiveProgram.unload(); - gSkinnedObjectEmissiveProgram.unload(); - gObjectEmissiveWaterProgram.unload(); - gSkinnedObjectEmissiveWaterProgram.unload(); gObjectFullbrightAlphaMaskProgram.unload(); gSkinnedObjectFullbrightAlphaMaskProgram.unload(); - gObjectFullbrightWaterAlphaMaskProgram.unload(); - gSkinnedObjectFullbrightWaterAlphaMaskProgram.unload(); - - gObjectShinyProgram.unload(); - gSkinnedObjectShinyProgram.unload(); - gObjectFullbrightShinyProgram.unload(); - gSkinnedObjectFullbrightShinyProgram.unload(); - gObjectFullbrightShinyWaterProgram.unload(); - gSkinnedObjectFullbrightShinyWaterProgram.unload(); - gObjectShinyWaterProgram.unload(); - gSkinnedObjectShinyWaterProgram.unload(); - - gObjectSimpleNonIndexedTexGenProgram.unload(); - gObjectSimpleNonIndexedTexGenWaterProgram.unload(); - gObjectAlphaMaskNonIndexedProgram.unload(); - gObjectAlphaMaskNonIndexedWaterProgram.unload(); + gObjectAlphaMaskNoColorProgram.unload(); gObjectAlphaMaskNoColorWaterProgram.unload(); - gTreeProgram.unload(); - gTreeWaterProgram.unload(); - + gWaterProgram.unload(); gWaterEdgeProgram.unload(); gUnderWaterProgram.unload(); @@ -925,10 +825,6 @@ std::string LLViewerShaderMgr::loadBasicShaders() index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightWaterAlphaMaskNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightWaterNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightShinyNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightShinyNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightShinyWaterNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); @@ -937,10 +833,6 @@ std::string LLViewerShaderMgr::loadBasicShaders() index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightWaterAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightWaterF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightWaterAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyWaterF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); - index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterF.glsl", mShaderLevel[SHADER_LIGHTING] ) ); for (U32 i = 0; i < shaders.size(); i++) { @@ -1264,12 +1156,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.unload(); gDeferredAvatarAlphaProgram.unload(); gDeferredAlphaProgram.unload(); + gHUDAlphaProgram.unload(); gDeferredSkinnedAlphaProgram.unload(); gDeferredAlphaWaterProgram.unload(); gDeferredSkinnedAlphaWaterProgram.unload(); gDeferredFullbrightProgram.unload(); + gHUDFullbrightProgram.unload(); gDeferredFullbrightAlphaMaskProgram.unload(); + gHUDFullbrightAlphaMaskProgram.unload(); gDeferredFullbrightAlphaMaskAlphaProgram.unload(); + gHUDFullbrightAlphaMaskAlphaProgram.unload(); gDeferredFullbrightWaterProgram.unload(); gDeferredSkinnedFullbrightWaterProgram.unload(); gDeferredFullbrightWaterAlphaProgram.unload(); @@ -1292,6 +1188,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLMoonProgram.unload(); gDeferredStarProgram.unload(); gDeferredFullbrightShinyProgram.unload(); + gHUDFullbrightShinyProgram.unload(); gDeferredSkinnedFullbrightShinyProgram.unload(); gDeferredSkinnedFullbrightProgram.unload(); gDeferredSkinnedFullbrightAlphaMaskProgram.unload(); @@ -1935,11 +1832,18 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - for (int i = 0; i < 2 && success; ++i) + for (int i = 0; i < 3 && success; ++i) { LLGLSLShader* shader = nullptr; - bool rigged = i == 1; - if (!rigged) + bool rigged = (i == 1); + bool hud = (i == 2); + + if (hud) + { + shader = &gHUDAlphaProgram; + shader->mName = "HUD Alpha Shader"; + } + else if (!rigged) { shader = &gDeferredAlphaProgram; shader->mName = "Deferred Alpha Shader"; @@ -2000,6 +1904,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() shader->addPermutation("HAS_SKIN", "1"); } + if (hud) + { + shader->addPermutation("IS_HUD", "1"); + } + shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = shader->createShader(NULL, NULL); @@ -2185,6 +2094,24 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gHUDFullbrightProgram.mName = "HUD Fullbright Shader"; + gHUDFullbrightProgram.mFeatures.calculatesAtmospherics = true; + gHUDFullbrightProgram.mFeatures.hasGamma = true; + gHUDFullbrightProgram.mFeatures.hasTransport = true; + gHUDFullbrightProgram.mFeatures.hasSrgb = true; + gHUDFullbrightProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gHUDFullbrightProgram.mShaderFiles.clear(); + gHUDFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gHUDFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gHUDFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gHUDFullbrightProgram.clearPermutations(); + gHUDFullbrightProgram.addPermutation("IS_HUD", "1"); + success = gHUDFullbrightProgram.createShader(NULL, NULL); + llassert(success); + } + if (success) { gDeferredFullbrightAlphaMaskProgram.mName = "Deferred Fullbright Alpha Masking Shader"; @@ -2206,6 +2133,25 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gHUDFullbrightAlphaMaskProgram.mName = "HUD Fullbright Alpha Masking Shader"; + gHUDFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gHUDFullbrightAlphaMaskProgram.mFeatures.hasGamma = true; + gHUDFullbrightAlphaMaskProgram.mFeatures.hasTransport = true; + gHUDFullbrightAlphaMaskProgram.mFeatures.hasSrgb = true; + gHUDFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gHUDFullbrightAlphaMaskProgram.mShaderFiles.clear(); + gHUDFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gHUDFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gHUDFullbrightAlphaMaskProgram.clearPermutations(); + gHUDFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK", "1"); + gHUDFullbrightAlphaMaskProgram.addPermutation("IS_HUD", "1"); + gHUDFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = gHUDFullbrightAlphaMaskProgram.createShader(NULL, NULL); + llassert(success); + } + + if (success) + { gDeferredFullbrightAlphaMaskAlphaProgram.mName = "Deferred Fullbright Alpha Masking Alpha Shader"; gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightAlphaMaskAlphaProgram.mFeatures.hasGamma = true; @@ -2225,6 +2171,27 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gHUDFullbrightAlphaMaskAlphaProgram.mName = "HUD Fullbright Alpha Masking Alpha Shader"; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.calculatesAtmospherics = true; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.hasGamma = true; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.hasTransport = true; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.hasSrgb = true; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.isDeferred = true; + gHUDFullbrightAlphaMaskAlphaProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gHUDFullbrightAlphaMaskAlphaProgram.mShaderFiles.clear(); + gHUDFullbrightAlphaMaskAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gHUDFullbrightAlphaMaskAlphaProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); + gHUDFullbrightAlphaMaskAlphaProgram.clearPermutations(); + gHUDFullbrightAlphaMaskAlphaProgram.addPermutation("HAS_ALPHA_MASK", "1"); + gHUDFullbrightAlphaMaskAlphaProgram.addPermutation("IS_ALPHA", "1"); + gHUDFullbrightAlphaMaskAlphaProgram.addPermutation("IS_HUD", "1"); + gHUDFullbrightAlphaMaskAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = success && gHUDFullbrightAlphaMaskAlphaProgram.createShader(NULL, NULL); + llassert(success); + } + if (success) { gDeferredFullbrightWaterProgram.mName = "Deferred Fullbright Underwater Shader"; @@ -2308,6 +2275,26 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gHUDFullbrightShinyProgram.mName = "Deferred FullbrightShiny Shader"; + gHUDFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; + gHUDFullbrightShinyProgram.mFeatures.hasAtmospherics = true; + gHUDFullbrightShinyProgram.mFeatures.hasGamma = true; + gHUDFullbrightShinyProgram.mFeatures.hasTransport = true; + gHUDFullbrightShinyProgram.mFeatures.hasSrgb = true; + gHUDFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gHUDFullbrightShinyProgram.mShaderFiles.clear(); + gHUDFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); + gHUDFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); + gHUDFullbrightShinyProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gHUDFullbrightShinyProgram.mFeatures.hasReflectionProbes = true; + gHUDFullbrightShinyProgram.clearPermutations(); + gHUDFullbrightShinyProgram.addPermutation("IS_HUD", "1"); + success = gHUDFullbrightShinyProgram.createShader(NULL, NULL); + llassert(success); + } + if (success) { gDeferredEmissiveProgram.mName = "Deferred Emissive Shader"; @@ -2961,129 +2948,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() } } - if (success) - { - gObjectSimpleProgram.mName = "Simple Shader"; - gObjectSimpleProgram.mFeatures.calculatesLighting = true; - gObjectSimpleProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleProgram.mFeatures.hasGamma = true; - gObjectSimpleProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleProgram.mFeatures.hasLighting = true; - gObjectSimpleProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleProgram.mShaderFiles.clear(); - gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectSimpleProgram, gSkinnedObjectSimpleProgram); - success = success && gObjectSimpleProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightProgram.mName = "Fullbright Shader"; - gObjectFullbrightProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightProgram.mFeatures.hasGamma = true; - gObjectFullbrightProgram.mFeatures.hasTransport = true; - gObjectFullbrightProgram.mFeatures.isFullbright = true; - gObjectFullbrightProgram.mFeatures.hasSrgb = true; - gObjectFullbrightProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectFullbrightProgram.mShaderFiles.clear(); - gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectFullbrightProgram, gSkinnedObjectFullbrightProgram); - success = success && gObjectFullbrightProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightShinyWaterProgram.mName = "Fullbright Shiny Water Shader"; - gObjectFullbrightShinyWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightShinyWaterProgram.mFeatures.isFullbright = true; - gObjectFullbrightShinyWaterProgram.mFeatures.isShiny = true; - gObjectFullbrightShinyWaterProgram.mFeatures.hasGamma = true; - gObjectFullbrightShinyWaterProgram.mFeatures.hasTransport = true; - gObjectFullbrightShinyWaterProgram.mFeatures.hasWaterFog = true; - gObjectFullbrightShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectFullbrightShinyWaterProgram.mShaderFiles.clear(); - gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightShinyWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectFullbrightShinyWaterProgram, gSkinnedObjectFullbrightShinyWaterProgram); - success = success && gObjectFullbrightShinyWaterProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectSimpleNonIndexedTexGenProgram.mName = "Non indexed tex-gen Shader"; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesLighting = true; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasGamma = true; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasLighting = true; - gObjectSimpleNonIndexedTexGenProgram.mFeatures.disableTextureIndex = true; - gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.clear(); - gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleNonIndexedTexGenProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = gObjectSimpleNonIndexedTexGenProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectSimpleNonIndexedTexGenWaterProgram.mName = "Non indexed tex-gen Water Shader"; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesLighting = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasWaterFog = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasLighting = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.disableTextureIndex = true; - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.clear(); - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(NULL, NULL); - } - -#if 1 // DEPRECATED -- forward rendering is deprecated - - if (success) - { - gObjectAlphaMaskNonIndexedProgram.mName = "Non indexed alpha mask Shader"; - gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesLighting = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.calculatesAtmospherics = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.hasGamma = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAtmospherics = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.hasLighting = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.disableTextureIndex = true; - gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAlphaMask = true; - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER)); - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectAlphaMaskNonIndexedWaterProgram.mName = "Non indexed alpha mask Water Shader"; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.calculatesLighting = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasWaterFog = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAtmospherics = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasLighting = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.disableTextureIndex = true; - gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAlphaMask = true; - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER)); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(NULL, NULL); - } - if (success) { gObjectAlphaMaskNoColorProgram.mName = "No color alpha mask Shader"; @@ -3121,73 +2985,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { - gTreeProgram.mName = "Tree Shader"; - gTreeProgram.mFeatures.calculatesLighting = true; - gTreeProgram.mFeatures.calculatesAtmospherics = true; - gTreeProgram.mFeatures.hasGamma = true; - gTreeProgram.mFeatures.hasAtmospherics = true; - gTreeProgram.mFeatures.hasLighting = true; - gTreeProgram.mFeatures.disableTextureIndex = true; - gTreeProgram.mFeatures.hasAlphaMask = true; - gTreeProgram.mShaderFiles.clear(); - gTreeProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER)); - gTreeProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gTreeProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = gTreeProgram.createShader(NULL, NULL); - } - - if (success) - { - gTreeWaterProgram.mName = "Tree Water Shader"; - gTreeWaterProgram.mFeatures.calculatesLighting = true; - gTreeWaterProgram.mFeatures.calculatesAtmospherics = true; - gTreeWaterProgram.mFeatures.hasWaterFog = true; - gTreeWaterProgram.mFeatures.hasAtmospherics = true; - gTreeWaterProgram.mFeatures.hasLighting = true; - gTreeWaterProgram.mFeatures.disableTextureIndex = true; - gTreeWaterProgram.mFeatures.hasAlphaMask = true; - gTreeWaterProgram.mShaderFiles.clear(); - gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER)); - gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); - gTreeWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gTreeWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gTreeWaterProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightNoColorProgram.mName = "Non Indexed no color Fullbright Shader"; - gObjectFullbrightNoColorProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightNoColorProgram.mFeatures.hasGamma = true; - gObjectFullbrightNoColorProgram.mFeatures.hasTransport = true; - gObjectFullbrightNoColorProgram.mFeatures.isFullbright = true; - gObjectFullbrightNoColorProgram.mFeatures.hasSrgb = true; - gObjectFullbrightNoColorProgram.mFeatures.disableTextureIndex = true; - gObjectFullbrightNoColorProgram.mShaderFiles.clear(); - gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightNoColorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightNoColorProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightNoColorWaterProgram.mName = "Non Indexed no color Fullbright Water Shader"; - gObjectFullbrightNoColorWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightNoColorWaterProgram.mFeatures.isFullbright = true; - gObjectFullbrightNoColorWaterProgram.mFeatures.hasWaterFog = true; - gObjectFullbrightNoColorWaterProgram.mFeatures.hasTransport = true; - gObjectFullbrightNoColorWaterProgram.mFeatures.disableTextureIndex = true; - gObjectFullbrightNoColorWaterProgram.mShaderFiles.clear(); - gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightNoColorWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectFullbrightNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightNoColorWaterProgram.createShader(NULL, NULL); - } - - if (success) - { gImpostorProgram.mName = "Impostor Shader"; gImpostorProgram.mFeatures.disableTextureIndex = true; gImpostorProgram.mFeatures.hasSrgb = true; @@ -3236,133 +3033,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { - gObjectSimpleImpostorProgram.mName = "Simple Impostor Shader"; - gObjectSimpleImpostorProgram.mFeatures.calculatesLighting = true; - gObjectSimpleImpostorProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleImpostorProgram.mFeatures.hasGamma = true; - gObjectSimpleImpostorProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleImpostorProgram.mFeatures.hasLighting = true; - gObjectSimpleImpostorProgram.mFeatures.mIndexedTextureChannels = 0; - // force alpha mask version of lighting so we can weed out - // transparent pixels from impostor temp buffer - // - gObjectSimpleImpostorProgram.mFeatures.hasAlphaMask = true; - gObjectSimpleImpostorProgram.mShaderFiles.clear(); - gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleImpostorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectSimpleImpostorProgram, gSkinnedObjectSimpleImpostorProgram); - success = success && gObjectSimpleImpostorProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectSimpleWaterProgram.mName = "Simple Water Shader"; - gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; - gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; - gObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleWaterProgram.mFeatures.hasLighting = true; - gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleWaterProgram.mShaderFiles.clear(); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - make_rigged_variant(gObjectSimpleWaterProgram, gSkinnedObjectSimpleWaterProgram); - success = gObjectSimpleWaterProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectSimpleAlphaMaskProgram.mName = "Simple Alpha Mask Shader"; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasGamma = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasLighting = true; - gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; - gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectSimpleAlphaMaskProgram, gSkinnedObjectSimpleAlphaMaskProgram); - success = success && gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectSimpleWaterAlphaMaskProgram.mName = "Simple Water Alpha Mask Shader"; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.calculatesLighting = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasWaterFog = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasAtmospherics = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasLighting = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; - gObjectSimpleWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); - gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectSimpleWaterAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectSimpleWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectSimpleWaterAlphaMaskProgram, gSkinnedObjectSimpleWaterAlphaMaskProgram); - success = success && gObjectSimpleWaterAlphaMaskProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightWaterProgram.mName = "Fullbright Water Shader"; - gObjectFullbrightWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightWaterProgram.mFeatures.isFullbright = true; - gObjectFullbrightWaterProgram.mFeatures.hasWaterFog = true; - gObjectFullbrightWaterProgram.mFeatures.hasTransport = true; - gObjectFullbrightWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectFullbrightWaterProgram.mShaderFiles.clear(); - gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectFullbrightWaterProgram, gSkinnedObjectFullbrightWaterProgram); - success = success && gObjectFullbrightWaterProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectEmissiveProgram.mName = "Emissive Shader"; - gObjectEmissiveProgram.mFeatures.calculatesAtmospherics = true; - gObjectEmissiveProgram.mFeatures.hasGamma = true; - gObjectEmissiveProgram.mFeatures.hasTransport = true; - gObjectEmissiveProgram.mFeatures.isFullbright = true; - gObjectEmissiveProgram.mFeatures.hasSrgb = true; - gObjectEmissiveProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectEmissiveProgram.mShaderFiles.clear(); - gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); - gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); - gObjectEmissiveProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectEmissiveProgram, gSkinnedObjectEmissiveProgram); - success = success && gObjectEmissiveProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectEmissiveWaterProgram.mName = "Emissive Water Shader"; - gObjectEmissiveWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectEmissiveWaterProgram.mFeatures.isFullbright = true; - gObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true; - gObjectEmissiveWaterProgram.mFeatures.hasTransport = true; - gObjectEmissiveWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectEmissiveWaterProgram.mShaderFiles.clear(); - gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); - gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectEmissiveWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectEmissiveWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectEmissiveWaterProgram, gSkinnedObjectEmissiveWaterProgram); - success = success && gObjectEmissiveWaterProgram.createShader(NULL, NULL); - } - - if (success) - { gObjectFullbrightAlphaMaskProgram.mName = "Fullbright Alpha Mask Shader"; gObjectFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; gObjectFullbrightAlphaMaskProgram.mFeatures.hasGamma = true; @@ -3379,78 +3049,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = success && gObjectFullbrightAlphaMaskProgram.createShader(NULL, NULL); } - if (success) - { - gObjectFullbrightWaterAlphaMaskProgram.mName = "Fullbright Water Alpha Mask Shader"; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.isFullbright = true; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasWaterFog = true; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasTransport = true; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; - gObjectFullbrightWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.clear(); - gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightWaterAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectFullbrightWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectFullbrightWaterAlphaMaskProgram, gSkinnedObjectFullbrightWaterAlphaMaskProgram); - success = success && gObjectFullbrightWaterAlphaMaskProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectShinyProgram.mName = "Shiny Shader"; - gObjectShinyProgram.mFeatures.calculatesAtmospherics = true; - gObjectShinyProgram.mFeatures.calculatesLighting = true; - gObjectShinyProgram.mFeatures.hasGamma = true; - gObjectShinyProgram.mFeatures.hasAtmospherics = true; - gObjectShinyProgram.mFeatures.isShiny = true; - gObjectShinyProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectShinyProgram.mShaderFiles.clear(); - gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); - gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER)); - gObjectShinyProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectShinyProgram, gSkinnedObjectShinyProgram); - success = success && gObjectShinyProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectShinyWaterProgram.mName = "Shiny Water Shader"; - gObjectShinyWaterProgram.mFeatures.calculatesAtmospherics = true; - gObjectShinyWaterProgram.mFeatures.calculatesLighting = true; - gObjectShinyWaterProgram.mFeatures.isShiny = true; - gObjectShinyWaterProgram.mFeatures.hasWaterFog = true; - gObjectShinyWaterProgram.mFeatures.hasAtmospherics = true; - gObjectShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectShinyWaterProgram.mShaderFiles.clear(); - gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER)); - gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); - gObjectShinyWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - gObjectShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = make_rigged_variant(gObjectShinyWaterProgram, gSkinnedObjectShinyWaterProgram); - success = success && gObjectShinyWaterProgram.createShader(NULL, NULL); - } - - if (success) - { - gObjectFullbrightShinyProgram.mName = "Fullbright Shiny Shader"; - gObjectFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; - gObjectFullbrightShinyProgram.mFeatures.isFullbright = true; - gObjectFullbrightShinyProgram.mFeatures.isShiny = true; - gObjectFullbrightShinyProgram.mFeatures.hasGamma = true; - gObjectFullbrightShinyProgram.mFeatures.hasTransport = true; - gObjectFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = 0; - gObjectFullbrightShinyProgram.mShaderFiles.clear(); - gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); - gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); - gObjectFullbrightShinyProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; - success = make_rigged_variant(gObjectFullbrightShinyProgram, gSkinnedObjectFullbrightShinyProgram); - success = success && gObjectFullbrightShinyProgram.createShader(NULL, NULL); - } - -#endif - if (!success) { mShaderLevel[SHADER_OBJECT] = 0; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 593a8c14f3..904fa9370e 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -177,41 +177,14 @@ extern LLGLSLShader gOneTextureFilterProgram; extern LLGLSLShader gOneTextureNoColorProgram; //object shaders -extern LLGLSLShader gObjectSimpleProgram; -extern LLGLSLShader gObjectSimpleImpostorProgram; -extern LLGLSLShader gObjectPreviewProgram; -extern LLGLSLShader gPhysicsPreviewProgram; -extern LLGLSLShader gObjectSimpleAlphaMaskProgram; -extern LLGLSLShader gObjectSimpleWaterProgram; -extern LLGLSLShader gObjectSimpleWaterAlphaMaskProgram; -extern LLGLSLShader gObjectSimpleNonIndexedTexGenProgram; -extern LLGLSLShader gObjectSimpleNonIndexedTexGenWaterProgram; -extern LLGLSLShader gObjectAlphaMaskNonIndexedProgram; -extern LLGLSLShader gObjectAlphaMaskNonIndexedWaterProgram; -extern LLGLSLShader gObjectAlphaMaskNoColorProgram; -extern LLGLSLShader gObjectAlphaMaskNoColorWaterProgram; -extern LLGLSLShader gObjectFullbrightProgram; -extern LLGLSLShader gObjectFullbrightWaterProgram; -extern LLGLSLShader gObjectFullbrightNoColorProgram; -extern LLGLSLShader gObjectFullbrightNoColorWaterProgram; -extern LLGLSLShader gObjectEmissiveProgram; -extern LLGLSLShader gObjectEmissiveWaterProgram; -extern LLGLSLShader gObjectFullbrightAlphaMaskProgram; -extern LLGLSLShader gObjectFullbrightWaterAlphaMaskProgram; -extern LLGLSLShader gObjectEmissiveNonIndexedProgram; -extern LLGLSLShader gObjectEmissiveNonIndexedWaterProgram; -extern LLGLSLShader gObjectBumpProgram; -extern LLGLSLShader gTreeProgram; -extern LLGLSLShader gTreeWaterProgram; - -extern LLGLSLShader gObjectSimpleLODProgram; -extern LLGLSLShader gObjectFullbrightLODProgram; - -extern LLGLSLShader gObjectFullbrightShinyProgram; -extern LLGLSLShader gObjectFullbrightShinyWaterProgram; - -extern LLGLSLShader gObjectShinyProgram; -extern LLGLSLShader gObjectShinyWaterProgram; +extern LLGLSLShader gObjectPreviewProgram; +extern LLGLSLShader gPhysicsPreviewProgram; +extern LLGLSLShader gObjectFullbrightAlphaMaskProgram; +extern LLGLSLShader gSkinnedObjectFullbrightAlphaMaskProgram; +extern LLGLSLShader gObjectBumpProgram; +extern LLGLSLShader gSkinnedObjectBumpProgram; +extern LLGLSLShader gObjectAlphaMaskNoColorProgram; +extern LLGLSLShader gObjectAlphaMaskNoColorWaterProgram; //environment shaders extern LLGLSLShader gMoonProgram; @@ -292,10 +265,14 @@ extern LLGLSLShader gDeferredAvatarShadowProgram; extern LLGLSLShader gDeferredAvatarAlphaShadowProgram; extern LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; +extern LLGLSLShader gHUDAlphaProgram; extern LLGLSLShader gDeferredAlphaImpostorProgram; extern LLGLSLShader gDeferredFullbrightProgram; +extern LLGLSLShader gHUDFullbrightProgram; extern LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +extern LLGLSLShader gHUDFullbrightAlphaMaskProgram; extern LLGLSLShader gDeferredFullbrightAlphaMaskAlphaProgram; +extern LLGLSLShader gHUDFullbrightAlphaMaskAlphaProgram; extern LLGLSLShader gDeferredAlphaWaterProgram; extern LLGLSLShader gDeferredFullbrightWaterProgram; extern LLGLSLShader gDeferredFullbrightWaterAlphaProgram; @@ -309,6 +286,7 @@ extern LLGLSLShader gDeferredWLSunProgram; extern LLGLSLShader gDeferredWLMoonProgram; extern LLGLSLShader gDeferredStarProgram; extern LLGLSLShader gDeferredFullbrightShinyProgram; +extern LLGLSLShader gHUDFullbrightShinyProgram; extern LLGLSLShader gNormalMapGenProgram; extern LLGLSLShader gDeferredGenBrdfLutProgram; diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp deleted file mode 100644 index c2f7d4fef6..0000000000 --- a/indra/newview/llvoground.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @file llvoground.cpp - * @brief LLVOGround class implementation - * - * $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 "llviewerprecompiledheaders.h" - -#include "llvoground.h" -#include "lldrawpoolground.h" - -#include "llviewercontrol.h" - -#include "lldrawable.h" -#include "llface.h" -#include "llsky.h" -#include "llviewercamera.h" -#include "llviewerregion.h" -#include "pipeline.h" - -LLVOGround::LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLStaticViewerObject(id, pcode, regionp, TRUE) -{ - mbCanSelect = FALSE; -} - - -LLVOGround::~LLVOGround() -{ -} - -void LLVOGround::idleUpdate(LLAgent &agent, const F64 &time) -{ -} - - -void LLVOGround::updateTextures() -{ -} - - -LLDrawable *LLVOGround::createDrawable(LLPipeline *pipeline) -{ - pipeline->allocDrawable(this); - mDrawable->setLit(FALSE); - - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_GROUND); - LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND); - - mDrawable->addFace(poolp, NULL); - - return mDrawable; -} - -// TO DO - this always returns TRUE, -BOOL LLVOGround::updateGeometry(LLDrawable *drawable) -{ - LLStrider<LLVector3> verticesp; - LLStrider<LLVector3> normalsp; - LLStrider<LLVector2> texCoordsp; - LLStrider<U16> indicesp; - S32 index_offset; - LLFace *face; - - LLDrawPoolGround *poolp = (LLDrawPoolGround*) gPipeline.getPool(LLDrawPool::POOL_GROUND); - - if (drawable->getNumFaces() < 1) - drawable->addFace(poolp, NULL); - face = drawable->getFace(0); - if (!face) - return TRUE; - - if (!face->getVertexBuffer()) - { - face->setSize(5, 12); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolGround::VERTEX_DATA_MASK); - if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount())) - { - LL_WARNS() << "Failed to allocate Vertex Buffer for VOGround to " - << face->getGeomCount() << " vertices and " - << face->getIndicesCount() << " indices" << LL_ENDL; - } - face->setGeomIndex(0); - face->setIndicesIndex(0); - face->setVertexBuffer(buff); - } - - index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp); - if (-1 == index_offset) - { - return TRUE; - } - - /////////////////////////////////////// - // - // - // - LLVector3 at_dir = LLViewerCamera::getInstance()->getAtAxis(); - at_dir.mV[VZ] = 0.f; - if (at_dir.normVec() < 0.01) - { - // We really don't care, as we're not looking anywhere near the horizon. - } - LLVector3 left_dir = LLViewerCamera::getInstance()->getLeftAxis(); - left_dir.mV[VZ] = 0.f; - left_dir.normVec(); - - // Our center top point - LLColor4 ground_color = gSky.getSkyFogColor(); - ground_color.mV[3] = 1.f; - face->setFaceColor(ground_color); - - *(verticesp++) = LLVector3(64, 64, 0); - *(verticesp++) = LLVector3(-64, 64, 0); - *(verticesp++) = LLVector3(-64, -64, 0); - *(verticesp++) = LLVector3(64, -64, 0); - *(verticesp++) = LLVector3(0, 0, -1024); - - - // Triangles for each side - *indicesp++ = index_offset + 0; - *indicesp++ = index_offset + 1; - *indicesp++ = index_offset + 4; - - *indicesp++ = index_offset + 1; - *indicesp++ = index_offset + 2; - *indicesp++ = index_offset + 4; - - *indicesp++ = index_offset + 2; - *indicesp++ = index_offset + 3; - *indicesp++ = index_offset + 4; - - *indicesp++ = index_offset + 3; - *indicesp++ = index_offset + 0; - *indicesp++ = index_offset + 4; - - *(texCoordsp++) = LLVector2(0.f, 0.f); - *(texCoordsp++) = LLVector2(1.f, 0.f); - *(texCoordsp++) = LLVector2(1.f, 1.f); - *(texCoordsp++) = LLVector2(0.f, 1.f); - *(texCoordsp++) = LLVector2(0.5f, 0.5f); - - face->getVertexBuffer()->unmapBuffer(); - LLPipeline::sCompiles++; - return TRUE; -} diff --git a/indra/newview/llvoground.h b/indra/newview/llvoground.h deleted file mode 100644 index e7033290c7..0000000000 --- a/indra/newview/llvoground.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file llvoground.h - * @brief LLVOGround class header file - * - * $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$ - */ - -#ifndef LL_LLVOGROUND_H -#define LL_LLVOGROUND_H - -#include "stdtypes.h" -#include "v3color.h" -#include "v4coloru.h" -#include "llviewertexture.h" -#include "llviewerobject.h" - -class LLVOGround : public LLStaticViewerObject -{ -protected: - ~LLVOGround(); - -public: - LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - - /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); - - // Graphical stuff for objects - maybe broken out into render class - // later? - /*virtual*/ void updateTextures(); - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - -}; - -#endif // LL_LLVOGROUND_H diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 4b3b348d50..273eeb930c 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -767,7 +767,6 @@ bool LLVOSky::updateSky() mForceUpdate = FALSE; mForceUpdateThrottle.setTimerExpirySec(UPDATE_EXPRY); - gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE); if (mDrawable.notNull() && mDrawable->getFace(0) && !mDrawable->getFace(0)->getVertexBuffer()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 325d01ff1b..c602b71679 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -55,7 +55,6 @@ #include "lldrawable.h" #include "lldrawpoolalpha.h" #include "lldrawpoolavatar.h" -#include "lldrawpoolground.h" #include "lldrawpoolbump.h" #include "lldrawpooltree.h" #include "lldrawpoolwater.h" @@ -86,7 +85,6 @@ #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatarself.h" #include "llvocache.h" -#include "llvoground.h" #include "llvosky.h" #include "llvowlsky.h" #include "llvotree.h" @@ -430,7 +428,6 @@ void LLPipeline::init() getPool(LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK); getPool(LLDrawPool::POOL_GRASS); getPool(LLDrawPool::POOL_FULLBRIGHT); - getPool(LLDrawPool::POOL_INVISIBLE); getPool(LLDrawPool::POOL_BUMP); getPool(LLDrawPool::POOL_MATERIALS); getPool(LLDrawPool::POOL_GLOW); @@ -459,12 +456,6 @@ void LLPipeline::init() else { setAllRenderTypes(); // By default, all rendering types start enabled - // Don't turn on ground when this is set - // Mac Books with intel 950s need this - if(!gSavedSettings.getBOOL("RenderGround")) - { - toggleRenderType(RENDER_TYPE_GROUND); - } } // make sure RenderPerformanceTest persists (hackity hack hack) @@ -649,14 +640,10 @@ void LLPipeline::cleanup() mTerrainPool = NULL; delete mWaterPool; mWaterPool = NULL; - delete mGroundPool; - mGroundPool = NULL; delete mSimplePool; mSimplePool = NULL; delete mFullbrightPool; mFullbrightPool = NULL; - delete mInvisiblePool; - mInvisiblePool = NULL; delete mGlowPool; mGlowPool = NULL; delete mBumpPool; @@ -1518,10 +1505,6 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) poolp = mFullbrightPool; break; - case LLDrawPool::POOL_INVISIBLE: - poolp = mInvisiblePool; - break; - case LLDrawPool::POOL_GLOW: poolp = mGlowPool; break; @@ -1559,10 +1542,6 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0) poolp = mWaterPool; break; - case LLDrawPool::POOL_GROUND: - poolp = mGroundPool; - break; - case LLDrawPool::POOL_WL_SKY: poolp = mWLSkyPool; break; @@ -3168,7 +3147,6 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) if (hasAnyRenderType(LLPipeline::RENDER_TYPE_AVATAR, LLPipeline::RENDER_TYPE_CONTROL_AV, - LLPipeline::RENDER_TYPE_GROUND, LLPipeline::RENDER_TYPE_TERRAIN, LLPipeline::RENDER_TYPE_TREE, LLPipeline::RENDER_TYPE_SKY, @@ -5164,18 +5142,6 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp ) } break; - case LLDrawPool::POOL_INVISIBLE: - if (mInvisiblePool) - { - llassert(0); - LL_WARNS() << "Ignoring duplicate simple pool." << LL_ENDL; - } - else - { - mInvisiblePool = (LLRenderPass*) new_poolp; - } - break; - case LLDrawPool::POOL_GLOW: if (mGlowPool) { @@ -5269,18 +5235,6 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp ) } break; - case LLDrawPool::POOL_GROUND: - if( mGroundPool ) - { - llassert(0); - LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate Ground Pool" << LL_ENDL; - } - else - { - mGroundPool = new_poolp; - } - break; - case LLDrawPool::POOL_WL_SKY: if( mWLSkyPool ) { @@ -5350,11 +5304,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) mFullbrightPool = NULL; break; - case LLDrawPool::POOL_INVISIBLE: - llassert(mInvisiblePool == poolp); - mInvisiblePool = NULL; - break; - case LLDrawPool::POOL_WL_SKY: llassert(mWLSkyPool == poolp); mWLSkyPool = NULL; @@ -5421,11 +5370,6 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp ) mWaterPool = NULL; break; - case LLDrawPool::POOL_GROUND: - llassert( poolp == mGroundPool ); - mGroundPool = NULL; - break; - case LLDrawPool::POOL_GLTF_PBR: llassert( poolp == mPBROpaquePool ); mPBROpaquePool = NULL; @@ -10255,7 +10199,6 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar) clearRenderTypeMask( RENDER_TYPE_SKY, RENDER_TYPE_WL_SKY, - RENDER_TYPE_GROUND, RENDER_TYPE_TERRAIN, RENDER_TYPE_GRASS, RENDER_TYPE_CONTROL_AV, // Animesh diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 5b80ae5696..f5b77a5e08 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -459,7 +459,6 @@ public: // Following are pool types (some are also object types) RENDER_TYPE_SKY = LLDrawPool::POOL_SKY, RENDER_TYPE_WL_SKY = LLDrawPool::POOL_WL_SKY, - RENDER_TYPE_GROUND = LLDrawPool::POOL_GROUND, RENDER_TYPE_TERRAIN = LLDrawPool::POOL_TERRAIN, RENDER_TYPE_SIMPLE = LLDrawPool::POOL_SIMPLE, RENDER_TYPE_GRASS = LLDrawPool::POOL_GRASS, @@ -471,7 +470,6 @@ public: RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, RENDER_TYPE_CONTROL_AV = LLDrawPool::POOL_CONTROL_AV, // Animesh RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, - RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, RENDER_TYPE_GLTF_PBR = LLDrawPool::POOL_GLTF_PBR, @@ -892,13 +890,11 @@ protected: LLDrawPool* mSkyPool = nullptr; LLDrawPool* mTerrainPool = nullptr; LLDrawPool* mWaterPool = nullptr; - LLDrawPool* mGroundPool = nullptr; LLRenderPass* mSimplePool = nullptr; LLRenderPass* mGrassPool = nullptr; LLRenderPass* mAlphaMaskPool = nullptr; LLRenderPass* mFullbrightAlphaMaskPool = nullptr; LLRenderPass* mFullbrightPool = nullptr; - LLDrawPool* mInvisiblePool = nullptr; LLDrawPool* mGlowPool = nullptr; LLDrawPool* mBumpPool = nullptr; LLDrawPool* mMaterialsPool = nullptr; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2512fadec7..b8515cb096 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2047,17 +2047,6 @@ function="World.EnvPreset" parameter="water" /> </menu_item_check> <menu_item_check - label="Ground" - name="Rendering Type Ground" - shortcut="control|alt|shift|8"> - <menu_item_check.on_check - function="Advanced.CheckRenderType" - parameter="ground" /> - <menu_item_check.on_click - function="Advanced.ToggleRenderType" - parameter="ground" /> - </menu_item_check> - <menu_item_check label="Volume" name="Rendering Type Volume" shortcut="control|alt|shift|9"> |