| 786 | } |
| 787 | |
| 788 | void River::innerRender( SceneRenderState *state ) |
| 789 | { |
| 790 | GFXDEBUGEVENT_SCOPE( River_innerRender, ColorI( 255, 0, 0 ) ); |
| 791 | |
| 792 | PROFILE_SCOPE( River_innerRender ); |
| 793 | |
| 794 | // Setup SceneData |
| 795 | SceneData sgData; |
| 796 | sgData.init( state ); |
| 797 | sgData.lights[0] = LIGHTMGR->getSpecialLight( LightManager::slSunLightType ); |
| 798 | sgData.backBuffTex = REFLECTMGR->getRefractTex(); |
| 799 | sgData.reflectTex = mPlaneReflector.reflectTex; |
| 800 | sgData.wireframe |= smWireframe; |
| 801 | |
| 802 | const Point3F &camPosition = state->getCameraPosition(); |
| 803 | |
| 804 | // set the material |
| 805 | |
| 806 | S32 matIdx = getMaterialIndex( camPosition ); |
| 807 | |
| 808 | if ( !initMaterial( matIdx ) ) |
| 809 | return; |
| 810 | |
| 811 | BaseMatInstance *mat = mMatInstances[matIdx]; |
| 812 | WaterMatParams matParams = mMatParamHandles[matIdx]; |
| 813 | |
| 814 | if ( !mat ) |
| 815 | return; |
| 816 | |
| 817 | // setup proj/world transform |
| 818 | GFXTransformSaver saver; |
| 819 | |
| 820 | setShaderParams( state, mat, matParams ); |
| 821 | |
| 822 | _makeRenderBatches( camPosition ); |
| 823 | |
| 824 | if ( !River::smShowRiver ) |
| 825 | return; |
| 826 | |
| 827 | // If no material... we're done. |
| 828 | if ( mLowLODBatches.empty() && mHighLODBatches.empty() ) |
| 829 | return; |
| 830 | |
| 831 | if ( !mHighLODBatches.empty() ) |
| 832 | _makeHighLODBuffers(); |
| 833 | |
| 834 | mMatrixSet->restoreSceneViewProjection(); |
| 835 | mMatrixSet->setWorld( MatrixF::Identity ); |
| 836 | |
| 837 | while( mat->setupPass( state, sgData ) ) |
| 838 | { |
| 839 | mat->setSceneInfo(state, sgData); |
| 840 | mat->setTransforms(*mMatrixSet, state); |
| 841 | |
| 842 | setCustomTextures( matIdx, mat->getCurPass(), matParams ); |
| 843 | |
| 844 | GFX->setVertexBuffer( mVB_low ); |
| 845 | GFX->setPrimitiveBuffer( mPB_low ); |
nothing calls this directly
no test coverage detected