summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2024-01-19 11:36:56 -0600
committerGitHub <noreply@github.com>2024-01-19 11:36:56 -0600
commit6dd260c3699148b4ddf8e7bff84f4b19f8bbf076 (patch)
tree6c9144f701ecb2cda859baaeed4e2f4ee6f9a683 /indra/llrender
parent45547c7bbadf15804f54bb28fd1c94eb5f080bf5 (diff)
parent09ee84f675cf08f98cbd49516c5e01c289b42a20 (diff)
Merge branch 'release/materials_featurette' into DRTVWR-592
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llcubemaparray.cpp2
-rw-r--r--indra/llrender/llcubemaparray.h8
-rw-r--r--indra/llrender/llglslshader.h1
-rw-r--r--indra/llrender/llgltexture.cpp3
-rw-r--r--indra/llrender/llgltexture.h3
-rw-r--r--indra/llrender/llrender.h2
-rw-r--r--indra/llrender/llrendernavprim.cpp10
-rw-r--r--indra/llrender/llshadermgr.cpp92
8 files changed, 39 insertions, 82 deletions
diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp
index 7d3a92237b..1debd33953 100644
--- a/indra/llrender/llcubemaparray.cpp
+++ b/indra/llrender/llcubemaparray.cpp
@@ -110,6 +110,8 @@ LLCubeMapArray::~LLCubeMapArray()
void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, BOOL use_mips)
{
U32 texname = 0;
+ mWidth = resolution;
+ mCount = count;
LLImageGL::generateTextures(1, &texname);
diff --git a/indra/llrender/llcubemaparray.h b/indra/llrender/llcubemaparray.h
index 19c86278a1..6c3f7dc890 100644
--- a/indra/llrender/llcubemaparray.h
+++ b/indra/llrender/llcubemaparray.h
@@ -60,9 +60,17 @@ public:
void destroyGL();
+ // get width of cubemaps in array (they're cubes, so this is also the height)
+ U32 getWidth() const { return mWidth; }
+
+ // get number of cubemaps in the array
+ U32 getCount() const { return mCount; }
+
protected:
friend class LLTexUnit;
~LLCubeMapArray();
LLPointer<LLImageGL> mImage;
+ U32 mWidth = 0;
+ U32 mCount = 0;
S32 mTextureStage;
};
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 0de97da4db..b18b56c59d 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -41,7 +41,6 @@ public:
bool hasLighting = false; // implies no transport (it's possible to have neither though)
bool isAlphaLighting = false; // indicates lighting shaders need not be linked in (lighting performed directly in alpha shader to match deferred lighting functions)
bool isSpecular = false;
- bool hasWaterFog = false; // implies no gamma
bool hasTransport = false; // implies no lighting (it's possible to have neither though)
bool hasSkinning = false;
bool hasObjectSkinning = false;
diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp
index 7fdef4a3b7..b616002b49 100644
--- a/indra/llrender/llgltexture.cpp
+++ b/indra/llrender/llgltexture.cpp
@@ -94,7 +94,8 @@ void LLGLTexture::setBoostLevel(S32 level)
{
mBoostLevel = level ;
if(mBoostLevel != LLGLTexture::BOOST_NONE
- && mBoostLevel != LLGLTexture::BOOST_ICON)
+ && mBoostLevel != LLGLTexture::BOOST_ICON
+ && mBoostLevel != LLGLTexture::BOOST_THUMBNAIL)
{
setNoDelete() ;
}
diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h
index 5c693fc93c..1cc8fbe523 100644
--- a/indra/llrender/llgltexture.h
+++ b/indra/llrender/llgltexture.h
@@ -42,7 +42,7 @@ class LLGLTexture : public LLTexture
public:
enum
{
- MAX_IMAGE_SIZE_DEFAULT = 1024,
+ MAX_IMAGE_SIZE_DEFAULT = 2048,
INVALID_DISCARD_LEVEL = 0x7fff
};
@@ -62,6 +62,7 @@ public:
BOOST_SUPER_HIGH , //textures higher than this need to be downloaded at the required resolution without delay.
BOOST_HUD ,
BOOST_ICON ,
+ BOOST_THUMBNAIL ,
BOOST_UI ,
BOOST_PREVIEW ,
BOOST_MAP ,
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 98141d71f5..fd922affba 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -44,6 +44,8 @@
#include "llmatrix4a.h"
#include "glh/glh_linear.h"
+#include <array>
+
class LLVertexBuffer;
class LLCubeMap;
class LLImageGL;
diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp
index d610a44bc6..eea3077632 100644
--- a/indra/llrender/llrendernavprim.cpp
+++ b/indra/llrender/llrendernavprim.cpp
@@ -40,20 +40,20 @@ LLRenderNavPrim gRenderNav;
//=============================================================================
void LLRenderNavPrim::renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color ) const
{
- LLColor4 cV(color);
- gGL.color4fv( cV.mV );
- gGL.begin(LLRender::TRIANGLES);
+ gGL.color4ubv(color.mV);
+
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.vertex3fv( a.mV );
gGL.vertex3fv( b.mV );
gGL.vertex3fv( c.mV );
}
- gGL.end();
+ gGL.end();
}
//=============================================================================
void LLRenderNavPrim::renderNavMeshVB( U32 mode, LLVertexBuffer* pVBO, int vertCnt )
{
pVBO->setBuffer();
- pVBO->drawArrays( mode, 0, vertCnt );
+ pVBO->drawArrays( mode, 0, vertCnt );
}
//=============================================================================
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index d1ff85c85b..5522c8f9ad 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -81,14 +81,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
// NOTE order of shader object attaching is VERY IMPORTANT!!!
if (features->calculatesAtmospherics)
{
- if (features->hasWaterFog)
- {
- if (!shader->attachVertexObject("windlight/atmosphericsVarsWaterV.glsl"))
- {
- return FALSE;
- }
- }
- else if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl"))
+ if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl"))
{
return FALSE;
}
@@ -201,14 +194,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
if(features->calculatesAtmospherics || features->hasGamma || features->isDeferred)
{
- if (features->hasWaterFog)
- {
- if (!shader->attachFragmentObject("windlight/atmosphericsVarsWaterF.glsl"))
- {
- return FALSE;
- }
- }
- else if (!shader->attachFragmentObject("windlight/atmosphericsVarsF.glsl"))
+ if (!shader->attachFragmentObject("windlight/atmosphericsVarsF.glsl"))
{
return FALSE;
}
@@ -300,7 +286,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
}
// NOTE order of shader object attaching is VERY IMPORTANT!!!
- if (features->hasWaterFog)
+ if (features->hasAtmospherics)
{
if (!shader->attachFragmentObject("environment/waterFogF.glsl"))
{
@@ -310,82 +296,40 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
if (features->hasLighting)
{
- if (features->hasWaterFog)
+ if (features->disableTextureIndex)
{
- if (features->disableTextureIndex)
+ if (features->hasAlphaMask)
{
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskNonIndexedF.glsl"))
- {
- return FALSE;
- }
- }
- else
+ if (!shader->attachFragmentObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
{
- if (!shader->attachFragmentObject("lighting/lightWaterNonIndexedF.glsl"))
- {
- return FALSE;
- }
+ return FALSE;
}
}
- else
+ else
{
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightWaterAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else
+ if (!shader->attachFragmentObject("lighting/lightNonIndexedF.glsl"))
{
- if (!shader->attachFragmentObject("lighting/lightWaterF.glsl"))
- {
- return FALSE;
- }
+ return FALSE;
}
- shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
}
}
-
- else
+ else
{
- if (features->disableTextureIndex)
+ if (features->hasAlphaMask)
{
- if (features->hasAlphaMask)
+ if (!shader->attachFragmentObject("lighting/lightAlphaMaskF.glsl"))
{
- if (!shader->attachFragmentObject("lighting/lightAlphaMaskNonIndexedF.glsl"))
- {
- return FALSE;
- }
- }
- else
- {
- if (!shader->attachFragmentObject("lighting/lightNonIndexedF.glsl"))
- {
- return FALSE;
- }
+ return FALSE;
}
}
- else
+ else
{
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else
+ if (!shader->attachFragmentObject("lighting/lightF.glsl"))
{
- if (!shader->attachFragmentObject("lighting/lightF.glsl"))
- {
- return FALSE;
- }
+ return FALSE;
}
- shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
}
+ shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
}
}