本文整理汇总了C++中GFXStateBlockDesc::setZEnable方法的典型用法代码示例。如果您正苦于以下问题:C++ GFXStateBlockDesc::setZEnable方法的具体用法?C++ GFXStateBlockDesc::setZEnable怎么用?C++ GFXStateBlockDesc::setZEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFXStateBlockDesc
的用法示例。
在下文中一共展示了GFXStateBlockDesc::setZEnable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void ClipMapBlenderCache::initialize( ClipMap *cm )
{
mOwningClipMap = cm;
mClipMapSize = cm->mClipMapSize;
mLightmapScratchTextures.push_back(GFXTexHandle( mClipMapSize, mClipMapSize, GFXFormatR8G8B8X8, &ClipMapTextureProfile, avar("%s() - mLightmapScratchTextures (line %d)", __FUNCTION__, __LINE__), 1 ));
if (GFX->getPixelShaderVersion() == 0.0f)
{
mFixedfunction = true;
// Fixed function stateblock
GFXStateBlockDesc sbFF;
sbFF.samplersDefined = true;
sbFF.samplers[0] = GFXSamplerStateDesc::getClampLinear();
sbFF.samplers[0].textureColorOp = GFXTOPSelectARG1;
sbFF.samplers[0].colorArg1 = GFXTATexture;
sbFF.samplers[1] = GFXSamplerStateDesc::getWrapLinear();
mFFBaseLayerSB = GFX->createStateBlock(sbFF);
sbFF.setBlend(true, GFXBlendOne, GFXBlendOne);
mFFAdditionalLayersSB = GFX->createStateBlock(sbFF);
sbFF.setBlend(true, GFXBlendDestColor, GFXBlendSrcColor);
sbFF.samplers[1].textureColorOp = GFXTOPDisable;
mFFLightmapSB = GFX->createStateBlock(sbFF);
}
else
{
mFixedfunction = false;
// Find and init shaders.
ShaderData *sd = NULL;
if(GFX->getPixelShaderVersion() >= 2.0f)
{
if(!Sim::findObject( ( mLM1 ? "AtlasBlender20ShaderLM1" : "AtlasBlender20Shader" ), sd) || (sd->mShader == NULL))
{
Con::errorf("ClipMapBlenderCache::initialize - "
"Couldn't find shader 'AtlasBlender20Shader'! Terrain will not blend properly on SM2.0 cards!");
}
else
{
mOnePass = sd->mShader;
if (mOnePass)
mShaderConsts = mOnePass->allocConstBuffer();
if (mShaderConsts)
sd->mapSamplerNames(mShaderConsts);
}
}
else
{
if(!Sim::findObject( ( mLM1 ? "AtlasBlender11AShaderLM1" : "AtlasBlendeer11AShader" ), sd) || (sd->mShader == NULL))
{
Con::errorf("ClipMapBlenderCache::initialize - "
"Couldn't find shader 'AtlasBlender11AShader'! Terrain will not blend properly on SM1.0 cards!");
}
else
{
mTwoPass[0] = sd->mShader;
if (mTwoPass[0])
mShaderConsts = mTwoPass[0]->allocConstBuffer();
if (mShaderConsts)
sd->mapSamplerNames(mShaderConsts);
}
if(!Sim::findObject( ( mLM1 ? "AtlasBlender11BShaderLM1" : "AtlasBlender11BShader" ), sd) || (sd->mShader == NULL))
{
Con::errorf("ClipMapBlenderCache::initialize - "
"Couldn't find shader 'AtlasBlender11BShader'! Terrain will not blend properly on SM1.0 cards!");
}
else
{
mTwoPass[1] = sd->mShader;
}
}
if (mShaderConsts)
{
mModelViewProjSC = mShaderConsts->getShader()->getShaderConstHandle(ShaderGenVars::modelview);
mOpacityMapSC = mShaderConsts->getShader()->getShaderConstHandle("$opacity");
mLightMapSC = mShaderConsts->getShader()->getShaderConstHandle("$lightMap");
mTex1SC = mShaderConsts->getShader()->getShaderConstHandle("$tex1");
mTex2SC = mShaderConsts->getShader()->getShaderConstHandle("$tex2");
mTex3SC = mShaderConsts->getShader()->getShaderConstHandle("$tex3");
mTex4SC = mShaderConsts->getShader()->getShaderConstHandle("$tex4");
mSourceTexScalesSC = mShaderConsts->getShader()->getShaderConstHandle("$sourceTexScales");
}
// Init state blocks
GFXStateBlockDesc sbd;
sbd.setCullMode(GFXCullNone);
sbd.setZEnable(false);
sbd.zWriteEnable = false;
sbd.samplersDefined = true;
sbd.samplers[0] = GFXSamplerStateDesc::getClampLinear();
sbd.samplers[1] = GFXSamplerStateDesc::getClampLinear();
sbd.samplers[2] = GFXSamplerStateDesc::getWrapLinear();
sbd.samplers[3] = GFXSamplerStateDesc::getWrapLinear();
sbd.samplers[4] = GFXSamplerStateDesc::getWrapLinear();
//.........这里部分代码省略.........