本文整理汇总了C++中GFXStateBlockDesc::setColorWrites方法的典型用法代码示例。如果您正苦于以下问题:C++ GFXStateBlockDesc::setColorWrites方法的具体用法?C++ GFXStateBlockDesc::setColorWrites怎么用?C++ GFXStateBlockDesc::setColorWrites使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFXStateBlockDesc
的用法示例。
在下文中一共展示了GFXStateBlockDesc::setColorWrites方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _createPass
//.........这里部分代码省略.........
pass->viewToObj = pass->shader->getShaderConstHandle( "$viewToObj" );
pass->eyePosWorldConst = pass->shader->getShaderConstHandle( "$eyePosWorld" );
pass->eyePosConst = pass->shader->getShaderConstHandle( "$eyePos" );
pass->vEyeConst = pass->shader->getShaderConstHandle( "$vEye" );
pass->layerSizeConst = pass->shader->getShaderConstHandle( "$layerSize" );
pass->objTransConst = pass->shader->getShaderConstHandle( "$objTrans" );
pass->worldToObjConst = pass->shader->getShaderConstHandle( "$worldToObj" );
pass->lightInfoBufferConst = pass->shader->getShaderConstHandle( "$lightInfoBuffer" );
pass->baseTexMapConst = pass->shader->getShaderConstHandle( "$baseTexMap" );
pass->layerTexConst = pass->shader->getShaderConstHandle( "$layerTex" );
pass->fogDataConst = pass->shader->getShaderConstHandle( "$fogData" );
pass->fogColorConst = pass->shader->getShaderConstHandle( "$fogColor" );
pass->lightMapTexConst = pass->shader->getShaderConstHandle( "$lightMapTex" );
pass->oneOverTerrainSize = pass->shader->getShaderConstHandle( "$oneOverTerrainSize" );
pass->squareSize = pass->shader->getShaderConstHandle( "$squareSize" );
pass->lightParamsConst = pass->shader->getShaderConstHandle( "$rtParamslightInfoBuffer" );
// Now prepare the basic stateblock.
GFXStateBlockDesc desc;
if ( !firstPass )
{
desc.setBlend( true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha );
// If this is the prepass then we don't want to
// write to the last two color channels (where
// depth is usually encoded).
//
// This trick works in combination with the
// MFT_TerrainAdditive feature to lerp the
// output normal with the previous pass.
//
if ( prePassMat )
desc.setColorWrites( true, true, true, false );
}
// We write to the zbuffer if this is a prepass
// material or if the prepass is disabled.
desc.setZReadWrite( true, !MATMGR->getPrePassEnabled() ||
prePassMat ||
reflectMat );
desc.samplersDefined = true;
if ( pass->baseTexMapConst->isValid() )
desc.samplers[pass->baseTexMapConst->getSamplerRegister()] = GFXSamplerStateDesc::getWrapLinear();
if ( pass->layerTexConst->isValid() )
desc.samplers[pass->layerTexConst->getSamplerRegister()] = GFXSamplerStateDesc::getClampPoint();
if ( pass->lightInfoBufferConst->isValid() )
desc.samplers[pass->lightInfoBufferConst->getSamplerRegister()] = GFXSamplerStateDesc::getClampPoint();
if ( pass->lightMapTexConst->isValid() )
desc.samplers[pass->lightMapTexConst->getSamplerRegister()] = GFXSamplerStateDesc::getWrapLinear();
const U32 maxAnisotropy = MATMGR->getDefaultAnisotropy();
// Finally setup the material specific shader
// constants and stateblock state.
//
// NOTE: If this changes be sure to check TerrainCellMaterial::_updateDefaultAnisotropy
// to see if it needs the same changes.
//
for ( U32 i=0; i < pass->materials.size(); i++ )
{
MaterialInfo *matInfo = pass->materials[i];