I am developing Real Library. This is basically an indie game engine.
Every entity is composed of a graphics model and a physics model. The physics model determines the position and rotation and the graphics model follows it.
I load graphic models with two possible ways. And each model is created in its own Node.
1. Static( Environment, Buildings etc ) by using:
Code: Select all
// Useful pointers to graphics device.
irr::IrrlichtDevice* pGraphicsDevice = GRAPHICSDEVICE.getGraphicsDevice();
irr::scene::ISceneManager* pSceneManager = pGraphicsDevice->getSceneManager();
// Load mesh.
irr::scene::IAnimatedMesh* pTempMesh = pSceneManager->getMesh( mesh.GetString() );
m_node = 0;
if( pTempMesh )
m_node = pSceneManager->addOctreeSceneNode( pTempMesh->getMesh(0), 0, -1, 1024 );
Code: Select all
// Useful pointers to graphics device.
irr::IrrlichtDevice* pGraphicsDevice = GRAPHICSDEVICE.getGraphicsDevice();
irr::video::IVideoDriver* pVideoDriver = pGraphicsDevice->getVideoDriver();
irr::scene::ISceneManager* pSceneManager = pGraphicsDevice->getSceneManager();
// Load mesh.
irr::scene::IAnimatedMesh* pTempMesh = pSceneManager->getMesh( mesh.GetString() );
m_node = 0;
if( pTempMesh )
m_node = pSceneManager->addAnimatedMeshSceneNode( pTempMesh );
Code: Select all
m_node->setMaterialFlag( irr::video::EMF_GOURAUD_SHADING, true );
m_node->setMaterialFlag( irr::video::EMF_LIGHTING, false );
m_node->setMaterialFlag( irr::video::EMF_ZBUFFER, true );
m_node->setMaterialFlag( irr::video::EMF_ZWRITE_ENABLE, true );
m_node->setMaterialFlag( irr::video::EMF_BACK_FACE_CULLING, true );
m_node->setMaterialFlag( irr::video::EMF_FRONT_FACE_CULLING, false );
m_node->setMaterialFlag( irr::video::EMF_ANISOTROPIC_FILTER, true );
m_node->setMaterialFlag( irr::video::EMF_FOG_ENABLE, false );
m_node->setMaterialFlag( irr::video::EMF_NORMALIZE_NORMALS, true );
m_node->setMaterialFlag( irr::video::EMF_TEXTURE_WRAP, false );
m_node->setMaterialFlag( irr::video::EMF_ANTI_ALIASING, true );
m_node->setMaterialFlag( irr::video::EMF_COLOR_MASK, true );
m_node->setMaterialFlag( irr::video::EMF_COLOR_MATERIAL, false );
m_node->setAutomaticCulling( irr::scene::EAC_OCC_QUERY );
What are the best practises for getting the best FPS?
Is there any tutorials on that?
In a search in the forum I saw many similar beginner's problems but have found no answer that actually got to understand.
I think a tutorial explaining all these should be included with Irrlicht. I would need so much one.
Thanks!!!!!