diff options
Diffstat (limited to 'indra/newview/lldrawpoolpbropaque.cpp')
-rw-r--r-- | indra/newview/lldrawpoolpbropaque.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolpbropaque.cpp b/indra/newview/lldrawpoolpbropaque.cpp index 2478aa0cff..f23d2d04a8 100644 --- a/indra/newview/lldrawpoolpbropaque.cpp +++ b/indra/newview/lldrawpoolpbropaque.cpp @@ -73,6 +73,12 @@ void LLDrawPoolPBROpaque::renderDeferred(S32 pass) return; } + const U32 type = LLPipeline::RENDER_TYPE_PASS_PBR_OPAQUE; + if (!gPipeline.hasRenderType(type)) + { + return; + } + gGL.flush(); LLGLDisable blend(GL_BLEND); @@ -86,7 +92,37 @@ void LLDrawPoolPBROpaque::renderDeferred(S32 pass) // TODO: handle under water? // if (LLPipeline::sUnderWaterRender) - // PASS_SIMPLE or PASS_MATERIAL - //pushBatches(LLRenderPass::PASS_SIMPLE, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); -} + LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type); + LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type); + + for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i) + { + LLDrawInfo& params = **i; + +//gGL.getTexUnit(0)->activate(); + if (mShaderLevel > 1) + { + if (params.mTexture.notNull()) + { + gGL.getTexUnit(-1)->bindFast(params.mTexture); // diffuse + } + } + + if (params.mNormalMap) + { + gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::BUMP_MAP, params.mNormalMap); + } + + if (params.mSpecularMap) + { + gDeferredPBROpaqueProgram.bindTexture(LLShaderMgr::SPECULAR_MAP, params.mSpecularMap); // Packed Occlusion Roughness Metal + } + + // Similar to LLDrawPooLMaterials::pushMaterialsBatch(params, getVertexDataMask(), false); + + LLRenderPass::applyModelMatrix(params); + params.mVertexBuffer->setBufferFast(getVertexDataMask()); + params.mVertexBuffer->drawRangeFast(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + } +} |