コード例 #1
0
//-----------------------------------------------------------------------
bool FFPTexturing::preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass)
{
	//count the number of texture units we need to process
	size_t validTexUnits = 0;
	for (unsigned short i=0; i < srcPass->getNumTextureUnitStates(); ++i)
	{		
		if (isProcessingNeeded(srcPass->getTextureUnitState(i)))
		{
			++validTexUnits;
		}
	}

	setTextureUnitCount(validTexUnits);

	// Build texture stage sub states.
	for (unsigned short i=0; i < srcPass->getNumTextureUnitStates(); ++i)
	{		
		TextureUnitState* texUnitState = srcPass->getTextureUnitState(i);								

		if (isProcessingNeeded(texUnitState))
		{
			setTextureUnit(i, texUnitState);	
		}
	}	

	return true;
}
コード例 #2
0
//-----------------------------------------------------------------------
void FFPTexturing::copyFrom(const SubRenderState& rhs)
{
	const FFPTexturing& rhsTexture = static_cast<const FFPTexturing&>(rhs);

	setTextureUnitCount(rhsTexture.getTextureUnitCount());

	for (unsigned int i=0; i < rhsTexture.getTextureUnitCount(); ++i)
	{
		setTextureUnit(i, rhsTexture.mTextureUnitParamsList[i].mTextureUnitState);
	}		
}
コード例 #3
0
//-----------------------------------------------------------------------
bool FFPTexturing::preAddToRenderState(RenderState* renderState, Pass* srcPass, Pass* dstPass)
{
	setTextureUnitCount(srcPass->getNumTextureUnitStates());

	// Build texture stage sub states.
	for (unsigned short i=0; i < srcPass->getNumTextureUnitStates(); ++i)
	{		
		TextureUnitState* texUnitState = srcPass->getTextureUnitState(i);								

		setTextureUnit(i, texUnitState);			
	}	

	return true;
}