Esempio n. 1
0
void LLDrawPoolMaterials::renderDeferred(S32 pass)
{
	static const U32 type_list[] = 
	{
		LLRenderPass::PASS_MATERIAL,
		//LLRenderPass::PASS_MATERIAL_ALPHA,
		LLRenderPass::PASS_MATERIAL_ALPHA_MASK,
		LLRenderPass::PASS_MATERIAL_ALPHA_EMISSIVE,
		LLRenderPass::PASS_SPECMAP,
		//LLRenderPass::PASS_SPECMAP_BLEND,
		LLRenderPass::PASS_SPECMAP_MASK,
		LLRenderPass::PASS_SPECMAP_EMISSIVE,
		LLRenderPass::PASS_NORMMAP,
		//LLRenderPass::PASS_NORMMAP_BLEND,
		LLRenderPass::PASS_NORMMAP_MASK,
		LLRenderPass::PASS_NORMMAP_EMISSIVE,
		LLRenderPass::PASS_NORMSPEC,
		//LLRenderPass::PASS_NORMSPEC_BLEND,
		LLRenderPass::PASS_NORMSPEC_MASK,
		LLRenderPass::PASS_NORMSPEC_EMISSIVE,
	};

	llassert(pass < sizeof(type_list)/sizeof(U32));

	U32 type = type_list[pass];

	U32 mask = mShader->mAttributeMask;

	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;
		
		mShader->uniform4f(LLShaderMgr::SPECULAR_COLOR, params.mSpecColor.mV[0], params.mSpecColor.mV[1], params.mSpecColor.mV[2], params.mSpecColor.mV[3]);
		mShader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, params.mEnvIntensity);
		
		if (params.mNormalMap)
		{
			params.mNormalMap->addTextureStats(params.mVSize);
			bindNormalMap(params.mNormalMap);
		}
		
		if (params.mSpecularMap)
		{
			params.mSpecularMap->addTextureStats(params.mVSize);
			bindSpecularMap(params.mSpecularMap);
		}
		
		mShader->setMinimumAlpha(params.mAlphaMaskCutoff);
		mShader->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, params.mFullbright ? 1.f : 0.f);

		pushBatch(params, mask, TRUE);
	}
}
Esempio n. 2
0
void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture)
{
	for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)	
	{
		LLDrawInfo* pparams = *i;
		if (pparams) 
		{
			pushBatch(*pparams, mask, texture);
		}
	}
}
Esempio n. 3
0
void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture)
{					
	LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type];
	
	for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)	
	{
		LLDrawInfo *pparams = *k;
		if (pparams) {
			pushBatch(*pparams, mask, texture);
		}
	}
}
Esempio n. 4
0
void LLRenderPass::pushMaskBatches(U32 type, U32 mask, BOOL texture, BOOL batch_textures)
{
	for (LLCullResult::drawinfo_iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)	
	{
		LLDrawInfo* pparams = *i;
		if (pparams) 
		{
			if (LLGLSLShader::sCurBoundShaderPtr)
			{
				LLGLSLShader::sCurBoundShaderPtr->setMinimumAlpha(pparams->mAlphaMaskCutoff);
			}
			else
			{
				gGL.setAlphaRejectSettings(LLRender::CF_GREATER, pparams->mAlphaMaskCutoff);
			}
			
			pushBatch(*pparams, mask, texture, batch_textures);
		}
	}
}
Esempio n. 5
0
void LLDrawPoolBump::renderDeferred(S32 pass)
{
	if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
	{
		return;
	}
	LLFastTimer ftm(FTM_RENDER_BUMP);

	U32 type = LLRenderPass::PASS_BUMP;
	LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
	LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);

	U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_BINORMAL | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
	
	for (LLCullResult::drawinfo_list_t::iterator i = begin; i != end; ++i)	
	{
		LLDrawInfo& params = **i;

		LLDrawPoolBump::bindBumpMap(params, bump_channel);
		pushBatch(params, mask, TRUE);
	}
}
Esempio n. 6
0
void LLDrawPoolBump::renderDeferred(S32 pass)
{
	if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_BUMP))
	{
		return;
	}
	LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);

	U32 type = LLRenderPass::PASS_BUMP;
	LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
	LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);

	U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
	
	for (LLCullResult::drawinfo_iterator i = begin; i != end; ++i)	
	{
		LLDrawInfo& params = **i;

		gDeferredBumpProgram.setMinimumAlpha(params.mAlphaMaskCutoff);
		LLDrawPoolBump::bindBumpMap(params, bump_channel);
		pushBatch(params, mask, TRUE);
	}
}