Merge branch 'DRTVWR-559' of https://github.com/secondlife/viewer
# Conflicts: # indra/newview/app_settings/settings.xml # indra/newview/lldrawpoolalpha.cpp # indra/newview/pipeline.cpp # indra/newview/pipeline.hmaster
commit
8385b6a7dd
|
|
@ -1441,12 +1441,13 @@ F32 LLSettingsSky::getReflectionProbeAmbiance() const
|
|||
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
|
||||
}
|
||||
|
||||
F32 LLSettingsSky::getTotalReflectionProbeAmbiance() const
|
||||
F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const
|
||||
{
|
||||
// feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior
|
||||
// without brightening dark/interior spaces
|
||||
F32 probe_ambiance = getReflectionProbeAmbiance();
|
||||
probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*0.5f;
|
||||
|
||||
probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*cloud_shadow_scale;
|
||||
|
||||
return probe_ambiance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public:
|
|||
F32 getReflectionProbeAmbiance() const;
|
||||
|
||||
// get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage)
|
||||
F32 getTotalReflectionProbeAmbiance() const;
|
||||
F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const;
|
||||
|
||||
// Return first (only) profile layer represented in LLSD
|
||||
LLSD getRayleighConfig() const;
|
||||
|
|
|
|||
|
|
@ -82,12 +82,10 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
|
|||
}
|
||||
|
||||
LLShaderFeatures::LLShaderFeatures()
|
||||
: atmosphericHelpers(false)
|
||||
, calculatesLighting(false)
|
||||
: calculatesLighting(false)
|
||||
, calculatesAtmospherics(false)
|
||||
, hasLighting(false)
|
||||
, isAlphaLighting(false)
|
||||
, isFullbright(false)
|
||||
, isSpecular(false)
|
||||
, hasWaterFog(false)
|
||||
, hasTransport(false)
|
||||
|
|
|
|||
|
|
@ -35,12 +35,10 @@
|
|||
class LLShaderFeatures
|
||||
{
|
||||
public:
|
||||
bool atmosphericHelpers;
|
||||
bool calculatesLighting;
|
||||
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 isFullbright; // implies no lighting
|
||||
bool isSpecular;
|
||||
bool hasWaterFog; // implies no gamma
|
||||
bool hasTransport; // implies no lighting (it's possible to have neither though)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "llshadermgr.h"
|
||||
#include "llrender.h"
|
||||
#include "llfile.h"
|
||||
#include "lldir.h"
|
||||
|
||||
#if LL_DARWIN
|
||||
#include "OpenGL/OpenGL.h"
|
||||
|
|
@ -379,82 +380,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
}
|
||||
}
|
||||
}
|
||||
// NOTE order of shader object attaching is VERY IMPORTANT!!!
|
||||
else if (features->isFullbright)
|
||||
{
|
||||
|
||||
if (features->hasWaterFog)
|
||||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightWaterAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (features->disableTextureIndex)
|
||||
{
|
||||
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (features->hasAlphaMask)
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightAlphaMaskF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!shader->attachFragmentObject("lighting/lightFullbrightF.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (features->mIndexedTextureChannels <= 1)
|
||||
{
|
||||
if (!shader->attachVertexObject("objects/nonindexedTextureV.glsl"))
|
||||
|
|
@ -599,36 +525,57 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
|
|||
S32 gpu_class;
|
||||
|
||||
std::string open_file_name;
|
||||
//find the most relevant file
|
||||
for (gpu_class = try_gpu_class; gpu_class > 0; gpu_class--)
|
||||
{ //search from the current gpu class down to class 1 to find the most relevant shader
|
||||
std::stringstream fname;
|
||||
fname << getShaderDirPrefix();
|
||||
fname << gpu_class << "/" << filename;
|
||||
|
||||
open_file_name = fname.str();
|
||||
|
||||
/*
|
||||
Would be awesome, if we didn't have shaders that re-use files
|
||||
with different environments to say, add skinning, etc
|
||||
can't depend on cached version to have evaluate ifdefs identically...
|
||||
if we can define a deterministic hash for the shader based on
|
||||
all the inputs, maybe we can save some time here.
|
||||
if (mShaderObjects.count(filename) > 0)
|
||||
#if 0 // WIP -- try to come up with a way to fallback to an error shader without needing debug stubs all over the place in the shader tree
|
||||
if (shader_level == -1)
|
||||
{
|
||||
// use "error" fallback
|
||||
if (type == GL_VERTEX_SHADER)
|
||||
{
|
||||
return mShaderObjects[filename];
|
||||
open_file_name = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/errorV.glsl");
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(type == GL_FRAGMENT_SHADER); // type must be vertex or fragment shader
|
||||
open_file_name = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/errorF.glsl");
|
||||
}
|
||||
|
||||
*/
|
||||
file = LLFile::fopen(open_file_name, "r");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
//find the most relevant file
|
||||
for (gpu_class = try_gpu_class; gpu_class > 0; gpu_class--)
|
||||
{ //search from the current gpu class down to class 1 to find the most relevant shader
|
||||
std::stringstream fname;
|
||||
fname << getShaderDirPrefix();
|
||||
fname << gpu_class << "/" << filename;
|
||||
|
||||
LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
|
||||
file = LLFile::fopen(open_file_name, "r+"); /* Flawfinder: ignore */
|
||||
if (file)
|
||||
{
|
||||
LL_DEBUGS("ShaderLoading") << "Loading file: " << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
|
||||
break; // done
|
||||
}
|
||||
}
|
||||
open_file_name = fname.str();
|
||||
|
||||
/*
|
||||
Would be awesome, if we didn't have shaders that re-use files
|
||||
with different environments to say, add skinning, etc
|
||||
can't depend on cached version to have evaluate ifdefs identically...
|
||||
if we can define a deterministic hash for the shader based on
|
||||
all the inputs, maybe we can save some time here.
|
||||
if (mShaderObjects.count(filename) > 0)
|
||||
{
|
||||
return mShaderObjects[filename];
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
|
||||
file = LLFile::fopen(open_file_name, "r"); /* Flawfinder: ignore */
|
||||
if (file)
|
||||
{
|
||||
LL_DEBUGS("ShaderLoading") << "Loading file: " << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
|
||||
break; // done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1416,14 +1416,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BO
|
|||
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
|
||||
LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
|
||||
|
||||
if (pfd.cColorBits < 32)
|
||||
{
|
||||
OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"),
|
||||
mCallbacks->translateString("MBError"), OSMB_OK);
|
||||
close();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SetPixelFormat(mhDC, pixel_format, &pfd))
|
||||
{
|
||||
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"),
|
||||
|
|
@ -1705,14 +1697,6 @@ const S32 max_format = (S32)num_formats - 1;
|
|||
<< " Depth Bits " << S32(pfd.cDepthBits)
|
||||
<< LL_ENDL;
|
||||
|
||||
// make sure we have 32 bits per pixel
|
||||
if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32)
|
||||
{
|
||||
OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"), mCallbacks->translateString("MBError"), OSMB_OK);
|
||||
close();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mhRC = 0;
|
||||
if (wglCreateContextAttribsARB)
|
||||
{ //attempt to create a specific versioned context
|
||||
|
|
|
|||
|
|
@ -11728,6 +11728,17 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RenderCloudShadowAmbianceFactor</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Amount that cloud shadow (aka cloud coverage) contributes to reflection probe ambiance</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.1</real>
|
||||
</map>
|
||||
<key>RenderComplexityColorMin</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -125,7 +125,5 @@ void main()
|
|||
frag_data[0] = vec4(color.rgb, alpha1);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
frag_data[2] = vec4(0,0,0,GBUFFER_FLAG_SKIP_ATMOS);
|
||||
|
||||
gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113 Stars and Clouds need same depth
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 specularColor, float metallic, vec3 v,
|
|||
|
||||
float NdotV = clamp(abs(dot(norm, v)), 0.001, 1.0);
|
||||
|
||||
color += pbrIbl(diffuseColor, specularColor, radiance, irradiance, ao, NdotV, perceptualRoughness);
|
||||
color += pbrIbl(diffuseColor, specularColor, radiance, irradiance, ao, NdotV, 0.2);
|
||||
|
||||
color += pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, norm, v, normalize(light_dir)) * sunlit * 2.75 * scol;
|
||||
color += colorEmissive*0.5;
|
||||
|
|
@ -551,14 +551,14 @@ void waterClip(vec3 pos)
|
|||
// TODO: make this less branchy
|
||||
if (waterSign > 0)
|
||||
{
|
||||
if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) < -0.1)
|
||||
if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) < 0.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) > -0.1)
|
||||
if ((dot(pos.xyz, waterPlane.xyz) + waterPlane.w) > 0.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,5 @@ void main()
|
|||
frag_data[0] = vec4(c.rgb, c.a);
|
||||
frag_data[1] = vec4(0.0);
|
||||
frag_data[2] = vec4(0.0, 0.0, 0.0, GBUFFER_FLAG_HAS_ATMOS);
|
||||
|
||||
gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,11 @@ void main()
|
|||
{
|
||||
//transform vertex
|
||||
vec4 vert = vec4(position.xyz, 1.0);
|
||||
vec4 pos = (modelview_matrix * vert);
|
||||
vec4 pos = (modelview_projection_matrix * vert);
|
||||
|
||||
gl_Position = modelview_projection_matrix*vert;
|
||||
// smash to *almost* far clip plane -- stars are still behind
|
||||
pos.z = pos.w*0.999999;
|
||||
gl_Position = pos;
|
||||
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#define DIFFUSE_ALPHA_MODE_IGNORE 0
|
||||
#define DIFFUSE_ALPHA_MODE_BLEND 1
|
||||
#define DIFFUSE_ALPHA_MODE_MASK 2
|
||||
#define DIFFUSE_ALPHA_MODE_EMISSIVE 3
|
||||
|
||||
#ifndef IS_HUD
|
||||
|
||||
// default alpha implementation
|
||||
|
||||
#ifdef HAS_SKIN
|
||||
uniform mat4 modelview_matrix;
|
||||
|
|
@ -38,13 +38,12 @@ uniform mat4 modelview_projection_matrix;
|
|||
#endif
|
||||
uniform mat4 texture_matrix0;
|
||||
|
||||
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
|
||||
#if !defined(HAS_SKIN)
|
||||
uniform mat4 modelview_matrix;
|
||||
#endif
|
||||
VARYING vec3 vary_position;
|
||||
#if !defined(HAS_SKIN)
|
||||
uniform mat4 modelview_matrix;
|
||||
#endif
|
||||
|
||||
out vec3 vary_position;
|
||||
|
||||
uniform mat3 texture_basecolor_matrix;
|
||||
uniform mat3 texture_normal_matrix;
|
||||
uniform mat3 texture_metallic_roughness_matrix;
|
||||
|
|
@ -79,9 +78,7 @@ void main()
|
|||
mat4 mat = getObjectSkinnedTransform();
|
||||
mat = modelview_matrix * mat;
|
||||
vec3 pos = (mat*vec4(position.xyz,1.0)).xyz;
|
||||
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
|
||||
vary_position = pos;
|
||||
#endif
|
||||
vec4 vert = projection_matrix * vec4(pos,1.0);
|
||||
#else
|
||||
//transform vertex
|
||||
|
|
@ -112,9 +109,46 @@ void main()
|
|||
|
||||
vertex_color = diffuse_color;
|
||||
|
||||
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
|
||||
#if !defined(HAS_SKIN)
|
||||
#if !defined(HAS_SKIN)
|
||||
vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// fullbright HUD alpha implementation
|
||||
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
uniform mat4 texture_matrix0;
|
||||
|
||||
uniform mat4 modelview_matrix;
|
||||
|
||||
out vec3 vary_position;
|
||||
|
||||
uniform mat3 texture_basecolor_matrix;
|
||||
uniform mat3 texture_emissive_matrix;
|
||||
|
||||
in vec3 position;
|
||||
in vec4 diffuse_color;
|
||||
in vec2 texcoord0;
|
||||
|
||||
out vec2 basecolor_texcoord;
|
||||
out vec2 emissive_texcoord;
|
||||
|
||||
out vec4 vertex_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
vec4 vert = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
gl_Position = vert;
|
||||
vary_position = vert.xyz;
|
||||
|
||||
basecolor_texcoord = (texture_matrix0 * vec4(texture_basecolor_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
emissive_texcoord = (texture_matrix0 * vec4(texture_emissive_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
|
||||
vertex_color = diffuse_color;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* @file pbrglowF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2023, 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$
|
||||
*/
|
||||
|
||||
/*[EXTRA_CODE_HERE]*/
|
||||
|
||||
// forward fullbright implementation for HUDs
|
||||
|
||||
uniform sampler2D diffuseMap; //always in sRGB space
|
||||
|
||||
uniform vec3 emissiveColor;
|
||||
uniform sampler2D emissiveMap;
|
||||
|
||||
out vec4 frag_color;
|
||||
|
||||
in vec3 vary_position;
|
||||
in vec4 vertex_emissive;
|
||||
|
||||
in vec2 basecolor_texcoord;
|
||||
in vec2 emissive_texcoord;
|
||||
|
||||
uniform float minimum_alpha; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff()
|
||||
|
||||
vec3 linear_to_srgb(vec3 c);
|
||||
vec3 srgb_to_linear(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 basecolor = texture2D(diffuseMap, basecolor_texcoord.xy).rgba;
|
||||
|
||||
if (basecolor.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vec3 emissive = emissiveColor;
|
||||
emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
|
||||
|
||||
float lum = max(max(emissive.r, emissive.g), emissive.b);
|
||||
lum *= vertex_emissive.a;
|
||||
|
||||
// HUDs are rendered after gamma correction, output in sRGB space
|
||||
frag_color.rgb = vec3(0);
|
||||
frag_color.a = lum;
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* @file fullbrightV.glsl
|
||||
/**
|
||||
* @file pbgglowV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, Linden Research, Inc.
|
||||
* Copyright (C) 2023, 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
|
||||
|
|
@ -23,43 +23,48 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform mat4 texture_matrix0;
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
ATTRIBUTE vec3 position;
|
||||
void passTextureIndex();
|
||||
ATTRIBUTE vec2 texcoord0;
|
||||
ATTRIBUTE vec3 normal;
|
||||
ATTRIBUTE vec4 diffuse_color;
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
#ifdef HAS_SKIN
|
||||
mat4 getObjectSkinnedTransform();
|
||||
uniform mat4 modelview_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
mat4 getObjectSkinnedTransform();
|
||||
#else
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
#endif
|
||||
|
||||
uniform mat4 texture_matrix0;
|
||||
|
||||
uniform mat3 texture_basecolor_matrix;
|
||||
uniform mat3 texture_emissive_matrix;
|
||||
|
||||
in vec3 position;
|
||||
in vec4 emissive;
|
||||
|
||||
in vec2 texcoord0;
|
||||
|
||||
out vec2 basecolor_texcoord;
|
||||
out vec2 emissive_texcoord;
|
||||
|
||||
out vec4 vertex_emissive;
|
||||
|
||||
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;
|
||||
#else
|
||||
vec4 pos = (modelview_matrix * vert);
|
||||
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
|
||||
#endif
|
||||
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
vertex_color = diffuse_color;
|
||||
mat = modelview_matrix * mat;
|
||||
|
||||
vec3 pos = (mat*vec4(position.xyz,1.0)).xyz;
|
||||
|
||||
gl_Position = projection_matrix*vec4(pos,1.0);
|
||||
#else
|
||||
//transform vertex
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
#endif
|
||||
|
||||
basecolor_texcoord = (texture_matrix0 * vec4(texture_basecolor_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
emissive_texcoord = (texture_matrix0 * vec4(texture_emissive_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
|
||||
vertex_emissive = emissive;
|
||||
}
|
||||
|
||||
|
|
@ -25,6 +25,11 @@
|
|||
|
||||
/*[EXTRA_CODE_HERE]*/
|
||||
|
||||
|
||||
#ifndef IS_HUD
|
||||
|
||||
// deferred opaque implementation
|
||||
|
||||
uniform sampler2D diffuseMap; //always in sRGB space
|
||||
|
||||
uniform float metallicFactor;
|
||||
|
|
@ -101,3 +106,48 @@ void main()
|
|||
frag_data[2] = vec4(encode_normal(tnorm), vertex_color.a, GBUFFER_FLAG_HAS_PBR); // normal, environment intensity, flags
|
||||
frag_data[3] = vec4(emissive,0); // PBR sRGB Emissive
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// forward fullbright implementation for HUDs
|
||||
|
||||
uniform sampler2D diffuseMap; //always in sRGB space
|
||||
|
||||
uniform vec3 emissiveColor;
|
||||
uniform sampler2D emissiveMap;
|
||||
|
||||
out vec4 frag_color;
|
||||
|
||||
in vec3 vary_position;
|
||||
in vec4 vertex_color;
|
||||
|
||||
in vec2 basecolor_texcoord;
|
||||
in vec2 emissive_texcoord;
|
||||
|
||||
uniform float minimum_alpha; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff()
|
||||
|
||||
vec3 linear_to_srgb(vec3 c);
|
||||
vec3 srgb_to_linear(vec3 c);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 basecolor = texture2D(diffuseMap, basecolor_texcoord.xy).rgba;
|
||||
if (basecolor.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb);
|
||||
|
||||
vec3 emissive = emissiveColor;
|
||||
emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
|
||||
|
||||
col += emissive;
|
||||
|
||||
// HUDs are rendered after gamma correction, output in sRGB space
|
||||
frag_color.rgb = linear_to_srgb(col);
|
||||
frag_color.a = 0.0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#define DIFFUSE_ALPHA_MODE_IGNORE 0
|
||||
#define DIFFUSE_ALPHA_MODE_BLEND 1
|
||||
#define DIFFUSE_ALPHA_MODE_MASK 2
|
||||
#define DIFFUSE_ALPHA_MODE_EMISSIVE 3
|
||||
|
||||
#ifndef IS_HUD
|
||||
|
||||
//deferred opaque implementation
|
||||
|
||||
#ifdef HAS_SKIN
|
||||
uniform mat4 modelview_matrix;
|
||||
|
|
@ -95,3 +95,40 @@ void main()
|
|||
|
||||
vertex_color = diffuse_color;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// fullbright HUD implementation
|
||||
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
uniform mat4 texture_matrix0;
|
||||
|
||||
uniform mat3 texture_basecolor_matrix;
|
||||
uniform mat3 texture_normal_matrix;
|
||||
uniform mat3 texture_metallic_roughness_matrix;
|
||||
uniform mat3 texture_emissive_matrix;
|
||||
|
||||
in vec3 position;
|
||||
in vec4 diffuse_color;
|
||||
in vec2 texcoord0;
|
||||
|
||||
out vec2 basecolor_texcoord;
|
||||
out vec2 emissive_texcoord;
|
||||
|
||||
out vec4 vertex_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
|
||||
basecolor_texcoord = (texture_matrix0 * vec4(texture_basecolor_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
emissive_texcoord = (texture_matrix0 * vec4(texture_emissive_matrix * vec3(texcoord0,1), 1)).xy;
|
||||
|
||||
vertex_color = diffuse_color;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,5 @@ void main()
|
|||
frag_data[0] = vec4(color.rgb, 1.0);
|
||||
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS); //1.0 in norm.w masks off fog
|
||||
|
||||
gl_FragDepth = 0.99999f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,5 @@ void main()
|
|||
frag_data[0] = col;
|
||||
frag_data[1] = vec4(0.0f);
|
||||
frag_data[2] = vec4(0.0, 1.0, 0.0, GBUFFER_FLAG_SKIP_ATMOS);
|
||||
|
||||
gl_FragDepth = LL_SHADER_CONST_STAR_DEPTH; // SL-14113 Moon Haze -- Stars need to depth test behind the moon
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,10 @@ void main()
|
|||
//transform vertex
|
||||
vec4 pos = modelview_projection_matrix * vec4(position, 1.0);
|
||||
|
||||
// bias z to fix SL-9806 and get stars to depth test against clouds
|
||||
pos.z += 0.001f;
|
||||
|
||||
// smash to far clip plane to
|
||||
// avoid rendering on top of moon (do NOT write to gl_FragDepth, it's slow)
|
||||
pos.z = pos.w;
|
||||
|
||||
gl_Position = pos;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,5 @@ void main()
|
|||
frag_data[0] = c;
|
||||
frag_data[1] = vec4(0.0f);
|
||||
frag_data[2] = vec4(0.0, 1.0, 0.0, GBUFFER_FLAG_SKIP_ATMOS);
|
||||
|
||||
gl_FragDepth = 0.999988f;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ void main()
|
|||
|
||||
sun_fade = smoothstep(0.3, 1.0, (position.z + 50) / 512.0f);
|
||||
|
||||
// smash to *almost* far clip plane -- behind clouds but in front of stars
|
||||
pos.z = pos.w*0.999999;
|
||||
gl_Position = pos;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* @file objects/fullbrightF.glsl
|
||||
* @file waterF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, Linden Research, Inc.
|
||||
* Copyright (C) 2023, 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
|
||||
|
|
@ -20,14 +20,15 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$F
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
// error fallback on compilation failure
|
||||
|
||||
void fullbright_lighting();
|
||||
out vec4 frag_color;
|
||||
|
||||
void main()
|
||||
void main()
|
||||
{
|
||||
fullbright_lighting();
|
||||
frag_color = vec4(1,0,1,1);
|
||||
}
|
||||
|
||||
|
|
@ -72,13 +72,8 @@ vec4 applyWaterFogView(vec3 pos, vec4 color)
|
|||
return color;
|
||||
}
|
||||
|
||||
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit)
|
||||
vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit)
|
||||
{
|
||||
if (dot(pos, waterPlane.xyz) + waterPlane.w > 0.0)
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
vec3 view = normalize(pos);
|
||||
//normalize view vector
|
||||
float es = -(dot(view, waterPlane.xyz));
|
||||
|
|
@ -118,6 +113,16 @@ vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit)
|
|||
return color;
|
||||
}
|
||||
|
||||
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit)
|
||||
{
|
||||
if (dot(pos, waterPlane.xyz) + waterPlane.w > 0.0)
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
return applyWaterFogViewLinearNoClip(pos, color, sunlit);
|
||||
}
|
||||
|
||||
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color)
|
||||
{
|
||||
return applyWaterFogViewLinear(pos, color, vec3(1));
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightAlphaMaskF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, 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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform float minimum_alpha;
|
||||
uniform float texture_gamma; // either 1.0 or 2.2; see: "::TEXTURE_GAMMA"
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void fullbright_lighting()
|
||||
{
|
||||
vec4 color = diffuseLookup(vary_texcoord0.xy);
|
||||
|
||||
if (color.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
color *= vertex_color;
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(texture_gamma));
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightF.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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
uniform float texture_gamma;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
void fullbright_lighting()
|
||||
{
|
||||
vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(texture_gamma));
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(1.0/texture_gamma));
|
||||
|
||||
frag_color = color;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightNonIndexedAlphaMaskF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, 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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform float minimum_alpha;
|
||||
uniform float texture_gamma;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void fullbright_lighting()
|
||||
{
|
||||
vec4 color = texture2D(diffuseMap,vary_texcoord0.xy);
|
||||
|
||||
if (color.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(texture_gamma));
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
color.rgb = pow(color.rgb, vec3(1.0/texture_gamma));
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightF.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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
void fullbright_lighting()
|
||||
{
|
||||
vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
frag_color = color;
|
||||
}
|
||||
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightWaterAlphaMaskF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, 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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform float minimum_alpha;
|
||||
|
||||
/* vec4 diffuseLookup(vec2 texcoord); */
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec4 applyWaterFog(vec4 color);
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void fullbright_lighting_water()
|
||||
{
|
||||
vec4 color = diffuseLookup(vary_texcoord0.xy);
|
||||
|
||||
if (color.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightWaterNonIndexedAlphaMaskF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, 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$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
uniform float minimum_alpha;
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec4 applyWaterFog(vec4 color);
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
void fullbright_lighting_water()
|
||||
{
|
||||
vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);
|
||||
|
||||
if (color.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
}
|
||||
|
||||
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
/*[EXTRA_CODE_HERE]*/
|
||||
|
||||
#ifndef IS_HUD
|
||||
|
||||
uniform sampler2D diffuseMap; //always in sRGB space
|
||||
uniform sampler2D bumpMap;
|
||||
uniform sampler2D emissiveMap;
|
||||
|
|
@ -113,6 +115,8 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
|
|||
vec3 v, // surface point to camera
|
||||
vec3 l); //surface point to light
|
||||
|
||||
vec2 BRDF(float NoV, float roughness);
|
||||
|
||||
vec3 calcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor,
|
||||
float perceptualRoughness,
|
||||
float metallic,
|
||||
|
|
@ -217,8 +221,12 @@ void main()
|
|||
calcDiffuseSpecular(col.rgb, metallic, diffuseColor, specularColor);
|
||||
|
||||
vec3 v = -normalize(pos.xyz);
|
||||
|
||||
color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit, scol, radiance, irradiance, colorEmissive, ao, additive, atten);
|
||||
|
||||
float nv = clamp(abs(dot(norm.xyz, v)), 0.001, 1.0);
|
||||
vec2 brdf = BRDF(clamp(nv, 0, 1), 1.0-perceptualRoughness);
|
||||
|
||||
vec3 light = vec3(0);
|
||||
|
||||
// Punctual lights
|
||||
|
|
@ -235,5 +243,67 @@ void main()
|
|||
color.rgb += light.rgb;
|
||||
|
||||
|
||||
frag_color = vec4(color.rgb,basecolor.a * vertex_color.a);
|
||||
float a = basecolor.a*vertex_color.a;
|
||||
vec3 spec = radiance; // *specularColor;
|
||||
float lum = max(max(spec.r, spec.g), spec.b);
|
||||
|
||||
float f = brdf.y;
|
||||
a += f;
|
||||
frag_color = vec4(color.rgb,a);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
uniform sampler2D diffuseMap; //always in sRGB space
|
||||
uniform sampler2D emissiveMap;
|
||||
|
||||
uniform vec3 emissiveColor;
|
||||
|
||||
out vec4 frag_color;
|
||||
|
||||
in vec3 vary_position;
|
||||
|
||||
in vec2 basecolor_texcoord;
|
||||
in vec2 emissive_texcoord;
|
||||
|
||||
in vec4 vertex_color;
|
||||
|
||||
#ifdef HAS_ALPHA_MASK
|
||||
uniform float minimum_alpha; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff()
|
||||
#endif
|
||||
|
||||
vec3 srgb_to_linear(vec3 c);
|
||||
vec3 linear_to_srgb(vec3 c);
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 color = vec3(0,0,0);
|
||||
|
||||
vec3 pos = vary_position;
|
||||
|
||||
vec4 basecolor = texture(diffuseMap, basecolor_texcoord.xy).rgba;
|
||||
basecolor.rgb = srgb_to_linear(basecolor.rgb);
|
||||
#ifdef HAS_ALPHA_MASK
|
||||
if (basecolor.a < minimum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
|
||||
color = vertex_color.rgb * basecolor.rgb;
|
||||
|
||||
// emissiveColor is the emissive color factor from GLTF and is already in linear space
|
||||
vec3 colorEmissive = emissiveColor;
|
||||
// emissiveMap here is a vanilla RGB texture encoded as sRGB, manually convert to linear
|
||||
colorEmissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb);
|
||||
|
||||
|
||||
float a = basecolor.a*vertex_color.a;
|
||||
a = 1.0;
|
||||
color += colorEmissive;
|
||||
color = linear_to_srgb(color);
|
||||
frag_color = vec4(color.rgb,a);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -643,7 +643,7 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
|
|||
glossenv = sampleProbes(pos, normalize(refnormpersp), lod, errorCorrect);
|
||||
|
||||
#if defined(SSR)
|
||||
if (cube_snapshot != 1)
|
||||
if (cube_snapshot != 1 && glossiness >= 0.9)
|
||||
{
|
||||
vec4 ssr = vec4(0);
|
||||
//float w = tapScreenSpaceReflection(errorCorrect ? 1 : 4, tc, pos, norm, ssr, sceneMap);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ VARYING vec4 littleWave;
|
|||
VARYING vec4 view;
|
||||
in vec3 vary_position;
|
||||
|
||||
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color);
|
||||
vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit);
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -77,5 +77,5 @@ void main()
|
|||
vec4 fb = vec4(waterFogColorLinear, 0.0);
|
||||
#endif
|
||||
|
||||
frag_color = applyWaterFogViewLinear(vary_position, fb);
|
||||
frag_color = applyWaterFogViewLinearNoClip(vary_position, fb, vec3(1));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, ou
|
|||
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit);
|
||||
|
||||
// PBR interface
|
||||
vec2 BRDF(float NoV, float roughness);
|
||||
|
||||
void calcDiffuseSpecular(vec3 baseColor, float metallic, inout vec3 diffuseColor, inout vec3 specularColor);
|
||||
|
||||
vec3 pbrIbl(vec3 diffuseColor,
|
||||
vec3 specularColor,
|
||||
vec3 radiance, // radiance map sample
|
||||
|
|
@ -52,6 +56,22 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
|
|||
vec3 v, // surface point to camera
|
||||
vec3 l); //surface point to light
|
||||
|
||||
vec3 pbrBaseLight(vec3 diffuseColor,
|
||||
vec3 specularColor,
|
||||
float metallic,
|
||||
vec3 pos,
|
||||
vec3 norm,
|
||||
float perceptualRoughness,
|
||||
vec3 light_dir,
|
||||
vec3 sunlit,
|
||||
float scol,
|
||||
vec3 radiance,
|
||||
vec3 irradiance,
|
||||
vec3 colorEmissive,
|
||||
float ao,
|
||||
vec3 additive,
|
||||
vec3 atten);
|
||||
|
||||
uniform sampler2D bumpMap;
|
||||
uniform sampler2D bumpMap2;
|
||||
uniform float blend_factor;
|
||||
|
|
@ -112,8 +132,6 @@ vec3 getPositionWithNDC(vec3 ndc);
|
|||
|
||||
void main()
|
||||
{
|
||||
vec4 color;
|
||||
|
||||
vN = vary_normal;
|
||||
vT = vary_tangent;
|
||||
vB = cross(vN, vT);
|
||||
|
|
@ -151,30 +169,28 @@ void main()
|
|||
|
||||
vec3 waver = wavef*3;
|
||||
|
||||
wavef = transform_normal(wavef);
|
||||
vec3 up = transform_normal(vec3(0,0,1));
|
||||
float vdu = -dot(viewVec, up)*2;
|
||||
|
||||
vec3 wave_ibl = wavef;
|
||||
wave_ibl.z *= 2.0;
|
||||
wave_ibl = transform_normal(normalize(wave_ibl));
|
||||
|
||||
//wavef.z *= max(-viewVec.z, 0.1);
|
||||
vec3 norm = transform_normal(normalize(wavef));
|
||||
|
||||
vdu = clamp(vdu, 0, 1);
|
||||
wavef.z *= max(vdu*vdu*vdu, 0.1);
|
||||
|
||||
wavef = normalize(wavef);
|
||||
|
||||
//get base fresnel components
|
||||
|
||||
vec3 df = vec3(
|
||||
dot(viewVec, wave1),
|
||||
dot(viewVec, (wave2 + wave3) * 0.5),
|
||||
dot(viewVec, wave3)
|
||||
) * fresnelScale + fresnelOffset;
|
||||
|
||||
//wavef = vec3(0, 0, 1);
|
||||
wavef = transform_normal(wavef);
|
||||
|
||||
float dist2 = dist;
|
||||
dist = max(dist, 5.0);
|
||||
|
||||
float dmod = sqrt(dist);
|
||||
|
||||
float df1 = df.x + df.y + df.z;
|
||||
|
||||
|
||||
|
||||
|
||||
//figure out distortion vector (ripply)
|
||||
vec2 distort2 = distort + waver.xy * refScale / max(dmod, 1.0);
|
||||
|
||||
|
|
@ -203,66 +219,58 @@ void main()
|
|||
|
||||
fb = applyWaterFogViewLinear(refPos, fb, sunlit);
|
||||
#else
|
||||
vec4 fb = vec4(waterFogColorLinear.rgb, 0.0);
|
||||
vec4 fb = applyWaterFogViewLinear(viewVec*1024.0, vec4(0.5), sunlit);
|
||||
#endif
|
||||
|
||||
vec3 v = -viewVec;
|
||||
float NdotV = clamp(abs(dot(wavef.xyz, v)), 0.001, 1.0);
|
||||
|
||||
float metallic = fresnelOffset * 0.1; // fudge -- use fresnelOffset as metalness
|
||||
float roughness = 0.1;
|
||||
float gloss = 1.0 - roughness;
|
||||
|
||||
vec3 baseColor = vec3(0.25);
|
||||
vec3 f0 = vec3(0.04);
|
||||
vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);
|
||||
diffuseColor *= gloss;
|
||||
|
||||
vec3 specularColor = mix(f0, baseColor.rgb, metallic);
|
||||
|
||||
vec3 refnorm = normalize(wavef + vary_normal);
|
||||
//vec3 refnorm = wavef;
|
||||
float metallic = 0.0;
|
||||
float perceptualRoughness = 0.1;
|
||||
float gloss = 1.0 - perceptualRoughness;
|
||||
|
||||
vec3 irradiance = vec3(0);
|
||||
vec3 radiance = vec3(0);
|
||||
sampleReflectionProbes(irradiance, radiance, distort, pos, refnorm, gloss, true);
|
||||
radiance *= 0.5;
|
||||
irradiance = fb.rgb;
|
||||
vec3 irradiance = vec3(0);
|
||||
vec3 radiance = vec3(0);
|
||||
sampleReflectionProbes(irradiance, radiance, distort2, pos.xyz, wave_ibl.xyz, gloss);
|
||||
|
||||
color.rgb = pbrIbl(diffuseColor, specularColor, radiance, irradiance, gloss, NdotV, 0.0);
|
||||
irradiance = vec3(0);
|
||||
|
||||
vec3 diffuseColor;
|
||||
vec3 specularColor;
|
||||
calcDiffuseSpecular(vec3(1), metallic, diffuseColor, specularColor);
|
||||
|
||||
vec3 v = -normalize(pos.xyz);
|
||||
|
||||
float scol = 1.0;
|
||||
vec3 colorEmissive = vec3(0);
|
||||
float ao = 1.0;
|
||||
vec3 light_dir = transform_normal(lightDir);
|
||||
|
||||
// fudge -- for punctual lighting, pretend water is metallic
|
||||
diffuseColor = vec3(0);
|
||||
specularColor = vec3(1);
|
||||
roughness = 0.1;
|
||||
float scol = 1.0; // TODO -- incorporate shadow map
|
||||
perceptualRoughness = 0.0;
|
||||
metallic = 1.0;
|
||||
|
||||
//color.rgb += pbrPunctual(diffuseColor, specularColor, roughness, metallic, wavef, v, vary_light_dir) * sunlit * 2.75 * scol;
|
||||
float NdotV = clamp(abs(dot(norm, v)), 0.001, 1.0);
|
||||
|
||||
//get specular component
|
||||
float spec = clamp(dot(vary_light_dir, (reflect(viewVec, wavef))), 0.0, 1.0);
|
||||
vec3 punctual = pbrPunctual(vec3(0), specularColor, 0.1, metallic, normalize(wavef+up*max(dist, 32.0)/32.0*(1.0-vdu)), v, normalize(light_dir));
|
||||
|
||||
//harden specular
|
||||
spec = pow(spec, 128.0);
|
||||
vec3 color = punctual * sunlit * 2.75 * scol;
|
||||
|
||||
color.rgb += spec * specular;
|
||||
color = atmosFragLightingLinear(color, additive, atten);
|
||||
color = scaleSoftClipFragLinear(color);
|
||||
|
||||
color.rgb = atmosFragLightingLinear(color.rgb, additive, atten);
|
||||
color.rgb = scaleSoftClipFragLinear(color.rgb);
|
||||
vec3 ibl = pbrIbl(vec3(0), vec3(1), radiance, vec3(0), ao, NdotV, 0.0);
|
||||
|
||||
color.a = 0.f;
|
||||
//color.rgb = fb.rgb;
|
||||
//color.rgb = vec3(depth*depth*depth*depth);
|
||||
//color.rgb = srgb_to_linear(normalize(refPos) * 0.5 + 0.5);
|
||||
//color.rgb = srgb_to_linear(normalize(pos) * 0.5 + 0.5);
|
||||
//color.rgb = srgb_to_linear(wavef * 0.5 + 0.5);
|
||||
color += ibl;
|
||||
|
||||
//color.rgb = radiance;
|
||||
frag_color = color;
|
||||
float nv = clamp(abs(dot(norm.xyz, v)), 0.001, 1.0);
|
||||
vec2 brdf = BRDF(clamp(nv, 0, 1), 1.0);
|
||||
float f = 1.0-brdf.y; //1.0 - (brdf.x+brdf.y);
|
||||
f *= 0.9;
|
||||
f *= f;
|
||||
|
||||
#if defined(WATER_EDGE)
|
||||
gl_FragDepth = 0.9999847f;
|
||||
#endif
|
||||
|
||||
f = clamp(f, 0, 1);
|
||||
//fb.rgb *= 1.;
|
||||
|
||||
color = mix(color, fb.rgb, f);
|
||||
float spec = min(max(max(punctual.r, punctual.g), punctual.b), 0.05);
|
||||
|
||||
frag_color = vec4(color, spec); //*sunAngle2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightWaterF.glsl
|
||||
* @file errorF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, Linden Research, Inc.
|
||||
* Copyright (C) 2023, 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
|
||||
|
|
@ -23,26 +23,12 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
// error fallback on compilation failure
|
||||
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec4 applyWaterFog(vec4 color);
|
||||
|
||||
void fullbright_lighting_water()
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
frag_color = vec4(1,0,1,1);
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* @file class1\lighting\lightFullbrightWaterF.glsl
|
||||
* @file errorV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2023&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2007, Linden Research, Inc.
|
||||
* Copyright (C) 2023, 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
|
||||
|
|
@ -23,26 +23,13 @@
|
|||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifdef DEFINE_GL_FRAGCOLOR
|
||||
out vec4 frag_color;
|
||||
#else
|
||||
#define frag_color gl_FragColor
|
||||
#endif
|
||||
// fallback shader for whenever there is a compilation error
|
||||
uniform mat4 modelview_projection_matrix;
|
||||
|
||||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
in vec3 position;
|
||||
|
||||
/* vec4 diffuseLookup(vec2 texcoord); */
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec4 applyWaterFog(vec4 color);
|
||||
|
||||
void fullbright_lighting_water()
|
||||
void main()
|
||||
{
|
||||
vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
frag_color = applyWaterFog(color);
|
||||
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
|
||||
}
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
Second Life shader variants are referred to as "classes."
|
||||
|
||||
When a shader of a particular class is loaded, a lower class may
|
||||
be loaded if the class requested doesn't exist or fails to load
|
||||
for any reason. In general, shaders that require more resources
|
||||
or later hardware capabilities should be higher class and
|
||||
lower classes can be used for fallback implementations or lower
|
||||
detail settings.
|
||||
|
||||
Which class is chosen will generally depend on graphics preferences.
|
||||
|
||||
Previously, someone tried to enumerate the shaders here, but don't do
|
||||
that. It messes with searches and the shader hierarchy changes often.
|
||||
|
||||
|
||||
|
|
@ -184,6 +184,8 @@ public:
|
|||
PASS_NORMSPEC_EMISSIVE_RIGGED,
|
||||
PASS_GLOW,
|
||||
PASS_GLOW_RIGGED,
|
||||
PASS_GLTF_GLOW,
|
||||
PASS_GLTF_GLOW_RIGGED,
|
||||
PASS_ALPHA,
|
||||
PASS_ALPHA_RIGGED,
|
||||
PASS_ALPHA_MASK,
|
||||
|
|
|
|||
|
|
@ -177,9 +177,12 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
|
|||
llassert(LLPipeline::sRenderDeferred);
|
||||
|
||||
emissive_shader = &gDeferredEmissiveProgram;
|
||||
|
||||
prepare_alpha_shader(emissive_shader, true, false, water_sign);
|
||||
|
||||
pbr_emissive_shader = &gPBRGlowProgram;
|
||||
prepare_alpha_shader(pbr_emissive_shader, true, false, water_sign);
|
||||
|
||||
|
||||
fullbright_shader =
|
||||
(LLPipeline::sImpostorRender) ? &gDeferredFullbrightAlphaMaskProgram :
|
||||
(LLPipeline::sUnderWaterRender) ? &gDeferredFullbrightWaterAlphaProgram :
|
||||
|
|
@ -201,7 +204,9 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
|
|||
prepare_alpha_shader(&materialShader[i], false, true, water_sign);
|
||||
}
|
||||
|
||||
prepare_alpha_shader(&gDeferredPBRAlphaProgram, false, true, water_sign);
|
||||
pbr_shader = LLPipeline::sRenderingHUDs ? &gHUDPBRAlphaProgram : &gDeferredPBRAlphaProgram;
|
||||
|
||||
prepare_alpha_shader(pbr_shader, false, true, water_sign);
|
||||
|
||||
if (!LLPipeline::sRenderingHUDs)
|
||||
{
|
||||
|
|
@ -213,10 +218,10 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
|
|||
forwardRender();
|
||||
|
||||
// final pass, render to depth for depth of field effects
|
||||
if (!LLPipeline::sImpostorRender && gSavedSettings.getBOOL("RenderDepthOfField") && !gCubeSnapshot)
|
||||
if (!LLPipeline::sImpostorRender && gSavedSettings.getBOOL("RenderDepthOfField") && !gCubeSnapshot && !LLPipeline::sRenderingHUDs)
|
||||
{
|
||||
//update depth buffer sampler
|
||||
simple_shader = fullbright_shader = &gObjectFullbrightAlphaMaskProgram;
|
||||
simple_shader = fullbright_shader = &gDeferredFullbrightAlphaMaskProgram;
|
||||
|
||||
simple_shader->bind();
|
||||
simple_shader->setMinimumAlpha(0.33f);
|
||||
|
|
@ -512,7 +517,7 @@ void LLDrawPoolAlpha::RestoreTexSetup(bool tex_setup)
|
|||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAlpha::drawEmissive(U32 mask, LLDrawInfo* draw)
|
||||
void LLDrawPoolAlpha::drawEmissive(LLDrawInfo* draw)
|
||||
{
|
||||
LLGLSLShader::sCurBoundShaderPtr->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, 1.f);
|
||||
draw->mVertexBuffer->setBuffer();
|
||||
|
|
@ -520,7 +525,7 @@ void LLDrawPoolAlpha::drawEmissive(U32 mask, LLDrawInfo* draw)
|
|||
}
|
||||
|
||||
|
||||
void LLDrawPoolAlpha::renderEmissives(U32 mask, std::vector<LLDrawInfo*>& emissives)
|
||||
void LLDrawPoolAlpha::renderEmissives(std::vector<LLDrawInfo*>& emissives)
|
||||
{
|
||||
emissive_shader->bind();
|
||||
emissive_shader->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, 1.f);
|
||||
|
|
@ -528,12 +533,25 @@ void LLDrawPoolAlpha::renderEmissives(U32 mask, std::vector<LLDrawInfo*>& emissi
|
|||
for (LLDrawInfo* draw : emissives)
|
||||
{
|
||||
bool tex_setup = TexSetup(draw, false);
|
||||
drawEmissive(mask, draw);
|
||||
drawEmissive(draw);
|
||||
RestoreTexSetup(tex_setup);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAlpha::renderRiggedEmissives(U32 mask, std::vector<LLDrawInfo*>& emissives)
|
||||
void LLDrawPoolAlpha::renderPbrEmissives(std::vector<LLDrawInfo*>& emissives)
|
||||
{
|
||||
pbr_emissive_shader->bind();
|
||||
|
||||
for (LLDrawInfo* draw : emissives)
|
||||
{
|
||||
llassert(draw->mGLTFMaterial);
|
||||
draw->mGLTFMaterial->bind(draw->mTexture);
|
||||
draw->mVertexBuffer->setBuffer();
|
||||
draw->mVertexBuffer->drawRange(LLRender::TRIANGLES, draw->mStart, draw->mEnd, draw->mCount, draw->mOffset);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAlpha::renderRiggedEmissives(std::vector<LLDrawInfo*>& emissives)
|
||||
{
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE); //disable depth writes since "emissive" is additive so sorting doesn't matter
|
||||
LLGLSLShader* shader = emissive_shader->mRiggedVariant;
|
||||
|
|
@ -543,8 +561,6 @@ void LLDrawPoolAlpha::renderRiggedEmissives(U32 mask, std::vector<LLDrawInfo*>&
|
|||
LLVOAvatar* lastAvatar = nullptr;
|
||||
U64 lastMeshId = 0;
|
||||
|
||||
mask |= LLVertexBuffer::MAP_WEIGHT4;
|
||||
|
||||
//std::unique_ptr<FSPerfStats::RecordAttachmentTime> ratPtr{}; // <FS:Beq/> Render time Stats collection
|
||||
for (LLDrawInfo* draw : emissives)
|
||||
{
|
||||
|
|
@ -567,11 +583,37 @@ void LLDrawPoolAlpha::renderRiggedEmissives(U32 mask, std::vector<LLDrawInfo*>&
|
|||
lastAvatar = draw->mAvatar;
|
||||
lastMeshId = draw->mSkinInfo->mHash;
|
||||
}
|
||||
drawEmissive(mask, draw);
|
||||
drawEmissive(draw);
|
||||
RestoreTexSetup(tex_setup);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAlpha::renderRiggedPbrEmissives(std::vector<LLDrawInfo*>& emissives)
|
||||
{
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE); //disable depth writes since "emissive" is additive so sorting doesn't matter
|
||||
pbr_emissive_shader->bind(true);
|
||||
|
||||
LLVOAvatar* lastAvatar = nullptr;
|
||||
U64 lastMeshId = 0;
|
||||
|
||||
for (LLDrawInfo* draw : emissives)
|
||||
{
|
||||
if (lastAvatar != draw->mAvatar || lastMeshId != draw->mSkinInfo->mHash)
|
||||
{
|
||||
if (!uploadMatrixPalette(*draw))
|
||||
{ // failed to upload matrix palette, skip rendering
|
||||
continue;
|
||||
}
|
||||
lastAvatar = draw->mAvatar;
|
||||
lastMeshId = draw->mSkinInfo->mHash;
|
||||
}
|
||||
|
||||
draw->mGLTFMaterial->bind(draw->mTexture);
|
||||
draw->mVertexBuffer->setBuffer();
|
||||
draw->mVertexBuffer->drawRange(LLRender::TRIANGLES, draw->mStart, draw->mEnd, draw->mCount, draw->mOffset);
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
|
||||
|
|
@ -640,8 +682,13 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
|
|||
|
||||
static std::vector<LLDrawInfo*> emissives;
|
||||
static std::vector<LLDrawInfo*> rigged_emissives;
|
||||
static std::vector<LLDrawInfo*> pbr_emissives;
|
||||
static std::vector<LLDrawInfo*> pbr_rigged_emissives;
|
||||
|
||||
emissives.resize(0);
|
||||
rigged_emissives.resize(0);
|
||||
pbr_emissives.resize(0);
|
||||
pbr_rigged_emissives.resize(0);
|
||||
|
||||
bool is_particle_or_hud_particle = group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_PARTICLE
|
||||
|| group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE;
|
||||
|
|
@ -694,7 +741,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
|
|||
|
||||
if (gltf_mat && gltf_mat->mAlphaMode == LLGLTFMaterial::ALPHA_MODE_BLEND)
|
||||
{
|
||||
target_shader = &gDeferredPBRAlphaProgram;
|
||||
target_shader = pbr_shader;
|
||||
if (params.mAvatar != nullptr)
|
||||
{
|
||||
target_shader = target_shader->mRiggedVariant;
|
||||
|
|
@ -849,11 +896,25 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
|
|||
{
|
||||
if (params.mAvatar != nullptr)
|
||||
{
|
||||
rigged_emissives.push_back(¶ms);
|
||||
if (params.mGLTFMaterial.isNull())
|
||||
{
|
||||
rigged_emissives.push_back(¶ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
pbr_rigged_emissives.push_back(¶ms);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
emissives.push_back(¶ms);
|
||||
if (params.mGLTFMaterial.isNull())
|
||||
{
|
||||
emissives.push_back(¶ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
pbr_emissives.push_back(¶ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -883,14 +944,28 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
|
|||
if (!emissives.empty())
|
||||
{
|
||||
light_enabled = true;
|
||||
renderEmissives(mask, emissives);
|
||||
renderEmissives(emissives);
|
||||
rebind = true;
|
||||
}
|
||||
|
||||
if (!pbr_emissives.empty())
|
||||
{
|
||||
light_enabled = true;
|
||||
renderPbrEmissives(pbr_emissives);
|
||||
rebind = true;
|
||||
}
|
||||
|
||||
if (!rigged_emissives.empty())
|
||||
{
|
||||
light_enabled = true;
|
||||
renderRiggedEmissives(mask, rigged_emissives);
|
||||
renderRiggedEmissives(rigged_emissives);
|
||||
rebind = true;
|
||||
}
|
||||
|
||||
if (!pbr_rigged_emissives.empty())
|
||||
{
|
||||
light_enabled = true;
|
||||
renderRiggedPbrEmissives(pbr_rigged_emissives);
|
||||
rebind = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,10 +78,14 @@ private:
|
|||
LLGLSLShader* simple_shader = nullptr;
|
||||
LLGLSLShader* fullbright_shader = nullptr;
|
||||
LLGLSLShader* emissive_shader = nullptr;
|
||||
LLGLSLShader* pbr_emissive_shader = nullptr;
|
||||
LLGLSLShader* pbr_shader = nullptr;
|
||||
|
||||
void drawEmissive(U32 mask, LLDrawInfo* draw);
|
||||
void renderEmissives(U32 mask, std::vector<LLDrawInfo*>& emissives);
|
||||
void renderRiggedEmissives(U32 mask, std::vector<LLDrawInfo*>& emissives);
|
||||
void drawEmissive(LLDrawInfo* draw);
|
||||
void renderEmissives(std::vector<LLDrawInfo*>& emissives);
|
||||
void renderRiggedEmissives(std::vector<LLDrawInfo*>& emissives);
|
||||
void renderPbrEmissives(std::vector<LLDrawInfo*>& emissives);
|
||||
void renderRiggedPbrEmissives(std::vector<LLDrawInfo*>& emissives);
|
||||
bool TexSetup(LLDrawInfo* draw, bool use_material);
|
||||
void RestoreTexSetup(bool tex_setup);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,22 +31,57 @@
|
|||
#include "llviewershadermgr.h"
|
||||
#include "pipeline.h"
|
||||
|
||||
static const U32 gltf_render_types[] = { LLPipeline::RENDER_TYPE_PASS_GLTF_PBR, LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK };
|
||||
|
||||
LLDrawPoolGLTFPBR::LLDrawPoolGLTFPBR() :
|
||||
LLRenderPass(POOL_GLTF_PBR)
|
||||
{
|
||||
}
|
||||
|
||||
S32 LLDrawPoolGLTFPBR::getNumDeferredPasses()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LLDrawPoolGLTFPBR::renderDeferred(S32 pass)
|
||||
{
|
||||
const U32 types[] = { LLPipeline::RENDER_TYPE_PASS_GLTF_PBR, LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK };
|
||||
llassert(!LLPipeline::sRenderingHUDs);
|
||||
|
||||
for (U32 type : types)
|
||||
for (U32 type : gltf_render_types)
|
||||
{
|
||||
gDeferredPBROpaqueProgram.bind();
|
||||
pushGLTFBatches(type);
|
||||
|
||||
|
||||
gDeferredPBROpaqueProgram.bind(true);
|
||||
pushRiggedGLTFBatches(type+1);
|
||||
pushRiggedGLTFBatches(type + 1);
|
||||
}
|
||||
}
|
||||
|
||||
S32 LLDrawPoolGLTFPBR::getNumPostDeferredPasses()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void LLDrawPoolGLTFPBR::renderPostDeferred(S32 pass)
|
||||
{
|
||||
if (LLPipeline::sRenderingHUDs)
|
||||
{
|
||||
gHUDPBROpaqueProgram.bind();
|
||||
for (U32 type : gltf_render_types)
|
||||
{
|
||||
pushGLTFBatches(type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.setColorMask(false, true);
|
||||
gPBRGlowProgram.bind();
|
||||
pushGLTFBatches(LLRenderPass::PASS_GLTF_GLOW);
|
||||
|
||||
gPBRGlowProgram.bind(true);
|
||||
pushRiggedGLTFBatches(LLRenderPass::PASS_GLTF_GLOW_RIGGED);
|
||||
|
||||
gGL.setColorMask(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ public:
|
|||
|
||||
LLDrawPoolGLTFPBR();
|
||||
|
||||
S32 getNumDeferredPasses() override { return 1; }
|
||||
S32 getNumDeferredPasses() override;
|
||||
void renderDeferred(S32 pass) override;
|
||||
|
||||
S32 getNumPostDeferredPasses() override;
|
||||
void renderPostDeferred(S32 pass) override;
|
||||
};
|
||||
|
||||
#endif // LL_LLDRAWPOOLPBROPAQUE_H
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass)
|
|||
void LLDrawPoolTree::renderDeferred(S32 pass)
|
||||
{
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
LL_PROFILE_ZONE_SCOPED;
|
||||
|
||||
if (mDrawFace.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex)
|
|||
|
||||
if (mAlphaMode == LLGLTFMaterial::ALPHA_MODE_MASK)
|
||||
{
|
||||
min_alpha = mAlphaCutoff;
|
||||
// dividing the alpha cutoff by transparency here allows the shader to compare against
|
||||
// the alpha value of the texture without needing the transparency value
|
||||
min_alpha = mAlphaCutoff/mBaseColor.mV[3];
|
||||
}
|
||||
shader->uniform1f(LLShaderMgr::MINIMUM_ALPHA, min_alpha);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "pipeline.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llworld.h"
|
||||
|
||||
extern F32SecondsImplicit gFrameTimeSeconds;
|
||||
|
||||
|
|
@ -123,6 +124,12 @@ void LLReflectionMap::autoAdjustOrigin()
|
|||
mOrigin.mul(0.5f);
|
||||
}
|
||||
|
||||
// make sure origin isn't under ground
|
||||
F32* fp = mOrigin.getF32ptr();
|
||||
LLVector3 origin(fp);
|
||||
F32 height = LLWorld::instance().resolveLandHeightAgent(origin) + 2.f;
|
||||
fp[2] = llmax(fp[2], height);
|
||||
|
||||
// make sure radius encompasses all objects
|
||||
LLSimdScalar r2 = 0.0;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face)
|
|||
|
||||
gRadianceGenProgram.uniform1f(sRoughness, (F32)i / (F32)(mMipChain.size() - 1));
|
||||
gRadianceGenProgram.uniform1f(sMipLevel, i);
|
||||
gRadianceGenProgram.uniform1i(sWidth, mMipChain[i].getWidth());
|
||||
gRadianceGenProgram.uniform1i(sWidth, mProbeResolution);
|
||||
|
||||
for (int cf = 0; cf < 6; ++cf)
|
||||
{ // for each cube face
|
||||
|
|
@ -798,7 +798,9 @@ void LLReflectionMapManager::updateUniforms()
|
|||
LLEnvironment& environment = LLEnvironment::instance();
|
||||
LLSettingsSky::ptr_t psky = environment.getCurrentSky();
|
||||
|
||||
F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance();
|
||||
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
|
||||
F32 minimum_ambiance = psky->getTotalReflectionProbeAmbiance(cloud_shadow_scale);
|
||||
|
||||
F32 ambscale = gCubeSnapshot && !isRadiancePass() ? 0.f : 1.f;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -733,7 +733,8 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force)
|
|||
shader->uniform3fv(LLShaderMgr::SUNLIGHT_LINEAR, linearColor3v(sunDiffuse));
|
||||
shader->uniform3fv(LLShaderMgr::MOONLIGHT_LINEAR,linearColor3v(moonDiffuse));
|
||||
|
||||
shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance());
|
||||
static LLCachedControl<F32> cloud_shadow_scale(gSavedSettings, "RenderCloudShadowAmbianceFactor", 0.125f);
|
||||
shader->uniform1f(LLShaderMgr::REFLECTION_PROBE_AMBIANCE, getTotalReflectionProbeAmbiance(cloud_shadow_scale));
|
||||
|
||||
shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, getIsSunUp() ? 1 : 0);
|
||||
shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor());
|
||||
|
|
@ -949,7 +950,7 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force)
|
|||
|
||||
//transform water plane to eye space
|
||||
glh::vec3f norm(0.f, 0.f, 1.f);
|
||||
glh::vec3f p(0.f, 0.f, water_height + 0.1f);
|
||||
glh::vec3f p(0.f, 0.f, water_height);
|
||||
|
||||
F32 modelView[16];
|
||||
for (U32 i = 0; i < 16; i++)
|
||||
|
|
|
|||
|
|
@ -862,18 +862,8 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
|||
parent = object->getRootEdit();
|
||||
}
|
||||
|
||||
// Show screen-space highlight glow effect
|
||||
bool show_highlight = false;
|
||||
|
||||
if (handleMediaHover(mHoverPick))
|
||||
{
|
||||
// *NOTE: If you think the hover glow conflicts with the media outline, you
|
||||
// could disable it here.
|
||||
show_highlight = true;
|
||||
// cursor set by media object
|
||||
LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
|
||||
}
|
||||
else if (!mMouseOutsideSlop
|
||||
if (!handleMediaHover(mHoverPick)
|
||||
&& !mMouseOutsideSlop
|
||||
&& mMouseButtonDown
|
||||
// disable camera steering if click on land is not used for moving
|
||||
&& gViewerInput.isMouseBindUsed(CLICK_LEFT, MASK_NONE, MODE_THIRD_PERSON))
|
||||
|
|
@ -913,7 +903,6 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
|||
|
||||
if (click_action_object && useClickAction(mask, click_action_object, click_action_object->getRootEdit()))
|
||||
{
|
||||
show_highlight = true;
|
||||
ECursorType cursor = cursorFromObject(click_action_object);
|
||||
gViewerWindow->setCursor(cursor);
|
||||
LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
|
||||
|
|
@ -928,7 +917,6 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
|||
else if ((object && !object->isAvatar() && object->flagUsePhysics())
|
||||
|| (parent && !parent->isAvatar() && parent->flagUsePhysics()))
|
||||
{
|
||||
show_highlight = true;
|
||||
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
|
||||
LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
|
||||
}
|
||||
|
|
@ -936,7 +924,6 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
|
|||
&& ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch()))
|
||||
&& (!object || !object->isAvatar()))
|
||||
{
|
||||
show_highlight = true;
|
||||
gViewerWindow->setCursor(UI_CURSOR_HAND);
|
||||
LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1315,6 +1315,7 @@ void render_hud_attachments()
|
|||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_ALPHA_MASK);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_FULLBRIGHT);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_GLTF_PBR);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_ALPHA);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_BUMP);
|
||||
|
|
@ -1325,6 +1326,8 @@ void render_hud_attachments()
|
|||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_SHINY);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_INVISIBLE);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_GLTF_PBR);
|
||||
gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK);
|
||||
|
||||
gPipeline.stateSort(hud_cam, result);
|
||||
|
||||
|
|
|
|||
|
|
@ -206,8 +206,12 @@ LLGLSLShader gDeferredGenBrdfLutProgram;
|
|||
// Deferred materials shaders
|
||||
LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2];
|
||||
LLGLSLShader gDeferredMaterialWaterProgram[LLMaterial::SHADER_COUNT*2];
|
||||
LLGLSLShader gHUDPBROpaqueProgram;
|
||||
LLGLSLShader gPBRGlowProgram;
|
||||
LLGLSLShader gPBRGlowSkinnedProgram;
|
||||
LLGLSLShader gDeferredPBROpaqueProgram;
|
||||
LLGLSLShader gDeferredSkinnedPBROpaqueProgram;
|
||||
LLGLSLShader gHUDPBRAlphaProgram;
|
||||
LLGLSLShader gDeferredPBRAlphaProgram;
|
||||
LLGLSLShader gDeferredSkinnedPBRAlphaProgram;
|
||||
|
||||
|
|
@ -285,6 +289,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
|
|||
mShaderList.push_back(&gDeferredWLMoonProgram);
|
||||
mShaderList.push_back(&gDeferredWLSunProgram);
|
||||
mShaderList.push_back(&gDeferredPBRAlphaProgram);
|
||||
mShaderList.push_back(&gHUDPBRAlphaProgram);
|
||||
mShaderList.push_back(&gDeferredSkinnedPBRAlphaProgram);
|
||||
}
|
||||
|
||||
|
|
@ -555,7 +560,6 @@ void LLViewerShaderMgr::unloadShaders()
|
|||
gImpostorProgram.unload();
|
||||
gObjectBumpProgram.unload();
|
||||
gSkinnedObjectBumpProgram.unload();
|
||||
gObjectFullbrightAlphaMaskProgram.unload();
|
||||
gSkinnedObjectFullbrightAlphaMaskProgram.unload();
|
||||
|
||||
gObjectAlphaMaskNoColorProgram.unload();
|
||||
|
|
@ -740,21 +744,13 @@ std::string LLViewerShaderMgr::loadBasicShaders()
|
|||
index_channels.push_back(-1); shaders.push_back( make_pair( "deferred/screenSpaceReflUtil.glsl", ssr ? 3 : 1) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightAlphaMaskNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightFullbrightNonIndexedAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
index_channels.push_back(-1); shaders.push_back( make_pair( "lighting/lightWaterNonIndexedF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
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(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] ) );
|
||||
index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightAlphaMaskF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightWaterF.glsl", mShaderLevel[SHADER_LIGHTING] ) );
|
||||
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] ) );
|
||||
|
||||
|
||||
for (U32 i = 0; i < shaders.size(); i++)
|
||||
{
|
||||
// Note usage of GL_FRAGMENT_SHADER
|
||||
|
|
@ -1036,6 +1032,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredMaterialWaterProgram[i].unload();
|
||||
}
|
||||
|
||||
gHUDPBROpaqueProgram.unload();
|
||||
gPBRGlowProgram.unload();
|
||||
gDeferredPBROpaqueProgram.unload();
|
||||
gDeferredSkinnedPBROpaqueProgram.unload();
|
||||
gDeferredPBRAlphaProgram.unload();
|
||||
|
|
@ -1336,11 +1334,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredPBROpaqueProgram.mShaderFiles.push_back(make_pair("deferred/pbropaqueV.glsl", GL_VERTEX_SHADER));
|
||||
gDeferredPBROpaqueProgram.mShaderFiles.push_back(make_pair("deferred/pbropaqueF.glsl", GL_FRAGMENT_SHADER));
|
||||
gDeferredPBROpaqueProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
gDeferredPBROpaqueProgram.addPermutation("HAS_NORMAL_MAP", "1");
|
||||
gDeferredPBROpaqueProgram.addPermutation("HAS_SPECULAR_MAP", "1");
|
||||
gDeferredPBROpaqueProgram.addPermutation("HAS_EMISSIVE_MAP", "1");
|
||||
gDeferredPBROpaqueProgram.addPermutation("DIFFUSE_ALPHA_MODE", "0");
|
||||
|
||||
|
||||
success = make_rigged_variant(gDeferredPBROpaqueProgram, gDeferredSkinnedPBROpaqueProgram);
|
||||
if (success)
|
||||
{
|
||||
|
|
@ -1349,6 +1343,41 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gPBRGlowProgram.mName = " PBR Glow Shader";
|
||||
gPBRGlowProgram.mFeatures.hasSrgb = true;
|
||||
gPBRGlowProgram.mShaderFiles.clear();
|
||||
gPBRGlowProgram.mShaderFiles.push_back(make_pair("deferred/pbrglowV.glsl", GL_VERTEX_SHADER));
|
||||
gPBRGlowProgram.mShaderFiles.push_back(make_pair("deferred/pbrglowF.glsl", GL_FRAGMENT_SHADER));
|
||||
gPBRGlowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
|
||||
success = make_rigged_variant(gPBRGlowProgram, gPBRGlowSkinnedProgram);
|
||||
if (success)
|
||||
{
|
||||
success = gPBRGlowProgram.createShader(NULL, NULL);
|
||||
}
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gHUDPBROpaqueProgram.mName = "HUD PBR Opaque Shader";
|
||||
gHUDPBROpaqueProgram.mFeatures.hasSrgb = true;
|
||||
gHUDPBROpaqueProgram.mShaderFiles.clear();
|
||||
gHUDPBROpaqueProgram.mShaderFiles.push_back(make_pair("deferred/pbropaqueV.glsl", GL_VERTEX_SHADER));
|
||||
gHUDPBROpaqueProgram.mShaderFiles.push_back(make_pair("deferred/pbropaqueF.glsl", GL_FRAGMENT_SHADER));
|
||||
gHUDPBROpaqueProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
gHUDPBROpaqueProgram.clearPermutations();
|
||||
gHUDPBROpaqueProgram.addPermutation("IS_HUD", "1");
|
||||
|
||||
success = gHUDPBROpaqueProgram.createShader(NULL, NULL);
|
||||
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (success)
|
||||
{
|
||||
LLGLSLShader* shader = &gDeferredPBRAlphaProgram;
|
||||
|
|
@ -1385,21 +1414,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
shader->addPermutation("HAS_SUN_SHADOW", "1");
|
||||
}
|
||||
|
||||
if (ambient_kill)
|
||||
{
|
||||
shader->addPermutation("AMBIENT_KILL", "1");
|
||||
}
|
||||
|
||||
if (sunlight_kill)
|
||||
{
|
||||
shader->addPermutation("SUNLIGHT_KILL", "1");
|
||||
}
|
||||
|
||||
if (local_light_kill)
|
||||
{
|
||||
shader->addPermutation("LOCAL_LIGHT_KILL", "1");
|
||||
}
|
||||
|
||||
shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = make_rigged_variant(*shader, gDeferredSkinnedPBRAlphaProgram);
|
||||
if (success)
|
||||
|
|
@ -1417,6 +1431,25 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
shader->mRiggedVariant->mFeatures.hasLighting = true;
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
LLGLSLShader* shader = &gHUDPBRAlphaProgram;
|
||||
shader->mName = "HUD PBR Alpha Shader";
|
||||
|
||||
shader->mFeatures.hasSrgb = true;
|
||||
|
||||
shader->mShaderFiles.clear();
|
||||
shader->mShaderFiles.push_back(make_pair("deferred/pbralphaV.glsl", GL_VERTEX_SHADER));
|
||||
shader->mShaderFiles.push_back(make_pair("deferred/pbralphaF.glsl", GL_FRAGMENT_SHADER));
|
||||
|
||||
shader->clearPermutations();
|
||||
|
||||
shader->addPermutation("IS_HUD", "1");
|
||||
|
||||
shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED];
|
||||
success = shader->createShader(NULL, NULL);
|
||||
llassert(success);
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
|
@ -2609,7 +2642,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredWLSunProgram.mFeatures.hasTransport = true;
|
||||
gDeferredWLSunProgram.mFeatures.hasGamma = true;
|
||||
gDeferredWLSunProgram.mFeatures.hasAtmospherics = true;
|
||||
gDeferredWLSunProgram.mFeatures.isFullbright = true;
|
||||
gDeferredWLSunProgram.mFeatures.disableTextureIndex = true;
|
||||
gDeferredWLSunProgram.mFeatures.hasSrgb = true;
|
||||
gDeferredWLSunProgram.mShaderFiles.clear();
|
||||
|
|
@ -2629,7 +2661,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredWLMoonProgram.mFeatures.hasGamma = true;
|
||||
gDeferredWLMoonProgram.mFeatures.hasAtmospherics = true;
|
||||
gDeferredWLMoonProgram.mFeatures.hasSrgb = true;
|
||||
gDeferredWLMoonProgram.mFeatures.isFullbright = true;
|
||||
gDeferredWLMoonProgram.mFeatures.disableTextureIndex = true;
|
||||
|
||||
gDeferredWLMoonProgram.mShaderFiles.clear();
|
||||
|
|
@ -2801,24 +2832,6 @@ BOOL LLViewerShaderMgr::loadShadersObject()
|
|||
gPhysicsPreviewProgram.mFeatures.hasLighting = false;
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
gObjectFullbrightAlphaMaskProgram.mName = "Fullbright Alpha Mask Shader";
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.hasGamma = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.hasTransport = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.isFullbright = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.hasAlphaMask = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.hasSrgb = true;
|
||||
gObjectFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0;
|
||||
gObjectFullbrightAlphaMaskProgram.mShaderFiles.clear();
|
||||
gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER));
|
||||
gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER));
|
||||
gObjectFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
|
||||
success = make_rigged_variant(gObjectFullbrightAlphaMaskProgram, gSkinnedObjectFullbrightAlphaMaskProgram);
|
||||
success = success && gObjectFullbrightAlphaMaskProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
mShaderLevel[SHADER_OBJECT] = 0;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ extern LLGLSLShader gOneTextureFilterProgram;
|
|||
//object shaders
|
||||
extern LLGLSLShader gObjectPreviewProgram;
|
||||
extern LLGLSLShader gPhysicsPreviewProgram;
|
||||
extern LLGLSLShader gObjectFullbrightAlphaMaskProgram;
|
||||
extern LLGLSLShader gSkinnedObjectFullbrightAlphaMaskProgram;
|
||||
extern LLGLSLShader gObjectBumpProgram;
|
||||
extern LLGLSLShader gSkinnedObjectBumpProgram;
|
||||
|
|
@ -269,6 +268,9 @@ extern LLGLSLShader gDeferredGenBrdfLutProgram;
|
|||
extern LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2];
|
||||
extern LLGLSLShader gDeferredMaterialWaterProgram[LLMaterial::SHADER_COUNT*2];
|
||||
|
||||
extern LLGLSLShader gHUDPBROpaqueProgram;
|
||||
extern LLGLSLShader gPBRGlowProgram;
|
||||
extern LLGLSLShader gDeferredPBROpaqueProgram;
|
||||
extern LLGLSLShader gDeferredPBRAlphaProgram;
|
||||
extern LLGLSLShader gHUDPBRAlphaProgram;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5486,8 +5486,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
(type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)) ||
|
||||
(facep->getTextureEntry()->getFullbright());
|
||||
|
||||
if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_NORMAL))
|
||||
if (!fullbright &&
|
||||
type != LLRenderPass::PASS_GLOW &&
|
||||
!facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_NORMAL))
|
||||
{
|
||||
llassert(false);
|
||||
LL_WARNS() << "Non fullbright face has no normals!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
|
@ -5596,33 +5599,35 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
}
|
||||
}
|
||||
|
||||
if (idx >= 0 &&
|
||||
draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() &&
|
||||
draw_vec[idx]->mEnd == facep->getGeomIndex()-1 &&
|
||||
LLDrawInfo* info = idx >= 0 ? draw_vec[idx] : nullptr;
|
||||
|
||||
if (info &&
|
||||
info->mVertexBuffer == facep->getVertexBuffer() &&
|
||||
info->mEnd == facep->getGeomIndex()-1 &&
|
||||
(LLPipeline::sTextureBindTest || draw_vec[idx]->mTexture == tex || batchable) &&
|
||||
#if LL_DARWIN
|
||||
draw_vec[idx]->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
|
||||
draw_vec[idx]->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
|
||||
info->mEnd - draw_vec[idx]->mStart + facep->getGeomCount() <= (U32) gGLManager.mGLMaxVertexRange &&
|
||||
info->mCount + facep->getIndicesCount() <= (U32) gGLManager.mGLMaxIndexRange &&
|
||||
#endif
|
||||
draw_vec[idx]->mMaterialID == mat_id &&
|
||||
draw_vec[idx]->mFullbright == fullbright &&
|
||||
draw_vec[idx]->mBump == bump &&
|
||||
(!mat || (draw_vec[idx]->mShiny == shiny)) && // need to break batches when a material is shared, but legacy settings are different
|
||||
draw_vec[idx]->mTextureMatrix == tex_mat &&
|
||||
draw_vec[idx]->mModelMatrix == model_mat &&
|
||||
draw_vec[idx]->mShaderMask == shader_mask &&
|
||||
draw_vec[idx]->mAvatar == facep->mAvatar &&
|
||||
draw_vec[idx]->getSkinHash() == facep->getSkinHash())
|
||||
info->mMaterialID == mat_id &&
|
||||
info->mFullbright == fullbright &&
|
||||
info->mBump == bump &&
|
||||
(!mat || (info->mShiny == shiny)) && // need to break batches when a material is shared, but legacy settings are different
|
||||
info->mTextureMatrix == tex_mat &&
|
||||
info->mModelMatrix == model_mat &&
|
||||
info->mShaderMask == shader_mask &&
|
||||
info->mAvatar == facep->mAvatar &&
|
||||
info->getSkinHash() == facep->getSkinHash())
|
||||
{
|
||||
draw_vec[idx]->mCount += facep->getIndicesCount();
|
||||
draw_vec[idx]->mEnd += facep->getGeomCount();
|
||||
info->mCount += facep->getIndicesCount();
|
||||
info->mEnd += facep->getGeomCount();
|
||||
|
||||
if (index < FACE_DO_NOT_BATCH_TEXTURES && index >= draw_vec[idx]->mTextureList.size())
|
||||
if (index < FACE_DO_NOT_BATCH_TEXTURES && index >= info->mTextureList.size())
|
||||
{
|
||||
draw_vec[idx]->mTextureList.resize(index+1);
|
||||
draw_vec[idx]->mTextureList[index] = tex;
|
||||
info->mTextureList.resize(index+1);
|
||||
info->mTextureList[index] = tex;
|
||||
}
|
||||
draw_vec[idx]->validate();
|
||||
info->validate();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -5632,6 +5637,9 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
U32 count = facep->getIndicesCount();
|
||||
LLPointer<LLDrawInfo> draw_info = new LLDrawInfo(start,end,count,offset, tex,
|
||||
facep->getVertexBuffer(), fullbright, bump);
|
||||
|
||||
info = draw_info;
|
||||
|
||||
draw_vec.push_back(draw_info);
|
||||
draw_info->mTextureMatrix = tex_mat;
|
||||
draw_info->mModelMatrix = model_mat;
|
||||
|
|
@ -5707,6 +5715,13 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
|
|||
}
|
||||
draw_info->validate();
|
||||
}
|
||||
|
||||
llassert(type != LLPipeline::RENDER_TYPE_PASS_GLTF_PBR || info->mGLTFMaterial != nullptr);
|
||||
llassert(type != LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_RIGGED || info->mGLTFMaterial != nullptr);
|
||||
llassert(type != LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK || info->mGLTFMaterial != nullptr);
|
||||
llassert(type != LLPipeline::RENDER_TYPE_PASS_GLTF_PBR_ALPHA_MASK_RIGGED || info->mGLTFMaterial != nullptr);
|
||||
|
||||
llassert(type != LLRenderPass::PASS_NORMSPEC || info->mNormalMap.notNull());
|
||||
}
|
||||
|
||||
void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group)
|
||||
|
|
@ -6128,7 +6143,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
|
|||
}
|
||||
facep->setPoolType(type);
|
||||
|
||||
if (vobj->isHUDAttachment())
|
||||
if (vobj->isHUDAttachment() && !is_pbr)
|
||||
{
|
||||
facep->setState(LLFace::FULLBRIGHT);
|
||||
}
|
||||
|
|
@ -6856,17 +6871,17 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
fullbright = TRUE;
|
||||
}
|
||||
|
||||
if (hud_group)
|
||||
const LLTextureEntry* te = facep->getTextureEntry();
|
||||
LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial();
|
||||
|
||||
if (hud_group && gltf_mat == nullptr)
|
||||
{ //all hud attachments are fullbright
|
||||
fullbright = TRUE;
|
||||
}
|
||||
|
||||
const LLTextureEntry* te = facep->getTextureEntry();
|
||||
|
||||
tex = facep->getTexture();
|
||||
|
||||
BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;
|
||||
|
||||
LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial();
|
||||
|
||||
LLMaterial* mat = nullptr;
|
||||
bool can_be_shiny = false;
|
||||
|
|
@ -6892,7 +6907,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
|
||||
is_alpha = (is_alpha || transparent) ? TRUE : FALSE;
|
||||
|
||||
if ((gltf_mat || mat) && LLPipeline::sRenderDeferred && !hud_group)
|
||||
if (gltf_mat || (mat && !hud_group))
|
||||
{
|
||||
bool material_pass = false;
|
||||
|
||||
|
|
@ -7062,7 +7077,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY);
|
||||
registerFace(group, facep, LLRenderPass::PASS_INVISIBLE);
|
||||
}
|
||||
else if (LLPipeline::sRenderDeferred && !hud_group)
|
||||
else if (!hud_group)
|
||||
{ //deferred rendering
|
||||
if (te->getFullbright())
|
||||
{ //register in post deferred fullbright shiny pass
|
||||
|
|
@ -7107,7 +7122,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
|
||||
}
|
||||
if (LLPipeline::sRenderDeferred && !hud_group && LLPipeline::sRenderBump && use_legacy_bump)
|
||||
if (!hud_group && LLPipeline::sRenderBump && use_legacy_bump)
|
||||
{ //if this is the deferred render and a bump map is present, register in post deferred bump
|
||||
registerFace(group, facep, LLRenderPass::PASS_POST_BUMP);
|
||||
}
|
||||
|
|
@ -7143,7 +7158,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
}
|
||||
|
||||
//not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010
|
||||
if (!is_alpha && (hud_group || !LLPipeline::sRenderDeferred))
|
||||
if (!is_alpha && hud_group)
|
||||
{
|
||||
llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright);
|
||||
facep->setPoolType((fullbright) ? LLDrawPool::POOL_FULLBRIGHT : LLDrawPool::POOL_SIMPLE);
|
||||
|
|
@ -7156,7 +7171,14 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
|
||||
if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f)
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_GLOW);
|
||||
if (gltf_mat)
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_GLTF_GLOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_GLOW);
|
||||
}
|
||||
}
|
||||
|
||||
++face_iter;
|
||||
|
|
|
|||
|
|
@ -907,6 +907,11 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
|
|||
}
|
||||
// [/SL:KB]
|
||||
|
||||
if (LLPipeline::sRenderTransparentWater)
|
||||
{ //water reflection texture
|
||||
mWaterDis.allocate(resX, resY, GL_RGBA, true);
|
||||
}
|
||||
|
||||
if (RenderUIBuffer)
|
||||
{
|
||||
if (!mRT->uiScreen.allocate(resX,resY, GL_RGBA))
|
||||
|
|
@ -1203,7 +1208,6 @@ void LLPipeline::releaseGLBuffers()
|
|||
|
||||
releaseLUTBuffers();
|
||||
|
||||
mWaterRef.release();
|
||||
mWaterDis.release();
|
||||
mBake.release();
|
||||
|
||||
|
|
@ -1278,12 +1282,6 @@ void LLPipeline::createGLBuffers()
|
|||
assertInitialized();
|
||||
|
||||
exoPostProcess::instance().ExodusRenderPostUpdate(); // <FS:CR> Import Vignette from Exodus
|
||||
if (LLPipeline::sRenderTransparentWater)
|
||||
{ //water reflection texture
|
||||
U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512);
|
||||
mWaterDis.allocate(res,res,GL_RGBA,true);
|
||||
}
|
||||
|
||||
// Use FBO for bake tex
|
||||
// <FS:Ansariel> Allow higher resolution rendering in mesh render preview
|
||||
//mBake.allocate(512, 512, GL_RGBA, true); // SL-12781 Build > Upload > Model; 3D Preview
|
||||
|
|
@ -4092,6 +4090,8 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera, bool do_occlusion)
|
|||
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GEOMETRY);
|
||||
LL_PROFILE_GPU_ZONE("renderGeomDeferred");
|
||||
|
||||
llassert(!sRenderingHUDs);
|
||||
|
||||
if (gUseWireframe)
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
|
@ -8176,6 +8176,8 @@ void LLPipeline::renderDeferredLighting()
|
|||
return;
|
||||
}
|
||||
|
||||
llassert(!sRenderingHUDs);
|
||||
|
||||
static LLCachedControl<F32> ambiance_scale(gSavedSettings, "RenderReflectionProbeAmbianceScale", 8.f);
|
||||
|
||||
F32 light_scale = 1.f;
|
||||
|
|
@ -8617,6 +8619,7 @@ void LLPipeline::renderDeferredLighting()
|
|||
LLPipeline::RENDER_TYPE_VOLUME,
|
||||
LLPipeline::RENDER_TYPE_GLOW,
|
||||
LLPipeline::RENDER_TYPE_BUMP,
|
||||
LLPipeline::RENDER_TYPE_GLTF_PBR,
|
||||
LLPipeline::RENDER_TYPE_PASS_SIMPLE,
|
||||
LLPipeline::RENDER_TYPE_PASS_ALPHA,
|
||||
LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK,
|
||||
|
|
@ -8626,6 +8629,7 @@ void LLPipeline::renderDeferredLighting()
|
|||
LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK,
|
||||
LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY,
|
||||
LLPipeline::RENDER_TYPE_PASS_GLOW,
|
||||
LLPipeline::RENDER_TYPE_PASS_GLTF_GLOW,
|
||||
LLPipeline::RENDER_TYPE_PASS_GRASS,
|
||||
LLPipeline::RENDER_TYPE_PASS_SHINY,
|
||||
LLPipeline::RENDER_TYPE_PASS_INVISIBLE,
|
||||
|
|
|
|||
|
|
@ -496,6 +496,8 @@ public:
|
|||
RENDER_TYPE_PASS_POST_BUMP_RIGGED = LLRenderPass::PASS_POST_BUMP_RIGGED,
|
||||
RENDER_TYPE_PASS_GLOW = LLRenderPass::PASS_GLOW,
|
||||
RENDER_TYPE_PASS_GLOW_RIGGED = LLRenderPass::PASS_GLOW_RIGGED,
|
||||
RENDER_TYPE_PASS_GLTF_GLOW = LLRenderPass::PASS_GLTF_GLOW,
|
||||
RENDER_TYPE_PASS_GLTF_GLOW_RIGGED = LLRenderPass::PASS_GLTF_GLOW_RIGGED,
|
||||
RENDER_TYPE_PASS_ALPHA = LLRenderPass::PASS_ALPHA,
|
||||
RENDER_TYPE_PASS_ALPHA_MASK = LLRenderPass::PASS_ALPHA_MASK,
|
||||
RENDER_TYPE_PASS_ALPHA_MASK_RIGGED = LLRenderPass::PASS_ALPHA_MASK_RIGGED,
|
||||
|
|
@ -730,12 +732,6 @@ public:
|
|||
LLVector4 mSunOrthoClipPlanes;
|
||||
LLVector2 mScreenScale;
|
||||
|
||||
//water reflection texture
|
||||
LLRenderTarget mWaterRef;
|
||||
LLRenderTarget mWaterDeferredScreen;
|
||||
LLRenderTarget mWaterDeferredDepth;
|
||||
LLRenderTarget mWaterOcclusionDepth;
|
||||
LLRenderTarget mWaterDeferredLight;
|
||||
//water distortion texture (refraction)
|
||||
LLRenderTarget mWaterDis;
|
||||
|
||||
|
|
|
|||
|
|
@ -1506,16 +1506,6 @@ Running in window.
|
|||
<string name="MBDevContextErr">Can't make GL device context</string>
|
||||
<string name="MBPixelFmtErr">Can't find suitable pixel format</string>
|
||||
<string name="MBPixelFmtDescErr">Can't get pixel format description</string>
|
||||
<string name="MBTrueColorWindow">
|
||||
[APP_NAME] requires True Color (32-bit) to run.
|
||||
Please go to your computer's display settings and set the color mode to 32-bit.
|
||||
</string>
|
||||
<string name="MBAlpha">
|
||||
[APP_NAME] is unable to run because it can't get an 8 bit alpha channel. Usually this is due to video card driver issues.
|
||||
Please make sure you have the latest video card drivers installed.
|
||||
Also be sure your monitor is set to True Color (32-bit) in Control Panels > Display > Settings.
|
||||
If you continue to receive this message, contact the [SUPPORT_SITE].
|
||||
</string>
|
||||
<string name="MBPixelFmtSetErr">Can't set pixel format</string>
|
||||
<string name="MBGLContextErr">Can't create GL rendering context</string>
|
||||
<string name="MBGLContextActErr">Can't activate GL rendering context</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue