summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolpbropaque.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2022-06-27 10:24:53 -0700
committerBrad Kittenbrink <brad@lindenlab.com>2022-06-27 10:24:53 -0700
commitacdd77d4ce31a5014eff72f18b374e877001adf9 (patch)
tree2345c2ac7b2e1c8c1b341ccf6ff1e65993d8dea3 /indra/newview/lldrawpoolpbropaque.cpp
parentfbb6eb216f5dc06ff5c7c1cabc6ab46a94918e1b (diff)
parent231c618a844cee26a3779b703c88d8807df872e6 (diff)
Merge remote-tracking branch 'origin/DRTVWR-559' into brad/SL-17602-new-material-upload
Diffstat (limited to 'indra/newview/lldrawpoolpbropaque.cpp')
-rw-r--r--indra/newview/lldrawpoolpbropaque.cpp38
1 files changed, 28 insertions, 10 deletions
diff --git a/indra/newview/lldrawpoolpbropaque.cpp b/indra/newview/lldrawpoolpbropaque.cpp
index 86b3ac0d46..0c257a33a5 100644
--- a/indra/newview/lldrawpoolpbropaque.cpp
+++ b/indra/newview/lldrawpoolpbropaque.cpp
@@ -99,30 +99,48 @@ void LLDrawPoolPBROpaque::renderDeferred(S32 pass)
{
LLDrawInfo& params = **i;
-//gGL.getTexUnit(0)->activate();
+ //gGL.getTexUnit(0)->activate();
- if (mShaderLevel > 1)
+ if (params.mTexture.notNull())
{
- if (params.mTexture.notNull())
- {
- gGL.getTexUnit(0)->bindFast(params.mTexture); // diffuse
- }
+ gGL.getTexUnit(0)->bindFast(params.mTexture); // diffuse
+ }
+ else
+ {
+ gGL.getTexUnit(0)->bindFast(LLViewerFetchedTexture::sWhiteImagep);
}
if (params.mNormalMap)
{
gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::BUMP_MAP, params.mNormalMap);
}
+ else
+ {
+ // TODO: bind default normal map (???? WTF is it ???)
+ }
if (params.mSpecularMap)
{
gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::SPECULAR_MAP, params.mSpecularMap); // Packed Occlusion Roughness Metal
}
+ else
+ {
+ gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::SPECULAR_MAP, LLViewerFetchedTexture::sWhiteImagep);
+ }
+
+ if (params.mEmissiveMap)
+ {
+ gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::EMISSIVE_MAP, params.mEmissiveMap); // Packed Occlusion Roughness Metal
+ }
+ else
+ {
+ gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::EMISSIVE_MAP, LLViewerFetchedTexture::sWhiteImagep);
+ }
+
+ gDeferredPBROpaqueProgram.uniform1f(LLShaderMgr::ROUGHNESS_FACTOR, params.mGLTFMaterial->mRoughnessFactor);
+ gDeferredPBROpaqueProgram.uniform1f(LLShaderMgr::METALLIC_FACTOR, params.mGLTFMaterial->mMetallicFactor);
+ gDeferredPBROpaqueProgram.uniform3fv(LLShaderMgr::EMISSIVE_COLOR, 1, params.mGLTFMaterial->mEmissiveColor.mV);
- // Similar to LLDrawPooLMaterials::pushMaterialsBatch(params, getVertexDataMask(), false);
LLRenderPass::pushBatch(params, getVertexDataMask(), FALSE, FALSE);
- //LLRenderPass::applyModelMatrix(params);
- //params.mVertexBuffer->setBufferFast(getVertexDataMask());
- //params.mVertexBuffer->drawRangeFast(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
}
}