summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llrender.h19
-rw-r--r--indra/llrender/llshadermgr.cpp3
-rw-r--r--indra/llrender/llshadermgr.h3
-rw-r--r--indra/llrender/llvertexbuffer.cpp12
-rw-r--r--indra/llrender/llvertexbuffer.h9
5 files changed, 34 insertions, 12 deletions
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index e6b4118beb..010ab122b6 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -293,15 +293,18 @@ public:
enum eTexIndex : U8
{
- DIFFUSE_MAP = 0,
- ALTERNATE_DIFFUSE_MAP = 1,
- NORMAL_MAP = 1,
- SPECULAR_MAP = 2,
- BASECOLOR_MAP = 3,
+ // Channels for material textures
+ DIFFUSE_MAP = 0,
+ ALTERNATE_DIFFUSE_MAP = 1,
+ NORMAL_MAP = 1,
+ SPECULAR_MAP = 2,
+ // Channels for PBR textures
+ BASECOLOR_MAP = 3,
METALLIC_ROUGHNESS_MAP = 4,
- GLTF_NORMAL_MAP = 5,
- EMISSIVE_MAP = 6,
- NUM_TEXTURE_CHANNELS = 7,
+ GLTF_NORMAL_MAP = 5,
+ EMISSIVE_MAP = 6,
+ // Total number of channels
+ NUM_TEXTURE_CHANNELS = 7,
};
enum eVolumeTexIndex : U8
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index bc542d325e..512ef340f9 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1409,6 +1409,7 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("detail_3");
mReservedUniforms.push_back("alpha_ramp");
+ mReservedUniforms.push_back("paint_map");
mReservedUniforms.push_back("detail_0_base_color");
mReservedUniforms.push_back("detail_1_base_color");
@@ -1433,6 +1434,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("emissiveColors");
mReservedUniforms.push_back("minimum_alphas");
+ mReservedUniforms.push_back("region_scale");
+
mReservedUniforms.push_back("origin");
mReservedUniforms.push_back("display_gamma");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 921ef20997..2b76ef664b 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -267,6 +267,7 @@ public:
TERRAIN_DETAIL3, // "detail_3"
TERRAIN_ALPHARAMP, // "alpha_ramp"
+ TERRAIN_PAINTMAP, // "paint_map"
TERRAIN_DETAIL0_BASE_COLOR, // "detail_0_base_color" (GLTF)
TERRAIN_DETAIL1_BASE_COLOR, // "detail_1_base_color" (GLTF)
@@ -291,6 +292,8 @@ public:
TERRAIN_EMISSIVE_COLORS, // "emissiveColors" (GLTF)
TERRAIN_MINIMUM_ALPHAS, // "minimum_alphas" (GLTF)
+ REGION_SCALE, // "region_scale" (GLTF)
+
SHINY_ORIGIN, // "origin"
DISPLAY_GAMMA, // "display_gamma"
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 2eb7c21f77..02afcf12c6 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -794,6 +794,18 @@ void LLVertexBuffer::setLabel(const char* label) {
}
#endif
+void LLVertexBuffer::clone(LLVertexBuffer& target) const
+{
+ target.mTypeMask = mTypeMask;
+ target.mIndicesType = mIndicesType;
+ target.mIndicesStride = mIndicesStride;
+ if (target.getNumVerts() != getNumVerts() ||
+ target.getNumIndices() != getNumIndices())
+ {
+ target.allocateBuffer(getNumVerts(), getNumIndices());
+ }
+}
+
void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
{
llassert(validateRange(start, end, count, indices_offset));
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 49500e28ce..4ada0c335b 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -163,13 +163,13 @@ public:
// set for rendering
// assumes (and will assert on) the following:
- // - this buffer has no pending unampBuffer call
+ // - this buffer has no pending unmapBuffer call
// - a shader is currently bound
// - This buffer has sufficient attributes within it to satisfy the needs of the currently bound shader
void setBuffer();
// Only call each getVertexPointer, etc, once before calling unmapBuffer()
- // call unmapBuffer() after calls to getXXXStrider() before any cals to setBuffer()
+ // call unmapBuffer() after calls to getXXXStrider() before any calls to setBuffer()
// example:
// vb->getVertexBuffer(verts);
// vb->getNormalStrider(norms);
@@ -218,12 +218,12 @@ public:
U32 getNumIndices() const { return mNumIndices; }
U32 getTypeMask() const { return mTypeMask; }
- bool hasDataType(AttributeType type) const { return ((1 << type) & getTypeMask()); }
+ bool hasDataType(AttributeType type) const { return ((1 << type) & getTypeMask()); }
U32 getSize() const { return mSize; }
U32 getIndicesSize() const { return mIndicesSize; }
U8* getMappedData() const { return mMappedData; }
U8* getMappedIndices() const { return mMappedIndexData; }
- U32 getOffset(AttributeType type) const { return mOffsets[type]; }
+ U32 getOffset(AttributeType type) const { return mOffsets[type]; }
// these functions assume (and assert on) the current VBO being bound
// Detailed error checking can be enabled by setting gDebugGL to true
@@ -242,6 +242,7 @@ public:
void setLabel(const char* label);
#endif
+ void clone(LLVertexBuffer& target) const;
protected:
U32 mGLBuffer = 0; // GL VBO handle