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

Method innerRender

Engine/source/environment/river.cpp:783–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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