MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / renderObject

Method renderObject

Engine/source/environment/waterObject.cpp:725–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723}
724
725void WaterObject::renderObject( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat )
726{
727 if ( overrideMat )
728 return;
729
730 // TODO: Revive projection z-bias at some point.
731 // The current issue with this method of fixing z-fighting
732 // in the WaterBlock is that a constant bias does not alleviate
733 // the issue at the extreme end of the view range.
734 //GFXTransformSaver saver;
735
736 //MatrixF projMat( true );
737 //const Frustum &frustum = ri->state->getFrustum();
738 //
739 //F32 bias = Con::getFloatVariable( "$waterBlockBias", 0.0002418f );
740
741 //MathUtils::getZBiasProjectionMatrix( bias, frustum, &projMat );
742 //GFX->setProjectionMatrix( projMat );
743
744
745 GFXOcclusionQuery *query = mPlaneReflector.getOcclusionQuery();
746
747 bool doQuery = ( !mPlaneReflector.mQueryPending && query && mReflectorDesc.useOcclusionQuery );
748
749 // We need to call this for avoid a DX9 or Nvidia bug.
750 // At some resollutions read from render target,
751 // break current occlusion query.
752 REFLECTMGR->getRefractTex();
753
754 if ( doQuery )
755 query->begin();
756
757 // Real render call, done by derived class.
758 innerRender( state );
759
760 if ( doQuery )
761 query->end();
762
763 if ( mUnderwater && mBasicLighting )
764 drawUnderwaterFilter( state );
765}
766
767void WaterObject::setCustomTextures( S32 matIdx, U32 pass, const WaterMatParams &paramHandles )
768{

Callers

nothing calls this directly

Calls 4

getRefractTexMethod · 0.80
getOcclusionQueryMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected