summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llmath/llvector4a.h33
-rw-r--r--indra/llrender/llglslshader.cpp71
-rw-r--r--indra/llrender/llglslshader.h25
-rw-r--r--indra/llrender/llshadermgr.cpp3
-rw-r--r--indra/llrender/llshadermgr.h2
-rw-r--r--indra/llrender/llvertexbuffer.cpp16
-rw-r--r--indra/llrender/llvertexbuffer.h3
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/srgbF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessF.glsl176
-rw-r--r--indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessV.glsl43
-rw-r--r--indra/newview/gltf/buffer_util.h10
-rw-r--r--indra/newview/gltf/primitive.cpp352
-rw-r--r--indra/newview/gltf/primitive.h15
-rw-r--r--indra/newview/gltfscenemanager.cpp64
-rw-r--r--indra/newview/gltfscenemanager.h9
-rw-r--r--indra/newview/lldrawpoolalpha.cpp22
-rw-r--r--indra/newview/lldrawpoolsimple.cpp57
-rw-r--r--indra/newview/llglsandbox.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp242
-rw-r--r--indra/newview/llvocache.cpp14
21 files changed, 743 insertions, 420 deletions
diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h
index 47f2a095a8..1c3bc74f15 100644
--- a/indra/llmath/llvector4a.h
+++ b/indra/llmath/llvector4a.h
@@ -127,6 +127,39 @@ public:
return !(*this == rhs);
}
+ const LLVector4a& operator+=(const LLVector4a& rhs)
+ {
+ add(rhs);
+ return *this;
+ }
+
+ const LLVector4a& operator-=(const LLVector4a& rhs)
+ {
+ sub(rhs);
+ return *this;
+ }
+
+ LLVector4a operator+(const LLVector4a& rhs) const
+ {
+ LLVector4a result = *this;
+ result.add(rhs);
+ return result;
+ }
+
+ LLVector4a operator-(const LLVector4a& rhs) const
+ {
+ LLVector4a result = *this;
+ result.sub(rhs);
+ return result;
+ }
+
+ LLVector4a cross3(const LLVector4a& b) const
+ {
+ LLVector4a result;
+ result.setCross3(*this, b);
+ return result;
+ }
+
////////////////////////////////////
// LOAD/STORE
////////////////////////////////////
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 8ea134393a..6a60914b80 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -381,13 +381,10 @@ void LLGLSLShader::unloadInternal()
stop_glerror();
}
-bool LLGLSLShader::createShader(std::vector<LLStaticHashedString>* attributes,
- std::vector<LLStaticHashedString>* uniforms,
- U32 varying_count,
- const char** varyings)
+bool LLGLSLShader::createShader()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
-
+
unloadInternal();
sInstances.insert(this);
@@ -454,11 +451,11 @@ bool LLGLSLShader::createShader(std::vector<LLStaticHashedString>* attributes,
// Map attributes and uniforms
if (success)
{
- success = mapAttributes(attributes);
+ success = mapAttributes();
}
if (success)
{
- success = mapUniforms(uniforms);
+ success = mapUniforms();
}
if (!success)
{
@@ -469,7 +466,7 @@ bool LLGLSLShader::createShader(std::vector<LLStaticHashedString>* attributes,
{
LL_SHADER_LOADING_WARNS() << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
mShaderLevel--;
- return createShader(attributes, uniforms);
+ return createShader();
}
else
{
@@ -602,7 +599,7 @@ void LLGLSLShader::attachObjects(GLuint* objects, S32 count)
}
}
-bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attributes)
+bool LLGLSLShader::mapAttributes()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
@@ -621,11 +618,10 @@ bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attrib
}
mAttribute.clear();
- U32 numAttributes = (attributes == NULL) ? 0 : attributes->size();
#if LL_RELEASE_WITH_DEBUG_INFO
- mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL });
+ mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size(), { -1, NULL });
#else
- mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, -1);
+ mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size(), -1);
#endif
if (res)
@@ -649,19 +645,6 @@ bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attrib
LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
}
}
- if (attributes != NULL)
- {
- for (U32 i = 0; i < numAttributes; i++)
- {
- const char* name = (*attributes)[i].String().c_str();
- S32 index = glGetAttribLocation(mProgramObject, name);
- if (index != -1)
- {
- mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index;
- LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
- }
- }
- }
return true;
}
@@ -669,7 +652,7 @@ bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attrib
return false;
}
-void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString>* uniforms)
+void LLGLSLShader::mapUniform(GLint index)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
@@ -756,21 +739,6 @@ void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString>* u
return;
}
}
-
- if (uniforms != NULL)
- {
- for (U32 i = 0; i < uniforms->size(); i++)
- {
- if ((mUniform[i + LLShaderMgr::instance()->mReservedUniforms.size()] == -1)
- && ((*uniforms)[i].String() == name))
- {
- //found it
- mUniform[i + LLShaderMgr::instance()->mReservedUniforms.size()] = location;
- mTexture[i + LLShaderMgr::instance()->mReservedUniforms.size()] = mapUniformTextureChannel(location, type, size);
- return;
- }
- }
- }
}
}
@@ -830,7 +798,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type, GLint
return -1;
}
-bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms)
+bool LLGLSLShader::mapUniforms()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
@@ -843,9 +811,8 @@ bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms)
mTexture.clear();
mValue.clear();
//initialize arrays
- U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size();
- mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
- mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
+ mUniform.resize(LLShaderMgr::instance()->mReservedUniforms.size(), -1);
+ mTexture.resize(LLShaderMgr::instance()->mReservedUniforms.size(), -1);
bind();
@@ -946,26 +913,26 @@ bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms)
if (specularDiff || bumpLessDiff || envLessDiff || refLessDiff)
{
- mapUniform(diffuseMap, uniforms);
+ mapUniform(diffuseMap);
skip_index.insert(diffuseMap);
if (-1 != specularMap) {
- mapUniform(specularMap, uniforms);
+ mapUniform(specularMap);
skip_index.insert(specularMap);
}
if (-1 != bumpMap) {
- mapUniform(bumpMap, uniforms);
+ mapUniform(bumpMap);
skip_index.insert(bumpMap);
}
if (-1 != environmentMap) {
- mapUniform(environmentMap, uniforms);
+ mapUniform(environmentMap);
skip_index.insert(environmentMap);
}
if (-1 != reflectionMap) {
- mapUniform(reflectionMap, uniforms);
+ mapUniform(reflectionMap);
skip_index.insert(reflectionMap);
}
}
@@ -979,7 +946,7 @@ bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms)
if (skip_index.end() != skip_index.find(i)) continue;
//........................................................................................
- mapUniform(i, uniforms);
+ mapUniform(i);
}
//........................................................................................................................................
@@ -1057,7 +1024,7 @@ void LLGLSLShader::bind()
}
}
-void LLGLSLShader::bind(U32 variant)
+void LLGLSLShader::bind(U8 variant)
{
llassert(mGLTFVariants.size() == LLGLSLShader::NUM_GLTF_VARIANTS);
llassert(variant < LLGLSLShader::NUM_GLTF_VARIANTS);
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 8ebea2deca..f2b5c4881c 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -184,17 +184,14 @@ public:
// If force_read is true, will force an immediate readback (severe performance penalty)
bool readProfileQuery(bool for_runtime = false, bool force_read = false);
- bool createShader(std::vector<LLStaticHashedString>* attributes,
- std::vector<LLStaticHashedString>* uniforms,
- U32 varying_count = 0,
- const char** varyings = NULL);
+ bool createShader();
bool attachFragmentObject(std::string object);
bool attachVertexObject(std::string object);
void attachObject(GLuint object);
void attachObjects(GLuint* objects = NULL, S32 count = 0);
- bool mapAttributes(const std::vector<LLStaticHashedString>* attributes);
- bool mapUniforms(const std::vector<LLStaticHashedString>*);
- void mapUniform(GLint index, const std::vector<LLStaticHashedString>*);
+ bool mapAttributes();
+ bool mapUniforms();
+ void mapUniform(GLint index);
void uniform1i(U32 index, GLint i);
void uniform1f(U32 index, GLfloat v);
void fastUniform1f(U32 index, GLfloat v);
@@ -330,22 +327,20 @@ public:
// variants for use by GLTF renderer
// bit 0 = alpha mode blend (1) or opaque (0)
// bit 1 = rigged (1) or static (0)
+ // bit 2 = unlit (1) or lit (0)
struct GLTFVariant
{
- constexpr static U32 RIGGED = 2;
- constexpr static U32 ALPHA = 1;
- constexpr static U32 OPAQUE_STATIC = 0;
- constexpr static U32 ALPHA_STATIC = 1;
- constexpr static U32 OPAQUE_RIGGED = 2;
- constexpr static U32 ALPHA_RIGGED = 3;
+ constexpr static U8 ALPHA_BLEND = 1;
+ constexpr static U8 RIGGED = 2;
+ constexpr static U8 UNLIT = 4;
};
- constexpr static U32 NUM_GLTF_VARIANTS = 4;
+ constexpr static U8 NUM_GLTF_VARIANTS = 8;
std::vector<LLGLSLShader> mGLTFVariants;
//helper to bind GLTF variant
- void bind(U32 variant);
+ void bind(U8 variant);
// hacky flag used for optimization in LLDrawPoolAlpha
bool mCanBindFast = false;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 4e8adb2fb3..4d53df5f06 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1157,6 +1157,7 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedAttribs.push_back("weight");
mReservedAttribs.push_back("weight4");
mReservedAttribs.push_back("clothing");
+ mReservedAttribs.push_back("joint");
mReservedAttribs.push_back("texture_index");
//matrix state
@@ -1239,7 +1240,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("heroProbes");
mReservedUniforms.push_back("cloud_noise_texture");
mReservedUniforms.push_back("cloud_noise_texture_next");
- mReservedUniforms.push_back("fullbright");
mReservedUniforms.push_back("lightnorm");
mReservedUniforms.push_back("sunlight_color");
mReservedUniforms.push_back("ambient_color");
@@ -1363,7 +1363,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("bloomMap");
mReservedUniforms.push_back("projectionMap");
mReservedUniforms.push_back("norm_mat");
- mReservedUniforms.push_back("texture_gamma");
mReservedUniforms.push_back("specular_color");
mReservedUniforms.push_back("env_intensity");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 03803c0e96..53e3d010db 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -107,7 +107,6 @@ public:
HERO_PROBE, // "heroProbes"
CLOUD_NOISE_MAP, // "cloud_noise_texture"
CLOUD_NOISE_MAP_NEXT, // "cloud_noise_texture_next"
- FULLBRIGHT, // "fullbright"
LIGHTNORM, // "lightnorm"
SUNLIGHT_COLOR, // "sunlight_color"
AMBIENT, // "ambient_color"
@@ -217,7 +216,6 @@ public:
DEFERRED_BLOOM, // "bloomMap"
DEFERRED_PROJECTION, // "projectionMap"
DEFERRED_NORM_MATRIX, // "norm_mat"
- TEXTURE_GAMMA, // "texture_gamma"
SPECULAR_COLOR, // "specular_color"
ENVIRONMENT_INTENSITY, // "env_intensity"
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index fa3b2df6e0..a4d33c91df 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -600,6 +600,7 @@ const U32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] =
sizeof(F32), // TYPE_WEIGHT,
sizeof(LLVector4), // TYPE_WEIGHT4,
sizeof(LLVector4), // TYPE_CLOTHWEIGHT,
+ sizeof(U64), // TYPE_JOINT,
sizeof(LLVector4), // TYPE_TEXTURE_INDEX (actually exists as position.w), no extra data, but stride is 16 bytes
};
@@ -617,6 +618,7 @@ static const std::string vb_type_name[] =
"TYPE_WEIGHT",
"TYPE_WEIGHT4",
"TYPE_CLOTHWEIGHT",
+ "TYPE_JOINT"
"TYPE_TEXTURE_INDEX",
"TYPE_MAX",
"TYPE_INDEX",
@@ -1598,6 +1600,12 @@ void LLVertexBuffer::setupVertexBuffer()
void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT4]);
glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
}
+ if (data_mask & MAP_JOINT)
+ {
+ AttributeType loc = TYPE_JOINT;
+ void* ptr = (void*)(base + mOffsets[TYPE_JOINT]);
+ glVertexAttribIPointer(loc, 4, GL_UNSIGNED_SHORT, LLVertexBuffer::sTypeSize[TYPE_JOINT], ptr);
+ }
if (data_mask & MAP_CLOTHWEIGHT)
{
AttributeType loc = TYPE_CLOTHWEIGHT;
@@ -1667,6 +1675,14 @@ void LLVertexBuffer::setWeight4Data(const LLVector4a* data)
flush_vbo(GL_ARRAY_BUFFER, mOffsets[TYPE_WEIGHT4], mOffsets[TYPE_WEIGHT4] + sTypeSize[TYPE_WEIGHT4] * getNumVerts() - 1, (U8*) data, mMappedData);
}
+void LLVertexBuffer::setJointData(const U64* data)
+{
+#if !LL_DARWIN
+ llassert(sGLRenderBuffer == mGLBuffer);
+#endif
+ flush_vbo(GL_ARRAY_BUFFER, mOffsets[TYPE_JOINT], mOffsets[TYPE_JOINT] + sTypeSize[TYPE_JOINT] * getNumVerts() - 1, (U8*) data, mMappedData);
+}
+
void LLVertexBuffer::setIndexData(const U16* data)
{
#if !LL_DARWIN
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index f75849c82f..94339191a4 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -110,6 +110,7 @@ public:
TYPE_WEIGHT, // "weight"
TYPE_WEIGHT4, // "weight4"
TYPE_CLOTHWEIGHT, // "clothing"
+ TYPE_JOINT, // "joint"
TYPE_TEXTURE_INDEX, // "texture_index"
TYPE_MAX, // TYPE_MAX is the size/boundary marker for attributes that go in the vertex buffer
TYPE_INDEX, // TYPE_INDEX is beyond _MAX because it lives in a separate (index) buffer
@@ -129,6 +130,7 @@ public:
MAP_WEIGHT = (1<<TYPE_WEIGHT),
MAP_WEIGHT4 = (1<<TYPE_WEIGHT4),
MAP_CLOTHWEIGHT = (1<<TYPE_CLOTHWEIGHT),
+ MAP_JOINT = (1<<TYPE_JOINT),
MAP_TEXTURE_INDEX = (1<<TYPE_TEXTURE_INDEX),
};
@@ -193,6 +195,7 @@ public:
void setNormalData(const LLVector4a* data);
void setTangentData(const LLVector4a* data);
void setWeight4Data(const LLVector4a* data);
+ void setJointData(const U64* data);
void setTexCoordData(const LLVector2* data);
void setColorData(const LLColor4U* data);
void setIndexData(const U16* data);
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c7999fc2e9..3dc72553dc 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -15741,7 +15741,7 @@
<key>GLTFEnabled</key>
<map>
<key>Comment</key>
- <string>Enable GLTF support. Set by SimulatorFeatures</string>
+ <string>Enable GLTF support. Set to true by simulator if the simulator you are connected to supports GLTF Asset upload. WARNING: Manually setting this to true will enable buttons that can drain your L$ balance by implicitly uploading textures without asking.</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
index 7e1d906878..d7f6d20547 100644
--- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
@@ -23,8 +23,6 @@
* $/LicenseInfo$
*/
- uniform sampler2D exposureMap;
-
vec3 srgb_to_linear(vec3 cs)
{
vec3 low_range = cs / vec3(12.92);
diff --git a/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessF.glsl b/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessF.glsl
index a59127ec77..d71a3fad99 100644
--- a/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessF.glsl
+++ b/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessF.glsl
@@ -28,20 +28,61 @@
// GLTF pbrMetallicRoughness implementation
-uniform sampler2D diffuseMap; //always in sRGB space
-uniform float metallicFactor;
-uniform float roughnessFactor;
+// ==================================
+// needed by all variants
+// ==================================
+uniform sampler2D diffuseMap; //always in sRGB space
+uniform sampler2D emissiveMap;
uniform vec3 emissiveColor;
+in vec3 vary_position;
+in vec4 vertex_color;
+in vec2 base_color_texcoord;
+in vec2 emissive_texcoord;
+uniform float minimum_alpha;
+
+void mirrorClip(vec3 pos);
+vec3 linear_to_srgb(vec3 c);
+vec3 srgb_to_linear(vec3 c);
+// ==================================
+
+
+// ==================================
+// needed by all lit variants
+// ==================================
+#ifndef UNLIT
uniform sampler2D normalMap;
-uniform sampler2D emissiveMap;
uniform sampler2D metallicRoughnessMap;
uniform sampler2D occlusionMap;
+uniform float metallicFactor;
+uniform float roughnessFactor;
+in vec3 vary_normal;
+in vec3 vary_tangent;
+flat in float vary_sign;
+in vec2 normal_texcoord;
+in vec2 metallic_roughness_texcoord;
+#endif
+// ==================================
-#ifdef ALPHA_BLEND
-out vec4 frag_color;
+// ==================================
+// needed by all alpha variants
+// ==================================
+#ifdef ALPHA_BLEND
in vec3 vary_fragcoord;
+uniform vec4 clipPlane;
+uniform float clipSign;
+void waterClip(vec3 pos);
+void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
+vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
+#endif
+// ==================================
+
+
+// ==================================
+// needed by lit alpha
+// ==================================
+#if defined(ALPHA_BLEND) && !defined(UNLIT)
#ifdef HAS_SUN_SHADOW
uniform sampler2D lightMap;
@@ -60,21 +101,12 @@ uniform int sun_up_factor;
uniform vec3 sun_dir;
uniform vec3 moon_dir;
-vec3 srgb_to_linear(vec3 c);
-vec3 linear_to_srgb(vec3 c);
-
-void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
-vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
-
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
-void mirrorClip(vec3 pos);
-void waterClip(vec3 pos);
-
void calcDiffuseSpecular(vec3 baseColor, float metallic, inout vec3 diffuseColor, inout vec3 specularColor);
vec3 pbrBaseLight(vec3 diffuseColor,
@@ -104,44 +136,36 @@ vec3 pbrCalcPointLightOrSpotLight(vec3 diffuseColor, vec3 specularColor,
vec3 lightColor,
float lightSize, float falloff, float is_pointlight, float ambiance);
+#endif
+// ==================================
+
+// ==================================
+// output definition
+// ==================================
+#if defined(ALPHA_BLEND) || defined(UNLIT)
+out vec4 frag_color;
#else
out vec4 frag_data[4];
#endif
-
-
-in vec3 vary_position;
-in vec4 vertex_color;
-in vec3 vary_normal;
-in vec3 vary_tangent;
-flat in float vary_sign;
-
-in vec2 base_color_texcoord;
-in vec2 normal_texcoord;
-in vec2 metallic_roughness_texcoord;
-in vec2 emissive_texcoord;
-
-uniform float minimum_alpha;
-
-vec3 linear_to_srgb(vec3 c);
-vec3 srgb_to_linear(vec3 c);
-
-uniform vec4 clipPlane;
-uniform float clipSign;
-
-void mirrorClip(vec3 pos);
-
-uniform mat3 normal_matrix;
+// ==================================
void main()
{
+
+// ==================================
+// all variants
+// mirror clip
+// base color
+// masking
+// emissive
+// ==================================
vec3 pos = vary_position;
mirrorClip(pos);
vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba;
basecolor.rgb = srgb_to_linear(basecolor.rgb);
-
basecolor *= vertex_color;
if (basecolor.a < minimum_alpha)
@@ -149,8 +173,16 @@ void main()
discard;
}
- vec3 col = basecolor.rgb;
-
+ vec3 emissive = emissiveColor;
+ emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
+// ==================================
+
+// ==================================
+// all lit variants
+// prepare norm
+// prepare orm
+// ==================================
+#ifndef UNLIT
// from mikktspace.com
vec3 vNt = texture(normalMap, normal_texcoord.xy).xyz*2.0-1.0;
float sign = vary_sign;
@@ -159,6 +191,7 @@ void main()
vec3 vB = sign * cross(vN, vT);
vec3 norm = normalize( vNt.x * vT + vNt.y * vB + vNt.z * vN );
+ norm *= gl_FrontFacing ? 1.0 : -1.0;
// RGB = Occlusion, Roughness, Metal
// default values, see LLViewerTexture::sDefaultPBRORMImagep
@@ -169,24 +202,49 @@ void main()
orm.r = texture(occlusionMap, metallic_roughness_texcoord.xy).r;
orm.g *= roughnessFactor;
orm.b *= metallicFactor;
+#endif
+// ==================================
+
+// ==================================
+// non alpha output
+// ==================================
+#ifndef ALPHA_BLEND
+#ifdef UNLIT
+ vec4 color = basecolor;
+ color.rgb += emissive.rgb;
+ frag_color = color;
+#else
+ frag_data[0] = max(vec4(basecolor.rgb, 0.0), vec4(0));
+ frag_data[1] = max(vec4(orm.rgb,0.0), vec4(0));
+ frag_data[2] = vec4(norm, GBUFFER_FLAG_HAS_PBR);
+ frag_data[3] = max(vec4(emissive,0), vec4(0));
+#endif
+#endif
- vec3 emissive = emissiveColor;
- emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb);
-
- norm *= gl_FrontFacing ? 1.0 : -1.0;
+// ==================================
+// alpha implementation
+// ==================================
#ifdef ALPHA_BLEND
- vec3 color = vec3(0,0,0);
-
- vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
float scol = 1.0;
vec3 sunlit;
vec3 amblit;
vec3 additive;
vec3 atten;
+
+ vec3 light_dir;
+
+#ifdef UNLIT
+ light_dir = vec3(0,0,1);
+ vec3 norm = vec3(0,0,1);
+#else
+ light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
+#endif
+
calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten);
+#ifndef UNLIT
vec3 sunlit_linear = srgb_to_linear(sunlit);
vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
@@ -198,11 +256,6 @@ void main()
float perceptualRoughness = orm.g * roughnessFactor;
float metallic = orm.b * metallicFactor;
- // 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(texture(emissiveMap, emissive_texcoord.xy).rgb);
-
// PBR IBL
float gloss = 1.0 - perceptualRoughness;
vec3 irradiance = vec3(0);
@@ -211,11 +264,11 @@ void main()
vec3 diffuseColor;
vec3 specularColor;
- calcDiffuseSpecular(col.rgb, metallic, diffuseColor, specularColor);
+ calcDiffuseSpecular(basecolor.rgb, metallic, diffuseColor, specularColor);
vec3 v = -normalize(pos.xyz);
- color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit_linear, scol, radiance, irradiance, colorEmissive, orm.r, additive, atten);
+ vec3 color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit_linear, scol, radiance, irradiance, emissive, orm.r, additive, atten);
vec3 light = vec3(0);
@@ -237,12 +290,11 @@ void main()
float a = basecolor.a*vertex_color.a;
frag_color = max(vec4(color.rgb,a), vec4(0));
-#else
- // See: C++: addDeferredAttachments(), GLSL: softenLightF
- frag_data[0] = max(vec4(col, 0.0), vec4(0));
- frag_data[1] = max(vec4(orm.rgb,0.0), vec4(0));
- frag_data[2] = vec4(norm, GBUFFER_FLAG_HAS_PBR);
- frag_data[3] = max(vec4(emissive,0), vec4(0));
+#else // UNLIT
+ vec4 color = basecolor;
+ color.rgb += emissive.rgb;
+ frag_color = color;
#endif
+#endif // ALPHA_BLEND
}
diff --git a/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessV.glsl b/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessV.glsl
index 0ed1c5d315..f123c29101 100644
--- a/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessV.glsl
+++ b/indra/newview/app_settings/shaders/class1/gltf/pbrmetallicroughnessV.glsl
@@ -42,32 +42,32 @@ uniform vec4[2] texture_emissive_transform;
in vec3 position;
in vec4 diffuse_color;
-in vec3 normal;
-in vec4 tangent;
in vec2 texcoord0;
-
out vec2 base_color_texcoord;
-out vec2 normal_texcoord;
-out vec2 metallic_roughness_texcoord;
out vec2 emissive_texcoord;
-
out vec4 vertex_color;
+out vec3 vary_position;
+#ifndef UNLIT
+in vec3 normal;
+in vec4 tangent;
+out vec2 normal_texcoord;
+out vec2 metallic_roughness_texcoord;
out vec3 vary_tangent;
flat out float vary_sign;
out vec3 vary_normal;
-out vec3 vary_position;
+vec3 tangent_space_transform(vec4 vertex_tangent, vec3 vertex_normal, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
+#endif
vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
-vec3 tangent_space_transform(vec4 vertex_tangent, vec3 vertex_normal, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
#ifdef ALPHA_BLEND
out vec3 vary_fragcoord;
#endif
-
#ifdef HAS_SKIN
+in uvec4 joint;
in vec4 weight4;
layout (std140) uniform GLTFJoints
@@ -80,18 +80,12 @@ mat4 getGLTFSkinTransform()
{
int i;
- vec4 w = fract(weight4);
- vec4 index = floor(weight4);
-
- index = min(index, vec4(MAX_JOINTS_PER_GLTF_OBJECT-1));
- index = max(index, vec4( 0.0));
-
- w *= 1.0/(w.x+w.y+w.z+w.w);
+ vec4 w = weight4;
- int i1 = int(index.x);
- int i2 = int(index.y);
- int i3 = int(index.z);
- int i4 = int(index.w);
+ uint i1 = joint.x;
+ uint i2 = joint.y;
+ uint i3 = joint.z;
+ uint i4 = joint.w;
mat3 mat = mat3(gltf_joints[i1])*w.x;
mat += mat3(gltf_joints[i2])*w.y;
@@ -143,10 +137,15 @@ void main()
#endif
base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
+
+#ifndef UNLIT
normal_texcoord = texture_transform(texcoord0, texture_normal_transform, texture_matrix0);
metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_transform, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
+#endif
+
+#ifndef UNLIT
#ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
vec3 t = (mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz;
@@ -156,10 +155,10 @@ void main()
#endif
n = normalize(n);
-
vary_tangent = normalize(tangent_space_transform(vec4(t, tangent.w), n, texture_normal_transform, texture_matrix0));
vary_sign = tangent.w;
vary_normal = n;
+#endif
vertex_color = diffuse_color;
#ifdef ALPHA_BLEND
diff --git a/indra/newview/gltf/buffer_util.h b/indra/newview/gltf/buffer_util.h
index 548d4ec5d6..bd43f60d19 100644
--- a/indra/newview/gltf/buffer_util.h
+++ b/indra/newview/gltf/buffer_util.h
@@ -171,6 +171,16 @@ namespace LL
}
template<>
+ inline void copyVec4<U16, U64>(U16* src, U64& dst)
+ {
+ U16* data = (U16*)&dst;
+ data[0] = src[0];
+ data[1] = src[1];
+ data[2] = src[2];
+ data[3] = src[3];
+ }
+
+ template<>
inline void copyVec4<U16, LLColor4U>(U16* src, LLColor4U& dst)
{
dst.set(src[0], src[1], src[2], src[3]);
diff --git a/indra/newview/gltf/primitive.cpp b/indra/newview/gltf/primitive.cpp
index 886b8f79c9..8d9880951b 100644
--- a/indra/newview/gltf/primitive.cpp
+++ b/indra/newview/gltf/primitive.cpp
@@ -30,9 +30,204 @@
#include "buffer_util.h"
#include "../llviewershadermgr.h"
+#include "mikktspace/mikktspace.hh"
+
+#include "meshoptimizer/meshoptimizer.h"
+
+
using namespace LL::GLTF;
using namespace boost::json;
+
+// Mesh data useful for Mikktspace tangent generation (and flat normal generation)
+struct MikktMesh
+{
+ std::vector<LLVector3> p;
+ std::vector<LLVector3> n;
+ std::vector<LLVector2> tc;
+ std::vector<LLVector4> w;
+ std::vector<LLVector4> t;
+ std::vector<LLColor4U> c;
+ std::vector<U64> j;
+
+ // initialize from src primitive and make an unrolled triangle list
+ // returns false if the Primitive cannot be converted to a triangle list
+ bool copy(const Primitive* prim)
+ {
+ bool indexed = !prim->mIndexArray.empty();
+ U32 vert_count = indexed ? prim->mIndexArray.size() : prim->mPositions.size();
+
+ if (prim->mMode != Primitive::Mode::TRIANGLES)
+ {
+ LL_WARNS("GLTF") << "Unsupported primitive mode for conversion to triangles: " << (S32) prim->mMode << LL_ENDL;
+ return false;
+ }
+
+ p.resize(vert_count);
+ n.resize(vert_count);
+ tc.resize(vert_count);
+ c.resize(vert_count);
+
+ bool has_normals = !prim->mNormals.empty();
+ if (has_normals)
+ {
+ n.resize(vert_count);
+ }
+ bool has_tangents = !prim->mTangents.empty();
+ if (has_tangents)
+ {
+ t.resize(vert_count);
+ }
+ bool rigged = !prim->mWeights.empty();
+ if (rigged)
+ {
+ w.resize(vert_count);
+ j.resize(vert_count);
+ }
+
+ for (int i = 0; i < vert_count; ++i)
+ {
+ U32 idx = indexed ? prim->mIndexArray[i] : i;
+
+ p[i].set(prim->mPositions[idx].getF32ptr());
+ tc[i].set(prim->mTexCoords[idx]);
+ c[i] = prim->mColors[idx];
+
+ if (has_normals)
+ {
+ n[i].set(prim->mNormals[idx].getF32ptr());
+ }
+
+ if (rigged)
+ {
+ w[i].set(prim->mWeights[idx].getF32ptr());
+ j[i] = prim->mJoints[idx];
+ }
+ }
+
+ return true;
+ }
+
+ void genNormals()
+ {
+ U32 tri_count = p.size() / 3;
+ for (U32 i = 0; i < tri_count; ++i)
+ {
+ LLVector3 v0 = p[i * 3];
+ LLVector3 v1 = p[i * 3 + 1];
+ LLVector3 v2 = p[i * 3 + 2];
+
+ LLVector3 normal = (v1 - v0) % (v2 - v0);
+ normal.normalize();
+
+ n[i * 3] = normal;
+ n[i * 3 + 1] = normal;
+ n[i * 3 + 2] = normal;
+ }
+ }
+
+ void genTangents()
+ {
+ t.resize(p.size());
+ mikk::Mikktspace ctx(*this);
+ ctx.genTangSpace();
+ }
+
+ // write to target primitive as an indexed triangle list
+ // Only modifies runtime data, does not modify the original GLTF data
+ void write(Primitive* prim) const
+ {
+ //re-weld
+ meshopt_Stream mos[] =
+ {
+ { &p[0], sizeof(LLVector3), sizeof(LLVector3) },
+ { &n[0], sizeof(LLVector3), sizeof(LLVector3) },
+ { &t[0], sizeof(LLVector4), sizeof(LLVector4) },
+ { &tc[0], sizeof(LLVector2), sizeof(LLVector2) },
+ { &c[0], sizeof(LLColor4U), sizeof(LLColor4U) },
+ { w.empty() ? nullptr : &w[0], sizeof(LLVector4), sizeof(LLVector4) },
+ { j.empty() ? nullptr : &j[0], sizeof(U64), sizeof(U64) }
+ };
+
+ std::vector<U32> remap;
+ remap.resize(p.size());
+
+ U32 stream_count = w.empty() ? 5 : 7;
+
+ size_t vert_count = meshopt_generateVertexRemapMulti(&remap[0], nullptr, p.size(), p.size(), mos, stream_count);
+
+ prim->mTexCoords.resize(vert_count);
+ prim->mNormals.resize(vert_count);
+ prim->mTangents.resize(vert_count);
+ prim->mPositions.resize(vert_count);
+ prim->mColors.resize(vert_count);
+ if (!w.empty())
+ {
+ prim->mWeights.resize(vert_count);
+ prim->mJoints.resize(vert_count);
+ }
+
+ prim->mIndexArray.resize(remap.size());
+
+ for (int i = 0; i < remap.size(); ++i)
+ {
+ U32 src_idx = i;
+ U32 dst_idx = remap[i];
+
+ prim->mIndexArray[i] = dst_idx;
+
+ prim->mPositions[dst_idx].load3(p[src_idx].mV);
+ prim->mNormals[dst_idx].load3(n[src_idx].mV);
+ prim->mTexCoords[dst_idx] = tc[src_idx];
+ prim->mTangents[dst_idx].loadua(t[src_idx].mV);
+ prim->mColors[dst_idx] = c[src_idx];
+
+ if (!w.empty())
+ {
+ prim->mWeights[dst_idx].loadua(w[src_idx].mV);
+ prim->mJoints[dst_idx] = j[src_idx];
+ }
+ }
+
+ prim->mGLMode = LLRender::TRIANGLES;
+ }
+
+ uint32_t GetNumFaces()
+ {
+ return uint32_t(p.size()/3);
+ }
+
+ uint32_t GetNumVerticesOfFace(const uint32_t face_num)
+ {
+ return 3;
+ }
+
+ mikk::float3 GetPosition(const uint32_t face_num, const uint32_t vert_num)
+ {
+ F32* v = p[face_num * 3 + vert_num].mV;
+ return mikk::float3(v);
+ }
+
+ mikk::float3 GetTexCoord(const uint32_t face_num, const uint32_t vert_num)
+ {
+ F32* uv = tc[face_num * 3 + vert_num].mV;
+ return mikk::float3(uv[0], uv[1], 1.0f);
+ }
+
+ mikk::float3 GetNormal(const uint32_t face_num, const uint32_t vert_num)
+ {
+ F32* normal = n[face_num * 3 + vert_num].mV;
+ return mikk::float3(normal);
+ }
+
+ void SetTangentSpace(const uint32_t face_num, const uint32_t vert_num, mikk::float3 T, bool orientation)
+ {
+ S32 i = face_num * 3 + vert_num;
+ t[i].set(T.x, T.y, T.z, orientation ? 1.0f : -1.0f);
+ }
+};
+
+
bool Primitive::prep(Asset& asset)
{
// allocate vertex buffer
@@ -94,26 +289,12 @@ bool Primitive::prep(Asset& asset)
}
}
- U32 mask = ATTRIBUTE_MASK;
+ U32 mask = LLVertexBuffer::MAP_VERTEX;
if (!mWeights.empty())
{
mask |= LLVertexBuffer::MAP_WEIGHT4;
- }
-
- if (LLGLSLShader::sCurBoundShaderPtr == nullptr)
- { // make sure a shader is bound to satisfy mVertexBuffer->setBuffer
- gDebugProgram.bind();
- }
- mVertexBuffer = new LLVertexBuffer(mask);
- mVertexBuffer->allocateBuffer(mPositions.size(), mIndexArray.size()*2); // double the size of the index buffer for 32-bit indices
-
- mVertexBuffer->setBuffer();
- mVertexBuffer->setPositionData(mPositions.data());
-
- if (!mIndexArray.empty())
- {
- mVertexBuffer->setIndexData(mIndexArray.data());
+ mask |= LLVertexBuffer::MAP_JOINT;
}
if (mTexCoords.empty())
@@ -121,23 +302,17 @@ bool Primitive::prep(Asset& asset)
mTexCoords.resize(mPositions.size());
}
- // flip texcoord y, upload, then flip back (keep the off-spec data in vram only)
- for (auto& tc : mTexCoords)
- {
- tc[1] = 1.f - tc[1];
- }
- mVertexBuffer->setTexCoordData(mTexCoords.data());
-
- for (auto& tc : mTexCoords)
- {
- tc[1] = 1.f - tc[1];
- }
+ // TODO: support more than one texcoord set (or no texcoords)
+ mask |= LLVertexBuffer::MAP_TEXCOORD0;
if (mColors.empty())
{
mColors.resize(mPositions.size(), LLColor4U::white);
}
+ // TODO: support colorless vertex buffers
+ mask |= LLVertexBuffer::MAP_COLOR;
+
// bake material basecolor into color array
if (mMaterial != INVALID_INDEX)
{
@@ -149,44 +324,131 @@ bool Primitive::prep(Asset& asset)
}
}
- mVertexBuffer->setColorData(mColors.data());
+ mShaderVariant = 0;
if (mNormals.empty())
{
- mNormals.resize(mPositions.size(), LLVector4a(0, 0, 1, 0));
+ mTangents.clear();
+
+ if (mMode == Mode::POINTS || mMode == Mode::LINES || mMode == Mode::LINE_LOOP || mMode == Mode::LINE_STRIP)
+ { //no normals and no surfaces, this primitive is unlit
+ mTangents.clear();
+ mShaderVariant |= LLGLSLShader::GLTFVariant::UNLIT;
+ }
+ else
+ {
+ // unroll into non-indexed array of flat shaded triangles
+ MikktMesh data;
+ if (!data.copy(this))
+ {
+ return false;
+ }
+
+ data.genNormals();
+ data.genTangents();
+ data.write(this);
+ }
+ }
+
+ bool unlit = (mShaderVariant & LLGLSLShader::GLTFVariant::UNLIT) != 0;
+
+ if (mTangents.empty() && !unlit)
+ { // NOTE: must be done last because tangent generation rewrites the other arrays
+ // adapted from usage of Mikktspace in llvolume.cpp
+ if (mMode == Mode::POINTS || mMode == Mode::LINES || mMode == Mode::LINE_LOOP || mMode == Mode::LINE_STRIP)
+ {
+ // for points and lines, just make sure tangent is perpendicular to normal
+ mTangents.resize(mNormals.size());
+ LLVector4a up(0.f, 0.f, 1.f, 0.f);
+ LLVector4a left(1.f, 0.f, 0.f, 0.f);
+ for (U32 i = 0; i < mNormals.size(); ++i)
+ {
+ if (fabsf(mNormals[i].getF32ptr()[2]) < 0.999f)
+ {
+ mTangents[i] = up.cross3(mNormals[i]);
+ }
+ else
+ {
+ mTangents[i] = left.cross3(mNormals[i]);
+ }
+
+ mTangents[i].getF32ptr()[3] = 1.f;
+ }
+ }
+ else
+ {
+ MikktMesh data;
+ if (!data.copy(this))
+ {
+ return false;
+ }
+
+ data.genTangents();
+ data.write(this);
+ }
}
- mVertexBuffer->setNormalData(mNormals.data());
- if (mTangents.empty())
+ if (!unlit)
{
- // TODO: generate tangents if needed
- mTangents.resize(mPositions.size(), LLVector4a(1, 0, 0, 1));
+ mask |= LLVertexBuffer::MAP_NORMAL;
+ mask |= LLVertexBuffer::MAP_TANGENT;
+ }
+
+ if (LLGLSLShader::sCurBoundShaderPtr == nullptr)
+ { // make sure a shader is bound to satisfy mVertexBuffer->setBuffer
+ gDebugProgram.bind();
}
- mVertexBuffer->setTangentData(mTangents.data());
+ mVertexBuffer = new LLVertexBuffer(mask);
+ mVertexBuffer->allocateBuffer(mPositions.size(), mIndexArray.size() * 2); // double the size of the index buffer for 32-bit indices
+
+ mVertexBuffer->setBuffer();
+ mVertexBuffer->setPositionData(mPositions.data());
+ mVertexBuffer->setColorData(mColors.data());
+
+ if (!mNormals.empty())
+ {
+ mVertexBuffer->setNormalData(mNormals.data());
+ }
+ if (!mTangents.empty())
+ {
+ mVertexBuffer->setTangentData(mTangents.data());
+ }
if (!mWeights.empty())
{
- std::vector<LLVector4a> weight_data;
- weight_data.resize(mWeights.size());
+ mShaderVariant |= LLGLSLShader::GLTFVariant::RIGGED;
+ mVertexBuffer->setWeight4Data(mWeights.data());
+ mVertexBuffer->setJointData(mJoints.data());
+ }
- F32 max_weight = 1.f - FLT_EPSILON*100.f;
- LLVector4a maxw(max_weight, max_weight, max_weight, max_weight);
- for (U32 i = 0; i < mWeights.size(); ++i)
- {
- LLVector4a& w = weight_data[i];
- w.setMin(mWeights[i], maxw);
- w.add(mJoints[i]);
- };
+ // flip texcoord y, upload, then flip back (keep the off-spec data in vram only)
+ for (auto& tc : mTexCoords)
+ {
+ tc[1] = 1.f - tc[1];
+ }
+ mVertexBuffer->setTexCoordData(mTexCoords.data());
+ for (auto& tc : mTexCoords)
+ {
+ tc[1] = 1.f - tc[1];
+ }
- mVertexBuffer->setWeight4Data(weight_data.data());
+ if (!mIndexArray.empty())
+ {
+ mVertexBuffer->setIndexData(mIndexArray.data());
}
createOctree();
mVertexBuffer->unbind();
+ Material& material = asset.mMaterials[mMaterial];
+ if (material.mAlphaMode == Material::AlphaMode::BLEND)
+ {
+ mShaderVariant |= LLGLSLShader::GLTFVariant::ALPHA_BLEND;
+ }
+
return true;
}
diff --git a/indra/newview/gltf/primitive.h b/indra/newview/gltf/primitive.h
index 9914ff3b08..f9d7c63c65 100644
--- a/indra/newview/gltf/primitive.h
+++ b/indra/newview/gltf/primitive.h
@@ -38,13 +38,6 @@ namespace LL
using Value = boost::json::value;
class Asset;
- constexpr U32 ATTRIBUTE_MASK =
- LLVertexBuffer::MAP_VERTEX |
- LLVertexBuffer::MAP_NORMAL |
- LLVertexBuffer::MAP_TEXCOORD0 |
- LLVertexBuffer::MAP_TANGENT |
- LLVertexBuffer::MAP_COLOR;
-
class Primitive
{
public:
@@ -64,12 +57,12 @@ namespace LL
// GPU copy of mesh data
LLPointer<LLVertexBuffer> mVertexBuffer;
- // CPU copy of mesh data
+ // CPU copy of mesh data, keep these as LLVector types for compatibility with raycasting code
std::vector<LLVector2> mTexCoords;
std::vector<LLVector4a> mNormals;
std::vector<LLVector4a> mTangents;
std::vector<LLVector4a> mPositions;
- std::vector<LLVector4a> mJoints;
+ std::vector<U64> mJoints;
std::vector<LLVector4a> mWeights;
std::vector<LLColor4U> mColors;
std::vector<U32> mIndexArray;
@@ -82,6 +75,10 @@ namespace LL
Mode mMode = Mode::TRIANGLES; // default to triangles
LLRender::eGeomModes mGLMode = LLRender::TRIANGLES; // for use with LLRender
S32 mIndices = -1;
+
+ // shader variant according to LLGLSLShader::GLTFVariant flags
+ U8 mShaderVariant = 0;
+
std::unordered_map<std::string, S32> mAttributes;
// create octree based on vertex buffer
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index df922b8f3d..d7eb605489 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -528,7 +528,26 @@ void GLTFSceneManager::update()
}
}
-void GLTFSceneManager::render(bool opaque, bool rigged)
+void GLTFSceneManager::render(bool opaque, bool rigged, bool unlit)
+{
+ U8 variant = 0;
+ if (rigged)
+ {
+ variant |= LLGLSLShader::GLTFVariant::RIGGED;
+ }
+ if (!opaque)
+ {
+ variant |= LLGLSLShader::GLTFVariant::ALPHA_BLEND;
+ }
+ if (unlit)
+ {
+ variant |= LLGLSLShader::GLTFVariant::UNLIT;
+ }
+
+ render(variant);
+}
+
+void GLTFSceneManager::render(U8 variant)
{
// for debugging, just render the whole scene as opaque
// by traversing the whole scenegraph
@@ -537,6 +556,8 @@ void GLTFSceneManager::render(bool opaque, bool rigged)
gGL.matrixMode(LLRender::MM_MODELVIEW);
+ bool rigged = variant & LLGLSLShader::GLTFVariant::RIGGED;
+
for (U32 i = 0; i < mObjects.size(); ++i)
{
if (mObjects[i]->isDead() || mObjects[i]->mGLTFAsset == nullptr)
@@ -564,23 +585,16 @@ void GLTFSceneManager::render(bool opaque, bool rigged)
// (matrix palettes are in asset space)
gGL.loadMatrix(glm::value_ptr(mdv));
}
- render(*asset, opaque, rigged);
+ render(*asset, variant);
gGL.popMatrix();
}
}
-void GLTFSceneManager::render(Asset& asset, bool opaque, bool rigged)
+void GLTFSceneManager::render(Asset& asset, U8 variant)
{
- U32 variant = 0;
- if (rigged)
- {
- variant |= LLGLSLShader::GLTFVariant::RIGGED;
- }
- if (!opaque)
- {
- variant |= LLGLSLShader::GLTFVariant::ALPHA;
- }
+ bool opaque = !(variant & LLGLSLShader::GLTFVariant::ALPHA_BLEND);
+ bool rigged = variant & LLGLSLShader::GLTFVariant::RIGGED;
if (opaque)
{
@@ -600,16 +614,6 @@ void GLTFSceneManager::render(Asset& asset, bool opaque, bool rigged)
Skin& skin = asset.mSkins[node.mSkin];
glBindBufferBase(GL_UNIFORM_BUFFER, LLGLSLShader::UB_GLTF_JOINTS, skin.mUBO);
}
- else
- {
- //skip static nodes if we're rendering rigged
- continue;
- }
- }
- else if (rigged)
- {
- // skip rigged nodes if we're not rendering rigged
- continue;
}
if (node.mMesh != INVALID_INDEX)
@@ -617,6 +621,11 @@ void GLTFSceneManager::render(Asset& asset, bool opaque, bool rigged)
Mesh& mesh = asset.mMeshes[node.mMesh];
for (auto& primitive : mesh.mPrimitives)
{
+ if (primitive.mShaderVariant != variant)
+ {
+ continue;
+ }
+
if (!rigged)
{
gGL.loadMatrix((F32*)glm::value_ptr(node.mRenderMatrix));
@@ -625,23 +634,12 @@ void GLTFSceneManager::render(Asset& asset, bool opaque, bool rigged)
if (primitive.mMaterial != INVALID_INDEX)
{
Material& material = asset.mMaterials[primitive.mMaterial];
- bool mat_opaque = material.mAlphaMode != Material::AlphaMode::BLEND;
-
- if (mat_opaque != opaque)
- {
- continue;
- }
-
bind(asset, material);
cull = !material.mDoubleSided;
}
else
{
- if (!opaque)
- {
- continue;
- }
LLFetchedGLTFMaterial::sDefault.bind();
}
diff --git a/indra/newview/gltfscenemanager.h b/indra/newview/gltfscenemanager.h
index fcde6cf1f7..7da413e8b2 100644
--- a/indra/newview/gltfscenemanager.h
+++ b/indra/newview/gltfscenemanager.h
@@ -49,8 +49,13 @@ namespace LL
void uploadSelection(); // decompose selected asset and upload to simulator
void update();
- void render(bool opaque, bool rigged = false);
- void render(LL::GLTF::Asset& asset, bool opaque, bool rigged);
+ void render(bool opaque, bool rigged = false, bool unlit = false);
+
+ // render the given variant of all assets
+ // variant - bitmask according to LLGLSLShader::GLTFVariant flags
+ void render(U8 variant);
+
+ void render(LL::GLTF::Asset& asset, U8 variant);
// bind the given material for rendering
void bind(LL::GLTF::Asset& asset, LL::GLTF::Material& material);
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index 2a376a40b2..686e9aef24 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -93,7 +93,7 @@ S32 LLDrawPoolAlpha::getNumPostDeferredPasses()
}
// set some common parameters on the given shader to prepare for alpha rendering
-static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma, bool deferredEnvironment, F32 water_sign)
+static void prepare_alpha_shader(LLGLSLShader* shader, bool deferredEnvironment, F32 water_sign)
{
static LLCachedControl<F32> displayGamma(gSavedSettings, "RenderDeferredDisplayGamma");
F32 gamma = displayGamma;
@@ -132,15 +132,11 @@ static void prepare_alpha_shader(LLGLSLShader* shader, bool textureGamma, bool d
{
shader->setMinimumAlpha(MINIMUM_ALPHA);
}
- if (textureGamma)
- {
- shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
- }
//also prepare rigged variant
if (shader->mRiggedVariant && shader->mRiggedVariant != shader)
{
- prepare_alpha_shader(shader->mRiggedVariant, textureGamma, deferredEnvironment, water_sign);
+ prepare_alpha_shader(shader->mRiggedVariant, deferredEnvironment, water_sign);
}
}
@@ -171,36 +167,36 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
llassert(LLPipeline::sRenderDeferred);
emissive_shader = &gDeferredEmissiveProgram;
- prepare_alpha_shader(emissive_shader, true, false, water_sign);
+ prepare_alpha_shader(emissive_shader, false, water_sign);
pbr_emissive_shader = &gPBRGlowProgram;
- prepare_alpha_shader(pbr_emissive_shader, true, false, water_sign);
+ prepare_alpha_shader(pbr_emissive_shader, false, water_sign);
fullbright_shader =
(LLPipeline::sImpostorRender) ? &gDeferredFullbrightAlphaMaskProgram :
(LLPipeline::sRenderingHUDs) ? &gHUDFullbrightAlphaMaskAlphaProgram :
&gDeferredFullbrightAlphaMaskAlphaProgram;
- prepare_alpha_shader(fullbright_shader, true, true, water_sign);
+ prepare_alpha_shader(fullbright_shader, true, water_sign);
simple_shader =
(LLPipeline::sImpostorRender) ? &gDeferredAlphaImpostorProgram :
(LLPipeline::sRenderingHUDs) ? &gHUDAlphaProgram :
&gDeferredAlphaProgram;
- prepare_alpha_shader(simple_shader, false, true, water_sign); //prime simple shader (loads shadow relevant uniforms)
+ prepare_alpha_shader(simple_shader, true, water_sign); //prime simple shader (loads shadow relevant uniforms)
LLGLSLShader* materialShader = gDeferredMaterialProgram;
for (int i = 0; i < LLMaterial::SHADER_COUNT*2; ++i)
{
- prepare_alpha_shader(&materialShader[i], false, true, water_sign);
+ prepare_alpha_shader(&materialShader[i], true, water_sign);
}
pbr_shader =
(LLPipeline::sRenderingHUDs) ? &gHUDPBRAlphaProgram :
&gDeferredPBRAlphaProgram;
- prepare_alpha_shader(pbr_shader, false, true, water_sign);
+ prepare_alpha_shader(pbr_shader, true, water_sign);
// explicitly unbind here so render loop doesn't make assumptions about the last shader
// already being setup for rendering
@@ -265,6 +261,8 @@ void LLDrawPoolAlpha::forwardRender(bool rigged)
{ // draw GLTF scene to depth buffer before rigged alpha
LL::GLTFSceneManager::instance().render(false, false);
LL::GLTFSceneManager::instance().render(false, true);
+ LL::GLTFSceneManager::instance().render(false, false, true);
+ LL::GLTFSceneManager::instance().render(false, true, true);
}
// If the face is more than 90% transparent, then don't update the Depth buffer for Dof
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 2b0ae260dc..836a90adab 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -36,43 +36,12 @@
#include "llspatialpartition.h"
#include "llviewershadermgr.h"
#include "llrender.h"
+#include "gltfscenemanager.h"
static LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple");
static LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS_DEFERRED("Deferred Grass");
-static void setup_simple_shader(LLGLSLShader* shader)
-{
- shader->bind();
-}
-
-static void setup_glow_shader(LLGLSLShader* shader)
-{
- setup_simple_shader(shader);
- if (LLPipeline::sRenderDeferred && !LLPipeline::sRenderingHUDs)
- {
- shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
- }
- else
- {
- shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f);
- }
-}
-
-static void setup_fullbright_shader(LLGLSLShader* shader)
-{
- setup_glow_shader(shader);
-
- S32 channel = shader->enableTexture(LLShaderMgr::EXPOSURE_MAP);
- if (channel > -1)
- {
- gGL.getTexUnit(channel)->bind(&gPipeline.mExposureMap);
- }
-
- shader->uniform1f(LLViewerShaderMgr::FULLBRIGHT, 1.f);
-}
-
-
void LLDrawPoolGlow::renderPostDeferred(S32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
@@ -89,12 +58,12 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass)
gGL.setColorMask(false, true);
//first pass -- static objects
- setup_glow_shader(shader);
+ shader->bind();
pushBatches(LLRenderPass::PASS_GLOW, true, true);
// second pass -- rigged objects
shader = shader->mRiggedVariant;
- setup_glow_shader(shader);
+ shader->bind();
pushRiggedBatches(LLRenderPass::PASS_GLOW_RIGGED, true, true);
gGL.setColorMask(true, false);
@@ -133,11 +102,11 @@ void LLDrawPoolSimple::renderDeferred(S32 pass)
LLGLDisable blend(GL_BLEND);
//render static
- setup_simple_shader(&gDeferredDiffuseProgram);
+ gDeferredDiffuseProgram.bind();
pushBatches(LLRenderPass::PASS_SIMPLE, true, true);
//render rigged
- setup_simple_shader(gDeferredDiffuseProgram.mRiggedVariant);
+ gDeferredDiffuseProgram.bind(true);
pushRiggedBatches(LLRenderPass::PASS_SIMPLE_RIGGED, true, true);
}
@@ -150,11 +119,11 @@ void LLDrawPoolAlphaMask::renderDeferred(S32 pass)
LLGLSLShader* shader = &gDeferredDiffuseAlphaMaskProgram;
//render static
- setup_simple_shader(shader);
+ shader->bind();
pushMaskBatches(LLRenderPass::PASS_ALPHA_MASK, true, true);
//render rigged
- setup_simple_shader(shader->mRiggedVariant);
+ shader->bind(true);
pushRiggedMaskBatches(LLRenderPass::PASS_ALPHA_MASK_RIGGED, true, true);
}
@@ -201,13 +170,13 @@ void LLDrawPoolFullbright::renderPostDeferred(S32 pass)
gGL.setSceneBlendType(LLRender::BT_ALPHA);
// render static
- setup_fullbright_shader(shader);
+ shader->bind();
pushBatches(LLRenderPass::PASS_FULLBRIGHT, true, true);
if (!LLPipeline::sRenderingHUDs)
{
// render rigged
- setup_fullbright_shader(shader->mRiggedVariant);
+ shader->bind(true);
pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_RIGGED, true, true);
}
}
@@ -216,6 +185,10 @@ void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
+ // render unrigged unlit GLTF
+ LL::GLTFSceneManager::instance().render(true, false, true);
+ LL::GLTFSceneManager::instance().render(true, true, true);
+
LLGLSLShader* shader = nullptr;
if (LLPipeline::sRenderingHUDs)
{
@@ -229,13 +202,13 @@ void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass)
LLGLDisable blend(GL_BLEND);
// render static
- setup_fullbright_shader(shader);
+ shader->bind();
pushMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, true, true);
if (!LLPipeline::sRenderingHUDs)
{
// render rigged
- setup_fullbright_shader(shader->mRiggedVariant);
+ shader->bind(true);
pushRiggedMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK_RIGGED, true, true);
}
}
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 505d7b1dea..c878c8cf63 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -1009,7 +1009,7 @@ F32 gpu_benchmark()
gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER));
gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER));
gBenchmarkProgram.mShaderLevel = 1;
- if (!gBenchmarkProgram.createShader(NULL, NULL))
+ if (!gBenchmarkProgram.createShader())
{
return -1.f;
}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e53e90b703..d43d6fea37 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -245,11 +245,11 @@ static bool make_rigged_variant(LLGLSLShader& shader, LLGLSLShader& riggedShader
riggedShader.mShaderGroup = shader.mShaderGroup;
shader.mRiggedVariant = &riggedShader;
- return riggedShader.createShader(NULL, NULL);
+ return riggedShader.createShader();
}
-static bool make_gltf_variant(LLGLSLShader& shader, LLGLSLShader& variant, bool alpha_blend, bool rigged, bool use_sun_shadow)
+static bool make_gltf_variant(LLGLSLShader& shader, LLGLSLShader& variant, bool alpha_blend, bool rigged, bool unlit, bool use_sun_shadow)
{
variant.mName = shader.mName.c_str();
variant.mFeatures = shader.mFeatures;
@@ -266,6 +266,11 @@ static bool make_gltf_variant(LLGLSLShader& shader, LLGLSLShader& variant, bool
variant.addPermutation("HAS_SKIN", "1");
}
+ if (unlit)
+ {
+ variant.addPermutation("UNLIT", "1");
+ }
+
if (alpha_blend)
{
variant.addPermutation("ALPHA_BLEND", "1");
@@ -286,7 +291,7 @@ static bool make_gltf_variant(LLGLSLShader& shader, LLGLSLShader& variant, bool
variant.addPermutation("HAS_SUN_SHADOW", "1");
}
- bool success = variant.createShader(NULL, NULL);
+ bool success = variant.createShader();
llassert(success);
// Alpha Shader Hack
@@ -298,7 +303,7 @@ static bool make_gltf_variant(LLGLSLShader& shader, LLGLSLShader& variant, bool
}
else
{
- return variant.createShader(NULL, NULL);
+ return variant.createShader();
}
}
@@ -309,10 +314,11 @@ static bool make_gltf_variants(LLGLSLShader& shader, bool use_sun_shadow)
for (U32 i = 0; i < LLGLSLShader::NUM_GLTF_VARIANTS; ++i)
{
- bool alpha_blend = i & 1;
- bool rigged = i & 2;
+ bool alpha_blend = i & LLGLSLShader::GLTFVariant::ALPHA_BLEND;
+ bool rigged = i & LLGLSLShader::GLTFVariant::RIGGED;
+ bool unlit = i & LLGLSLShader::GLTFVariant::UNLIT;
- if (!make_gltf_variant(shader, shader.mGLTFVariants[i], alpha_blend, rigged, use_sun_shadow))
+ if (!make_gltf_variant(shader, shader.mGLTFVariants[i], alpha_blend, rigged, unlit, use_sun_shadow))
{
return false;
}
@@ -870,7 +876,7 @@ bool LLViewerShaderMgr::loadShadersWater()
gWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
gWaterProgram.mShaderLevel = mShaderLevel[SHADER_WATER];
- success = gWaterProgram.createShader(NULL, NULL);
+ success = gWaterProgram.createShader();
llassert(success);
}
@@ -900,7 +906,7 @@ bool LLViewerShaderMgr::loadShadersWater()
}
gWaterEdgeProgram.mShaderGroup = LLGLSLShader::SG_WATER;
gWaterEdgeProgram.mShaderLevel = mShaderLevel[SHADER_WATER];
- success = gWaterEdgeProgram.createShader(NULL, NULL);
+ success = gWaterEdgeProgram.createShader();
llassert(success);
}
@@ -920,7 +926,7 @@ bool LLViewerShaderMgr::loadShadersWater()
{
gUnderWaterProgram.addPermutation("TRANSPARENT_WATER", "1");
}
- success = gUnderWaterProgram.createShader(NULL, NULL);
+ success = gUnderWaterProgram.createShader();
llassert(success);
}
@@ -969,7 +975,7 @@ bool LLViewerShaderMgr::loadShadersEffects()
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER));
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER));
gGlowProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT];
- success = gGlowProgram.createShader(NULL, NULL);
+ success = gGlowProgram.createShader();
if (!success)
{
LLPipeline::sRenderGlow = false;
@@ -992,7 +998,7 @@ bool LLViewerShaderMgr::loadShadersEffects()
gGlowExtractProgram.addPermutation("HAS_NOISE", "1");
}
- success = gGlowExtractProgram.createShader(NULL, NULL);
+ success = gGlowExtractProgram.createShader();
if (!success)
{
LLPipeline::sRenderGlow = false;
@@ -1115,7 +1121,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER));
gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER));
gDeferredHighlightProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gDeferredHighlightProgram.createShader(NULL, NULL);
+ success = gDeferredHighlightProgram.createShader();
}
if (success)
@@ -1128,7 +1134,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
gDeferredDiffuseProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredDiffuseProgram, gDeferredSkinnedDiffuseProgram);
- success = success && gDeferredDiffuseProgram.createShader(NULL, NULL);
+ success = success && gDeferredDiffuseProgram.createShader();
}
if (success)
@@ -1140,7 +1146,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredDiffuseAlphaMaskProgram, gDeferredSkinnedDiffuseAlphaMaskProgram);
- success = success && gDeferredDiffuseAlphaMaskProgram.createShader(NULL, NULL);
+ success = success && gDeferredDiffuseAlphaMaskProgram.createShader();
}
if (success)
@@ -1150,7 +1156,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER));
gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskF.glsl", GL_FRAGMENT_SHADER));
gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL);
+ success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader();
llassert(success);
}
@@ -1161,7 +1167,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER));
gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER));
gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(NULL, NULL);
+ success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader();
llassert(success);
}
@@ -1173,7 +1179,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER));
gDeferredBumpProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredBumpProgram, gDeferredSkinnedBumpProgram);
- success = success && gDeferredBumpProgram.createShader(NULL, NULL);
+ success = success && gDeferredBumpProgram.createShader();
llassert(success);
}
@@ -1255,7 +1261,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredMaterialProgram[i].mRiggedVariant = &gDeferredMaterialProgram[i + 0x10];
}
- success = gDeferredMaterialProgram[i].createShader(NULL, NULL);
+ success = gDeferredMaterialProgram[i].createShader();
llassert(success);
}
}
@@ -1283,7 +1289,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
success = make_rigged_variant(gDeferredPBROpaqueProgram, gDeferredSkinnedPBROpaqueProgram);
if (success)
{
- success = gDeferredPBROpaqueProgram.createShader(NULL, NULL);
+ success = gDeferredPBROpaqueProgram.createShader();
}
llassert(success);
}
@@ -1316,7 +1322,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
success = make_rigged_variant(gPBRGlowProgram, gPBRGlowSkinnedProgram);
if (success)
{
- success = gPBRGlowProgram.createShader(NULL, NULL);
+ success = gPBRGlowProgram.createShader();
}
llassert(success);
}
@@ -1332,7 +1338,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHUDPBROpaqueProgram.clearPermutations();
gHUDPBROpaqueProgram.addPermutation("IS_HUD", "1");
- success = gHUDPBROpaqueProgram.createShader(NULL, NULL);
+ success = gHUDPBROpaqueProgram.createShader();
llassert(success);
}
@@ -1377,7 +1383,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
success = make_rigged_variant(*shader, gDeferredSkinnedPBRAlphaProgram);
if (success)
{
- success = shader->createShader(NULL, NULL);
+ success = shader->createShader();
}
llassert(success);
@@ -1406,7 +1412,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
shader->addPermutation("IS_HUD", "1");
shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = shader->createShader(NULL, NULL);
+ success = shader->createShader();
llassert(success);
}
@@ -1433,7 +1439,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredPBRTerrainProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredPBRTerrainProgram.addPermutation("TERRAIN_PBR_DETAIL", llformat("%d", detail));
gDeferredPBRTerrainProgram.addPermutation("TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT", llformat("%d", mapping));
- success = gDeferredPBRTerrainProgram.createShader(NULL, NULL);
+ success = gDeferredPBRTerrainProgram.createShader();
llassert(success);
}
@@ -1444,7 +1450,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeV.glsl", GL_VERTEX_SHADER));
gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeF.glsl", GL_FRAGMENT_SHADER));
gDeferredTreeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredTreeProgram.createShader(NULL, NULL);
+ success = gDeferredTreeProgram.createShader();
}
if (success)
@@ -1455,7 +1461,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredTreeShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredTreeShadowProgram.mRiggedVariant = &gDeferredSkinnedTreeShadowProgram;
- success = gDeferredTreeShadowProgram.createShader(NULL, NULL);
+ success = gDeferredTreeShadowProgram.createShader();
llassert(success);
}
@@ -1467,7 +1473,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowSkinnedV.glsl", GL_VERTEX_SHADER));
gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredSkinnedTreeShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredSkinnedTreeShadowProgram.createShader(NULL, NULL);
+ success = gDeferredSkinnedTreeShadowProgram.createShader();
llassert(success);
}
@@ -1479,7 +1485,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER));
gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorF.glsl", GL_FRAGMENT_SHADER));
gDeferredImpostorProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredImpostorProgram.createShader(NULL, NULL);
+ success = gDeferredImpostorProgram.createShader();
llassert(success);
}
@@ -1497,7 +1503,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredLightProgram.clearPermutations();
- success = gDeferredLightProgram.createShader(NULL, NULL);
+ success = gDeferredLightProgram.createShader();
llassert(success);
}
@@ -1517,7 +1523,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredMultiLightProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredMultiLightProgram[i].addPermutation("LIGHT_COUNT", llformat("%d", i+1));
- success = gDeferredMultiLightProgram[i].createShader(NULL, NULL);
+ success = gDeferredMultiLightProgram[i].createShader();
llassert(success);
}
}
@@ -1535,7 +1541,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER));
gDeferredSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredSpotLightProgram.createShader(NULL, NULL);
+ success = gDeferredSpotLightProgram.createShader();
llassert(success);
}
@@ -1553,7 +1559,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER));
gDeferredMultiSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL);
+ success = gDeferredMultiSpotLightProgram.createShader();
llassert(success);
}
@@ -1587,7 +1593,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER));
gDeferredSunProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredSunProgram.createShader(NULL, NULL);
+ success = gDeferredSunProgram.createShader();
llassert(success);
}
@@ -1601,7 +1607,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER));
gDeferredBlurLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredBlurLightProgram.createShader(NULL, NULL);
+ success = gDeferredBlurLightProgram.createShader();
llassert(success);
}
@@ -1668,7 +1674,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = shader->createShader(NULL, NULL);
+ success = shader->createShader();
llassert(success);
// Hack
@@ -1727,7 +1733,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
{
shader->mRiggedVariant = shaders[1];
}
- success = shader->createShader(NULL, NULL);
+ success = shader->createShader();
llassert(success);
// End Hack
@@ -1750,7 +1756,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER));
gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER));
gDeferredAvatarEyesProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarEyesProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarEyesProgram.createShader();
llassert(success);
}
@@ -1767,7 +1773,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER));
gDeferredFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredFullbrightProgram, gDeferredSkinnedFullbrightProgram);
- success = gDeferredFullbrightProgram.createShader(NULL, NULL);
+ success = gDeferredFullbrightProgram.createShader();
llassert(success);
}
@@ -1785,7 +1791,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHUDFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gHUDFullbrightProgram.clearPermutations();
gHUDFullbrightProgram.addPermutation("IS_HUD", "1");
- success = gHUDFullbrightProgram.createShader(NULL, NULL);
+ success = gHUDFullbrightProgram.createShader();
llassert(success);
}
@@ -1804,7 +1810,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK","1");
gDeferredFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredFullbrightAlphaMaskProgram, gDeferredSkinnedFullbrightAlphaMaskProgram);
- success = success && gDeferredFullbrightAlphaMaskProgram.createShader(NULL, NULL);
+ success = success && gDeferredFullbrightAlphaMaskProgram.createShader();
llassert(success);
}
@@ -1823,7 +1829,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHUDFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK", "1");
gHUDFullbrightAlphaMaskProgram.addPermutation("IS_HUD", "1");
gHUDFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gHUDFullbrightAlphaMaskProgram.createShader(NULL, NULL);
+ success = gHUDFullbrightAlphaMaskProgram.createShader();
llassert(success);
}
@@ -1844,7 +1850,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredFullbrightAlphaMaskAlphaProgram.addPermutation("IS_ALPHA", "1");
gDeferredFullbrightAlphaMaskAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredFullbrightAlphaMaskAlphaProgram, gDeferredSkinnedFullbrightAlphaMaskAlphaProgram);
- success = success && gDeferredFullbrightAlphaMaskAlphaProgram.createShader(NULL, NULL);
+ success = success && gDeferredFullbrightAlphaMaskAlphaProgram.createShader();
llassert(success);
}
@@ -1865,7 +1871,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHUDFullbrightAlphaMaskAlphaProgram.addPermutation("IS_ALPHA", "1");
gHUDFullbrightAlphaMaskAlphaProgram.addPermutation("IS_HUD", "1");
gHUDFullbrightAlphaMaskAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = success && gHUDFullbrightAlphaMaskAlphaProgram.createShader(NULL, NULL);
+ success = success && gHUDFullbrightAlphaMaskAlphaProgram.createShader();
llassert(success);
}
@@ -1883,7 +1889,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredFullbrightShinyProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredFullbrightShinyProgram.mFeatures.hasReflectionProbes = true;
success = make_rigged_variant(gDeferredFullbrightShinyProgram, gDeferredSkinnedFullbrightShinyProgram);
- success = success && gDeferredFullbrightShinyProgram.createShader(NULL, NULL);
+ success = success && gDeferredFullbrightShinyProgram.createShader();
llassert(success);
}
@@ -1902,7 +1908,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHUDFullbrightShinyProgram.mFeatures.hasReflectionProbes = true;
gHUDFullbrightShinyProgram.clearPermutations();
gHUDFullbrightShinyProgram.addPermutation("IS_HUD", "1");
- success = gHUDFullbrightShinyProgram.createShader(NULL, NULL);
+ success = gHUDFullbrightShinyProgram.createShader();
llassert(success);
}
@@ -1918,7 +1924,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER));
gDeferredEmissiveProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredEmissiveProgram, gDeferredSkinnedEmissiveProgram);
- success = success && gDeferredEmissiveProgram.createShader(NULL, NULL);
+ success = success && gDeferredEmissiveProgram.createShader();
llassert(success);
}
@@ -1951,7 +1957,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredSoftenProgram.addPermutation("HAS_SSAO", "1");
}
- success = gDeferredSoftenProgram.createShader(NULL, NULL);
+ success = gDeferredSoftenProgram.createShader();
llassert(success);
}
@@ -1973,7 +1979,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHazeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gHazeProgram.createShader(NULL, NULL);
+ success = gHazeProgram.createShader();
llassert(success);
}
@@ -1997,7 +2003,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gHazeWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gHazeWaterProgram.createShader(NULL, NULL);
+ success = gHazeWaterProgram.createShader();
llassert(success);
}
@@ -2010,7 +2016,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredShadowProgram.mRiggedVariant = &gDeferredSkinnedShadowProgram;
- success = gDeferredShadowProgram.createShader(NULL, NULL);
+ success = gDeferredShadowProgram.createShader();
llassert(success);
}
@@ -2025,7 +2031,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredSkinnedShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredSkinnedShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
// gDeferredSkinnedShadowProgram.addPermutation("DEPTH_CLAMP", "1"); // disable depth clamp for now
- success = gDeferredSkinnedShadowProgram.createShader(NULL, NULL);
+ success = gDeferredSkinnedShadowProgram.createShader();
llassert(success);
}
@@ -2039,7 +2045,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER));
// gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", "1");
gDeferredShadowCubeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredShadowCubeProgram.createShader(NULL, NULL);
+ success = gDeferredShadowCubeProgram.createShader();
llassert(success);
}
@@ -2057,7 +2063,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowFullbrightAlphaMaskProgram.addPermutation("IS_FULLBRIGHT", "1");
gDeferredShadowFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredShadowFullbrightAlphaMaskProgram, gDeferredSkinnedShadowFullbrightAlphaMaskProgram);
- success = success && gDeferredShadowFullbrightAlphaMaskProgram.createShader(NULL, NULL);
+ success = success && gDeferredShadowFullbrightAlphaMaskProgram.createShader();
llassert(success);
}
@@ -2071,7 +2077,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER));
gDeferredShadowAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = make_rigged_variant(gDeferredShadowAlphaMaskProgram, gDeferredSkinnedShadowAlphaMaskProgram);
- success = success && gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL);
+ success = success && gDeferredShadowAlphaMaskProgram.createShader();
llassert(success);
}
@@ -2085,7 +2091,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowGLTFAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredShadowGLTFAlphaMaskProgram.clearPermutations();
success = make_rigged_variant(gDeferredShadowGLTFAlphaMaskProgram, gDeferredSkinnedShadowGLTFAlphaMaskProgram);
- success = success && gDeferredShadowGLTFAlphaMaskProgram.createShader(NULL, NULL);
+ success = success && gDeferredShadowGLTFAlphaMaskProgram.createShader();
llassert(success);
}
@@ -2098,7 +2104,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredShadowGLTFAlphaBlendProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredShadowGLTFAlphaBlendProgram.clearPermutations();
success = make_rigged_variant(gDeferredShadowGLTFAlphaBlendProgram, gDeferredSkinnedShadowGLTFAlphaBlendProgram);
- success = success && gDeferredShadowGLTFAlphaBlendProgram.createShader(NULL, NULL);
+ success = success && gDeferredShadowGLTFAlphaBlendProgram.createShader();
llassert(success);
}
@@ -2111,7 +2117,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER));
gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredAvatarShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarShadowProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarShadowProgram.createShader();
llassert(success);
}
@@ -2123,7 +2129,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER));
gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredAvatarAlphaShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarAlphaShadowProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarAlphaShadowProgram.createShader();
llassert(success);
}
if (success)
@@ -2134,7 +2140,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER));
gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER));
gDeferredAvatarAlphaMaskShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarAlphaMaskShadowProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarAlphaMaskShadowProgram.createShader();
llassert(success);
}
@@ -2152,7 +2158,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER));
gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER));
gDeferredTerrainProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredTerrainProgram.createShader(NULL, NULL);
+ success = gDeferredTerrainProgram.createShader();
llassert(success);
}
@@ -2164,7 +2170,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER));
gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER));
gDeferredAvatarProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarProgram.createShader();
llassert(success);
}
@@ -2198,7 +2204,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredAvatarAlphaProgram.createShader(NULL, NULL);
+ success = gDeferredAvatarAlphaProgram.createShader();
llassert(success);
gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true;
@@ -2216,7 +2222,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gExposureProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gExposureProgram.mShaderFiles.push_back(make_pair("deferred/exposureF.glsl", GL_FRAGMENT_SHADER));
gExposureProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gExposureProgram.createShader(NULL, NULL);
+ success = gExposureProgram.createShader();
llassert(success);
}
@@ -2230,7 +2236,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gExposureProgramNoFade.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gExposureProgramNoFade.mShaderFiles.push_back(make_pair("deferred/exposureF.glsl", GL_FRAGMENT_SHADER));
gExposureProgramNoFade.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gExposureProgramNoFade.createShader(NULL, NULL);
+ success = gExposureProgramNoFade.createShader();
llassert(success);
}
@@ -2242,7 +2248,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gLuminanceProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gLuminanceProgram.mShaderFiles.push_back(make_pair("deferred/luminanceF.glsl", GL_FRAGMENT_SHADER));
gLuminanceProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gLuminanceProgram.createShader(NULL, NULL);
+ success = gLuminanceProgram.createShader();
llassert(success);
}
@@ -2256,7 +2262,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER));
gDeferredPostGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL);
+ success = gDeferredPostGammaCorrectProgram.createShader();
llassert(success);
}
@@ -2271,7 +2277,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gNoPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gNoPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER));
gNoPostGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gNoPostGammaCorrectProgram.createShader(NULL, NULL);
+ success = gNoPostGammaCorrectProgram.createShader();
llassert(success);
}
@@ -2286,7 +2292,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gLegacyPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gLegacyPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER));
gLegacyPostGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gLegacyPostGammaCorrectProgram.createShader(NULL, NULL);
+ success = gLegacyPostGammaCorrectProgram.createShader();
llassert(success);
}
@@ -2299,7 +2305,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER));
gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER));
gFXAAProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gFXAAProgram.createShader(NULL, NULL);
+ success = gFXAAProgram.createShader();
llassert(success);
}
@@ -2311,7 +2317,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER));
gDeferredPostProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredPostProgram.createShader(NULL, NULL);
+ success = gDeferredPostProgram.createShader();
llassert(success);
}
@@ -2323,7 +2329,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER));
gDeferredCoFProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredCoFProgram.createShader(NULL, NULL);
+ success = gDeferredCoFProgram.createShader();
llassert(success);
}
@@ -2335,7 +2341,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER));
gDeferredDoFCombineProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredDoFCombineProgram.createShader(NULL, NULL);
+ success = gDeferredDoFCombineProgram.createShader();
llassert(success);
}
@@ -2347,7 +2353,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER));
gDeferredPostNoDoFProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredPostNoDoFProgram.createShader(NULL, NULL);
+ success = gDeferredPostNoDoFProgram.createShader();
llassert(success);
}
@@ -2367,7 +2373,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gEnvironmentMapProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gEnvironmentMapProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- success = gEnvironmentMapProgram.createShader(NULL, NULL);
+ success = gEnvironmentMapProgram.createShader();
llassert(success);
}
@@ -2385,7 +2391,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLSkyProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- success = gDeferredWLSkyProgram.createShader(NULL, NULL);
+ success = gDeferredWLSkyProgram.createShader();
llassert(success);
}
@@ -2403,7 +2409,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLCloudProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY;
gDeferredWLCloudProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
- success = gDeferredWLCloudProgram.createShader(NULL, NULL);
+ success = gDeferredWLCloudProgram.createShader();
llassert(success);
}
@@ -2421,7 +2427,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscF.glsl", GL_FRAGMENT_SHADER));
gDeferredWLSunProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- success = gDeferredWLSunProgram.createShader(NULL, NULL);
+ success = gDeferredWLSunProgram.createShader();
llassert(success);
}
@@ -2441,7 +2447,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLMoonProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY;
gDeferredWLMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
- success = gDeferredWLMoonProgram.createShader(NULL, NULL);
+ success = gDeferredWLMoonProgram.createShader();
llassert(success);
}
@@ -2454,7 +2460,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredStarProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredStarProgram.mShaderGroup = LLGLSLShader::SG_SKY;
gDeferredStarProgram.addConstant( LLGLSLShader::SHADER_CONST_STAR_DEPTH ); // SL-14113
- success = gDeferredStarProgram.createShader(NULL, NULL);
+ success = gDeferredStarProgram.createShader();
llassert(success);
}
@@ -2466,7 +2472,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER));
gNormalMapGenProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gNormalMapGenProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- success = gNormalMapGenProgram.createShader(NULL, NULL);
+ success = gNormalMapGenProgram.createShader();
}
if (success)
@@ -2476,7 +2482,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredGenBrdfLutProgram.mShaderFiles.push_back(make_pair("deferred/genbrdflutV.glsl", GL_VERTEX_SHADER));
gDeferredGenBrdfLutProgram.mShaderFiles.push_back(make_pair("deferred/genbrdflutF.glsl", GL_FRAGMENT_SHADER));
gDeferredGenBrdfLutProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredGenBrdfLutProgram.createShader(NULL, NULL);
+ success = gDeferredGenBrdfLutProgram.createShader();
}
if (success) {
@@ -2487,7 +2493,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gPostScreenSpaceReflectionProgram.mFeatures.hasScreenSpaceReflections = true;
gPostScreenSpaceReflectionProgram.mFeatures.isDeferred = true;
gPostScreenSpaceReflectionProgram.mShaderLevel = 3;
- success = gPostScreenSpaceReflectionProgram.createShader(NULL, NULL);
+ success = gPostScreenSpaceReflectionProgram.createShader();
}
if (success) {
@@ -2496,7 +2502,7 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gDeferredBufferVisualProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gDeferredBufferVisualProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredVisualizeBuffers.glsl", GL_FRAGMENT_SHADER));
gDeferredBufferVisualProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- success = gDeferredBufferVisualProgram.createShader(NULL, NULL);
+ success = gDeferredBufferVisualProgram.createShader();
}
return success;
@@ -2515,7 +2521,7 @@ bool LLViewerShaderMgr::loadShadersObject()
gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER));
gObjectBumpProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
success = make_rigged_variant(gObjectBumpProgram, gSkinnedObjectBumpProgram);
- success = success && gObjectBumpProgram.createShader(NULL, NULL);
+ success = success && gObjectBumpProgram.createShader();
if (success)
{ //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1
LLGLSLShader* shader[] = { &gObjectBumpProgram, &gSkinnedObjectBumpProgram };
@@ -2543,7 +2549,7 @@ bool LLViewerShaderMgr::loadShadersObject()
gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER));
gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER));
gObjectAlphaMaskNoColorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
- success = gObjectAlphaMaskNoColorProgram.createShader(NULL, NULL);
+ success = gObjectAlphaMaskNoColorProgram.createShader();
}
if (success)
@@ -2555,7 +2561,7 @@ bool LLViewerShaderMgr::loadShadersObject()
gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER));
gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorF.glsl", GL_FRAGMENT_SHADER));
gImpostorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
- success = gImpostorProgram.createShader(NULL, NULL);
+ success = gImpostorProgram.createShader();
}
if (success)
@@ -2567,7 +2573,7 @@ bool LLViewerShaderMgr::loadShadersObject()
gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER));
gObjectPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
success = make_rigged_variant(gObjectPreviewProgram, gSkinnedObjectPreviewProgram);
- success = gObjectPreviewProgram.createShader(NULL, NULL);
+ success = gObjectPreviewProgram.createShader();
gObjectPreviewProgram.mFeatures.hasLighting = true;
gSkinnedObjectPreviewProgram.mFeatures.hasLighting = true;
}
@@ -2586,7 +2592,7 @@ bool LLViewerShaderMgr::loadShadersObject()
gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsV.glsl", GL_VERTEX_SHADER));
gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsF.glsl", GL_FRAGMENT_SHADER));
gPhysicsPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
- success = gPhysicsPreviewProgram.createShader(NULL, NULL);
+ success = gPhysicsPreviewProgram.createShader();
gPhysicsPreviewProgram.mFeatures.hasLighting = false;
}
@@ -2627,7 +2633,7 @@ bool LLViewerShaderMgr::loadShadersAvatar()
gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER));
gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER));
gAvatarProgram.mShaderLevel = mShaderLevel[SHADER_AVATAR];
- success = gAvatarProgram.createShader(NULL, NULL);
+ success = gAvatarProgram.createShader();
/// Keep track of avatar levels
if (gAvatarProgram.mShaderLevel != mShaderLevel[SHADER_AVATAR])
@@ -2651,7 +2657,7 @@ bool LLViewerShaderMgr::loadShadersAvatar()
gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER));
gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER));
gAvatarEyeballProgram.mShaderLevel = mShaderLevel[SHADER_AVATAR];
- success = gAvatarEyeballProgram.createShader(NULL, NULL);
+ success = gAvatarEyeballProgram.createShader();
}
if( !success )
@@ -2677,7 +2683,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER));
gHighlightProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
success = make_rigged_variant(gHighlightProgram, gSkinnedHighlightProgram);
- success = success && gHighlightProgram.createShader(NULL, NULL);
+ success = success && gHighlightProgram.createShader();
}
if (success)
@@ -2687,7 +2693,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER));
gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER));
gHighlightNormalProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gHighlightNormalProgram.createShader(NULL, NULL);
+ success = gHighlightNormalProgram.createShader();
}
if (success)
@@ -2697,7 +2703,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER));
gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER));
gHighlightSpecularProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gHighlightSpecularProgram.createShader(NULL, NULL);
+ success = gHighlightSpecularProgram.createShader();
}
if (success)
@@ -2707,7 +2713,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gUIProgram.mShaderFiles.push_back(make_pair("interface/uiV.glsl", GL_VERTEX_SHADER));
gUIProgram.mShaderFiles.push_back(make_pair("interface/uiF.glsl", GL_FRAGMENT_SHADER));
gUIProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gUIProgram.createShader(NULL, NULL);
+ success = gUIProgram.createShader();
}
if (success)
@@ -2717,7 +2723,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingV.glsl", GL_VERTEX_SHADER));
gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER));
gPathfindingProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gPathfindingProgram.createShader(NULL, NULL);
+ success = gPathfindingProgram.createShader();
}
if (success)
@@ -2727,7 +2733,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingNoNormalV.glsl", GL_VERTEX_SHADER));
gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER));
gPathfindingNoNormalsProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gPathfindingNoNormalsProgram.createShader(NULL, NULL);
+ success = gPathfindingNoNormalsProgram.createShader();
}
if (success)
@@ -2737,7 +2743,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER));
gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineF.glsl", GL_FRAGMENT_SHADER));
gGlowCombineProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gGlowCombineProgram.createShader(NULL, NULL);
+ success = gGlowCombineProgram.createShader();
if (success)
{
gGlowCombineProgram.bind();
@@ -2754,7 +2760,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER));
gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER));
gGlowCombineFXAAProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gGlowCombineFXAAProgram.createShader(NULL, NULL);
+ success = gGlowCombineFXAAProgram.createShader();
if (success)
{
gGlowCombineFXAAProgram.bind();
@@ -2772,7 +2778,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareV.glsl", GL_VERTEX_SHADER));
gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareF.glsl", GL_FRAGMENT_SHADER));
gTwoTextureCompareProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gTwoTextureCompareProgram.createShader(NULL, NULL);
+ success = gTwoTextureCompareProgram.createShader();
if (success)
{
gTwoTextureCompareProgram.bind();
@@ -2789,7 +2795,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterV.glsl", GL_VERTEX_SHADER));
gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterF.glsl", GL_FRAGMENT_SHADER));
gOneTextureFilterProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gOneTextureFilterProgram.createShader(NULL, NULL);
+ success = gOneTextureFilterProgram.createShader();
if (success)
{
gOneTextureFilterProgram.bind();
@@ -2805,7 +2811,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER));
gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER));
gSolidColorProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gSolidColorProgram.createShader(NULL, NULL);
+ success = gSolidColorProgram.createShader();
if (success)
{
gSolidColorProgram.bind();
@@ -2822,7 +2828,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER));
gOcclusionProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
gOcclusionProgram.mRiggedVariant = &gSkinnedOcclusionProgram;
- success = gOcclusionProgram.createShader(NULL, NULL);
+ success = gOcclusionProgram.createShader();
}
if (success)
@@ -2833,7 +2839,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionSkinnedV.glsl", GL_VERTEX_SHADER));
gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER));
gSkinnedOcclusionProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gSkinnedOcclusionProgram.createShader(NULL, NULL);
+ success = gSkinnedOcclusionProgram.createShader();
}
if (success)
@@ -2843,7 +2849,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionCubeV.glsl", GL_VERTEX_SHADER));
gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER));
gOcclusionCubeProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gOcclusionCubeProgram.createShader(NULL, NULL);
+ success = gOcclusionCubeProgram.createShader();
}
if (success)
@@ -2855,7 +2861,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gDebugProgram.mRiggedVariant = &gSkinnedDebugProgram;
gDebugProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
success = make_rigged_variant(gDebugProgram, gSkinnedDebugProgram);
- success = success && gDebugProgram.createShader(NULL, NULL);
+ success = success && gDebugProgram.createShader();
}
if (success)
@@ -2881,7 +2887,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
shader.addPermutation("HAS_ATTRIBUTE_TANGENT", "1");
}
success = make_rigged_variant(shader, skinned_shader);
- success = success && shader.createShader(NULL, NULL);
+ success = success && shader.createShader();
}
}
@@ -2892,7 +2898,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipV.glsl", GL_VERTEX_SHADER));
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER));
gClipProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gClipProgram.createShader(NULL, NULL);
+ success = gClipProgram.createShader();
}
if (success)
@@ -2902,7 +2908,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER));
gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER));
gBenchmarkProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gBenchmarkProgram.createShader(NULL, NULL);
+ success = gBenchmarkProgram.createShader();
}
if (success)
@@ -2918,7 +2924,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gReflectionProbeDisplayProgram.mShaderFiles.push_back(make_pair("interface/reflectionprobeV.glsl", GL_VERTEX_SHADER));
gReflectionProbeDisplayProgram.mShaderFiles.push_back(make_pair("interface/reflectionprobeF.glsl", GL_FRAGMENT_SHADER));
gReflectionProbeDisplayProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gReflectionProbeDisplayProgram.createShader(NULL, NULL);
+ success = gReflectionProbeDisplayProgram.createShader();
}
if (success)
@@ -2928,7 +2934,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gCopyProgram.mShaderFiles.push_back(make_pair("interface/copyV.glsl", GL_VERTEX_SHADER));
gCopyProgram.mShaderFiles.push_back(make_pair("interface/copyF.glsl", GL_FRAGMENT_SHADER));
gCopyProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gCopyProgram.createShader(NULL, NULL);
+ success = gCopyProgram.createShader();
}
if (success)
@@ -2940,7 +2946,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gCopyDepthProgram.clearPermutations();
gCopyDepthProgram.addPermutation("COPY_DEPTH", "1");
gCopyDepthProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gCopyDepthProgram.createShader(NULL, NULL);
+ success = gCopyDepthProgram.createShader();
}
if (success)
@@ -2950,7 +2956,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER));
gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER));
gAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gAlphaMaskProgram.createShader(NULL, NULL);
+ success = gAlphaMaskProgram.createShader();
}
if (success)
@@ -2964,7 +2970,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gReflectionMipProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER));
gReflectionMipProgram.mShaderFiles.push_back(make_pair("interface/reflectionmipF.glsl", GL_FRAGMENT_SHADER));
gReflectionMipProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gReflectionMipProgram.createShader(NULL, NULL);
+ success = gReflectionMipProgram.createShader();
}
if (success)
@@ -2978,7 +2984,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gGaussianProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER));
gGaussianProgram.mShaderFiles.push_back(make_pair("interface/gaussianF.glsl", GL_FRAGMENT_SHADER));
gGaussianProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gGaussianProgram.createShader(NULL, NULL);
+ success = gGaussianProgram.createShader();
}
if (success && gGLManager.mHasCubeMapArray)
@@ -2989,7 +2995,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gRadianceGenProgram.mShaderFiles.push_back(make_pair("interface/radianceGenF.glsl", GL_FRAGMENT_SHADER));
gRadianceGenProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
gRadianceGenProgram.addPermutation("PROBE_FILTER_SAMPLES", "32");
- success = gRadianceGenProgram.createShader(NULL, NULL);
+ success = gRadianceGenProgram.createShader();
}
if (success && gGLManager.mHasCubeMapArray)
@@ -3001,7 +3007,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gHeroRadianceGenProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
gHeroRadianceGenProgram.addPermutation("HERO_PROBES", "1");
gHeroRadianceGenProgram.addPermutation("PROBE_FILTER_SAMPLES", "4");
- success = gHeroRadianceGenProgram.createShader(NULL, NULL);
+ success = gHeroRadianceGenProgram.createShader();
}
if (success && gGLManager.mHasCubeMapArray)
@@ -3011,7 +3017,7 @@ bool LLViewerShaderMgr::loadShadersInterface()
gIrradianceGenProgram.mShaderFiles.push_back(make_pair("interface/irradianceGenV.glsl", GL_VERTEX_SHADER));
gIrradianceGenProgram.mShaderFiles.push_back(make_pair("interface/irradianceGenF.glsl", GL_FRAGMENT_SHADER));
gIrradianceGenProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE];
- success = gIrradianceGenProgram.createShader(NULL, NULL);
+ success = gIrradianceGenProgram.createShader();
}
if( !success )
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index b136ec55d8..4074abf893 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -527,8 +527,19 @@ F32 LLVOCacheEntry::getSquaredPixelThreshold(bool is_front)
return projection_threshold;
}
+extern bool gCubeSnapshot;
+
bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVector4a& local_camera_origin, F32 dist_threshold)
{
+#if 0
+ // this is ill-conceived and should be removed pending QA
+ // In the name of saving memory, we evict objects that are still within view distance from memory
+ // This results in constant paging of objects in and out of memory, leading to poor performance
+ // and many unacceptable visual glitches when rotating the camera
+
+ // Honestly, the entire VOCache partition system needs to be removed since it doubles the overhead of
+ // the spatial partition system and is redundant to the object cache, but this is a start
+ // - davep 2024.06.07
LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)getGroup();
if(!group)
{
@@ -565,6 +576,9 @@ bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVecto
}
return vis;
+#else
+ return true;
+#endif
}
void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 max_dist)