Esempio n. 1
0
void TSMesh::render( TSVertexBufferHandle &instanceVB, GFXPrimitiveBufferHandle &instancePB )
{
   // A TSMesh never uses the instanceVB.
   TORQUE_UNUSED( instanceVB ); 
   TORQUE_UNUSED( instancePB );

   innerRender( mVB, mPB );
}
Esempio n. 2
0
void TSMesh::render( TSMaterialList *materials, 
                     const TSRenderState &rdata, 
                     bool isSkinDirty,
                     const Vector<MatrixF> &transforms, 
                     TSVertexBufferHandle &vertexBuffer,
                     GFXPrimitiveBufferHandle &primitiveBuffer )
{
   // These are only used by TSSkinMesh.
   TORQUE_UNUSED( isSkinDirty );   
   TORQUE_UNUSED( transforms );
   TORQUE_UNUSED( vertexBuffer );
   TORQUE_UNUSED( primitiveBuffer );

   // Pass our shared VB.
   innerRender( materials, rdata, mVB, mPB );
}
Esempio n. 3
0
void WaterObject::renderObject( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat )
{
   if ( overrideMat )
      return;   

   // TODO: Revive projection z-bias at some point.
   // The current issue with this method of fixing z-fighting
   // in the WaterBlock is that a constant bias does not alleviate
   // the issue at the extreme end of the view range.
   //GFXTransformSaver saver;

   //MatrixF projMat( true );
   //const Frustum &frustum = ri->state->getFrustum();
   //
   //F32 bias = Con::getFloatVariable( "$waterBlockBias", 0.0002418f );

   //MathUtils::getZBiasProjectionMatrix( bias, frustum, &projMat );
   //GFX->setProjectionMatrix( projMat );
 
   
   GFXOcclusionQuery *query = mPlaneReflector.getOcclusionQuery();

   bool doQuery = ( !mPlaneReflector.mQueryPending && query && mReflectorDesc.useOcclusionQuery );

   // We need to call this for avoid a DX9 or Nvidia bug.
   // At some resollutions read from render target,
   // break current occlusion query.
   REFLECTMGR->getRefractTex();

   if ( doQuery )
      query->begin();

   // Real render call, done by derived class.
   innerRender( state );

   if ( doQuery )
      query->end();   

   if ( mUnderwater && mBasicLighting )
      drawUnderwaterFilter( state );
}