本文整理汇总了C++中TSRenderState::setAccuTex方法的典型用法代码示例。如果您正苦于以下问题:C++ TSRenderState::setAccuTex方法的具体用法?C++ TSRenderState::setAccuTex怎么用?C++ TSRenderState::setAccuTex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSRenderState
的用法示例。
在下文中一共展示了TSRenderState::setAccuTex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepRenderImage
void TSStatic::prepRenderImage( SceneRenderState* state )
{
if( !mShapeInstance )
return;
Point3F cameraOffset;
getRenderTransform().getColumn(3,&cameraOffset);
cameraOffset -= state->getDiffuseCameraPosition();
F32 dist = cameraOffset.len();
if (dist < 0.01f)
dist = 0.01f;
if (mUseAlphaFade)
{
mAlphaFade = 1.0f;
if ((mAlphaFadeStart < mAlphaFadeEnd) && mAlphaFadeStart > 0.1f)
{
if (mInvertAlphaFade)
{
if (dist <= mAlphaFadeStart)
{
return;
}
if (dist < mAlphaFadeEnd)
{
mAlphaFade = ((dist - mAlphaFadeStart) / (mAlphaFadeEnd - mAlphaFadeStart));
}
}
else
{
if (dist >= mAlphaFadeEnd)
{
return;
}
if (dist > mAlphaFadeStart)
{
mAlphaFade -= ((dist - mAlphaFadeStart) / (mAlphaFadeEnd - mAlphaFadeStart));
}
}
}
}
F32 invScale = (1.0f/getMax(getMax(mObjScale.x,mObjScale.y),mObjScale.z));
if ( mForceDetail == -1 )
mShapeInstance->setDetailFromDistance( state, dist * invScale );
else
mShapeInstance->setCurrentDetail( mForceDetail );
if ( mShapeInstance->getCurrentDetail() < 0 )
return;
GFXTransformSaver saver;
// Set up our TS render state.
TSRenderState rdata;
rdata.setSceneState( state );
rdata.setFadeOverride( 1.0f );
rdata.setOriginSort( mUseOriginSort );
// Acculumation
rdata.setAccuTex(mAccuTex);
// If we have submesh culling enabled then prepare
// the object space frustum to pass to the shape.
Frustum culler;
if ( mMeshCulling )
{
culler = state->getCullingFrustum();
MatrixF xfm( true );
xfm.scale( Point3F::One / getScale() );
xfm.mul( getRenderWorldTransform() );
xfm.mul( culler.getTransform() );
culler.setTransform( xfm );
rdata.setCuller( &culler );
}
// We might have some forward lit materials
// so pass down a query to gather lights.
LightQuery query;
query.init( getWorldSphere() );
rdata.setLightQuery( &query );
MatrixF mat = getRenderTransform();
mat.scale( mObjScale );
GFX->setWorldMatrix( mat );
mShapeInstance->animate();
if(mShapeInstance)
{
if (mUseAlphaFade)
{
mShapeInstance->setAlphaAlways(mAlphaFade);
S32 s = mShapeInstance->mMeshObjects.size();
for(S32 x = 0; x < s; x++)
{
mShapeInstance->mMeshObjects[x].visible = mAlphaFade;
}
}
//.........这里部分代码省略.........