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

Method innerRender

Engine/source/environment/river.cpp:788–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786}
787
788void 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 );

Callers

nothing calls this directly

Calls 14

getSpecialLightMethod · 0.80
getRefractTexMethod · 0.80
getCurPassMethod · 0.80
setVertexBufferMethod · 0.80
setPrimitiveBufferMethod · 0.80
ColorIClass · 0.50
initMethod · 0.45
emptyMethod · 0.45
setupPassMethod · 0.45
setSceneInfoMethod · 0.45
setTransformsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected