| 692 | } |
| 693 | |
| 694 | void WaterPlane::prepRenderImage( SceneRenderState *state ) |
| 695 | { |
| 696 | PROFILE_SCOPE(WaterPlane_prepRenderImage); |
| 697 | |
| 698 | if( !state->isDiffusePass() ) |
| 699 | return; |
| 700 | |
| 701 | mBasicLighting = dStricmp( LIGHTMGR->getId(), "BLM" ) == 0; |
| 702 | mUnderwater = isUnderwater( state->getCameraPosition() ); |
| 703 | |
| 704 | mMatrixSet->setSceneView(GFX->getWorldMatrix()); |
| 705 | |
| 706 | const Frustum &frustum = state->getCameraFrustum(); |
| 707 | |
| 708 | if ( mPrimBuff.isNull() || |
| 709 | mGenerateVB || |
| 710 | frustum != mFrustum ) |
| 711 | { |
| 712 | mFrustum = frustum; |
| 713 | setupVBIB( state ); |
| 714 | mGenerateVB = false; |
| 715 | |
| 716 | MatrixF proj( true ); |
| 717 | MathUtils::getZBiasProjectionMatrix( 0.0001f, mFrustum, &proj ); |
| 718 | mMatrixSet->setSceneProjection(proj); |
| 719 | } |
| 720 | |
| 721 | _getWaterPlane( state->getCameraPosition(), mWaterPlane, mWaterPos ); |
| 722 | mWaterFogData.plane = mWaterPlane; |
| 723 | mPlaneReflector.refplane = mWaterPlane; |
| 724 | updateUnderwaterEffect( state ); |
| 725 | |
| 726 | ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>(); |
| 727 | ri->renderDelegate.bind( this, &WaterObject::renderObject ); |
| 728 | ri->type = RenderPassManager::RIT_Water; |
| 729 | state->getRenderPass()->addInst( ri ); |
| 730 | |
| 731 | //mRenderUpdateCount++; |
| 732 | } |
| 733 | |
| 734 | void WaterPlane::innerRender( SceneRenderState *state ) |
| 735 | { |
nothing calls this directly
no test coverage detected