| 723 | } |
| 724 | |
| 725 | void 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 | |
| 767 | void WaterObject::setCustomTextures( S32 matIdx, U32 pass, const WaterMatParams ¶mHandles ) |
| 768 | { |
nothing calls this directly
no test coverage detected