Hello everyone, I'm making my first 3D game with irrlicht and I have some doubts, first of all sorry about my english I'm Spanish.
Well my game is controlled by wiimotes with motion plus, so I need to get 60fps for better performance with the motionplus.
My problem is, I made a 3D object (Not exlacty is only an object, is like little objects grouped), the only thing is gonna be seen in the game is this object, so I thought is right to have many polygons and be well detailed, because is the only thing is gonna be seen. Finally it has around 35000 polygons, and for now only two textures.
I made it with 3dsmax2010, exported in .obj format, and loaded in irrlicht has a single meshscenenode.
The problem is I only get 30-40 fps :S. Even in another pc wicht is more powerfull (core 2 duo and geforce8600) than mi laptop it gets 50fps max.
I'm doing something wrong?, I don't belive that I can't get 60fps with only this object in screen. Or is really 35000 too many polygons for irrlicht??. I don't know what to do, I don't know if I really over detailed the mesh or if I'm doing wrong something in all this process.
I'm using microsoft visual studio 2010.
I need help!
Thanks to everyone.
polygon count & fps
-
Bear_130278
- Posts: 237
- Joined: Mon Jan 16, 2006 1:18 pm
- Location: Odessa,Russian Federation
I'm running in D3D9, it's the fastest in my tests.
Using the mesh viewer of the irrlicth examples (#9), the mesh has 33155 tris, and in this viewer it runs at 35-40 fps.
I have a lot of code done of things of the game (the controls basically) in witch I get de 30-35 fps commented (and over 50 in my other computer).
Now I made a new project copying all my code and deleting a lot o olny letting irrlicht to load the mesh and a camera, without any light. Then I get around 45-50fps (I saw it got better when I deleted the event receiver that I get from example #4 of irrlicht).
This is the code, you will see the mayority of it is from the initial example codes:
My laptop is an Intel Celeron 530 (1.73ghz) with a random Intel graphics chip, running W7 32bits and compiling in Visual Studio 2010. The .obj is created with 3dsmax2010.
I think my laptop is a bit standar, but por moving 35000 tris.... And the weird thing is that in my other computer (Core 2 Duo E6600 and a Geforce8600) it only gets a little better, is for that I think the problem is mine not of the computer I'm running it.
Using the mesh viewer of the irrlicth examples (#9), the mesh has 33155 tris, and in this viewer it runs at 35-40 fps.
I have a lot of code done of things of the game (the controls basically) in witch I get de 30-35 fps commented (and over 50 in my other computer).
Now I made a new project copying all my code and deleting a lot o olny letting irrlicht to load the mesh and a camera, without any light. Then I get around 45-50fps (I saw it got better when I deleted the event receiver that I get from example #4 of irrlicht).
This is the code, you will see the mayority of it is from the initial example codes:
Code: Select all
#pragma comment(lib, "Irrlicht.lib")
#include <irrlicht.h>
using namespace irr;
int main()
{
IrrlichtDevice* device = createDevice(video::EDT_DIRECT3D9,
core::dimension2d<u32>(1000, 700), 16, false, false, false);
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
scene::IMeshSceneNode *battery = smgr->addMeshSceneNode(smgr->getMesh("../bateria3.obj"));
if (battery)
{
battery->setMaterialFlag(video::EMF_LIGHTING, false);
battery->setPosition(core::vector3df(0,0,60));
}
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
camera->setPosition(core::vector3df(0,40,0));
camera->setTarget(core::vector3df(0,30,100));
device->getCursorControl()->setVisible(false);
int lastFPS = -1;
u32 then = device->getTimer()->getTime();
while(device->run())
{
const u32 now = device->getTimer()->getTime();
const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds
then = now;
driver->beginScene(true, true, video::SColor(255,113,113,133));
smgr->drawAll(); // draw the 3d scene
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw tmp(L"Movement Example - Irrlicht Engine [");
tmp += driver->getName();
tmp += L"] fps: ";
tmp += fps;
device->setWindowCaption(tmp.c_str());
lastFPS = fps;
}
}
device->drop();
return 0;
}
I think my laptop is a bit standar, but por moving 35000 tris.... And the weird thing is that in my other computer (Core 2 Duo E6600 and a Geforce8600) it only gets a little better, is for that I think the problem is mine not of the computer I'm running it.
(In spanish, so you can understand exactly...
)
35000 poligonos no son nada para la tarjeta de video. Comprueba que los meshbuffers se almacenan en la tarjeta de video con setHardwareMappingHint.
Luego, el proceso de render suele ir mejor si la resolucion que le das a la ventana es una estandar, como 1024x768, 800x600... etc. Y aunque no lo parezca, 32 bits son más adecuados que 16 porque completan una palabra de memoria y la tarjeta de video puede agilizar los procesos de transferencia entre bloques de memoria alineada a 32 bits. 16 bits son la mitad, pero para algunos procesos es mejor que la memoria esté alineada, con lo que la eficiencia tambien aumenta. Además, no tiene que realizar conversion de colores, aunque de todas maneras, me extraña, Yo he cargado Irrlicht con 90000 poligonos en varios meshbuffers y la cosa no bajaba de 90 fps.
Las texturas deberían tener resoluciones horizontal y vertical que sean potencia de 2 (512x512, 256x64 y así) Y no demasiado grandes. De máximo puede ser recomendable 512x512, pero pueden ser mayores.
Luego, algo secundario puede ser que trates de exportar las mallas a un archivo directX o un B3D. Estos tipos de archivo están más orientados a aplicaciones en tiempo real.
Y por último, las tarjetas de video de Intel no se caracterizan por ser demasiado rápidas, prueba a usar una ATI o una NVIDIA (si es para Wii, la ATI es la más próxima al hardware final)
Y por último: 35000 triangulos para una bateria?! macho, optimiza el modelo un poco!
35000 poligonos no son nada para la tarjeta de video. Comprueba que los meshbuffers se almacenan en la tarjeta de video con setHardwareMappingHint.
Luego, el proceso de render suele ir mejor si la resolucion que le das a la ventana es una estandar, como 1024x768, 800x600... etc. Y aunque no lo parezca, 32 bits son más adecuados que 16 porque completan una palabra de memoria y la tarjeta de video puede agilizar los procesos de transferencia entre bloques de memoria alineada a 32 bits. 16 bits son la mitad, pero para algunos procesos es mejor que la memoria esté alineada, con lo que la eficiencia tambien aumenta. Además, no tiene que realizar conversion de colores, aunque de todas maneras, me extraña, Yo he cargado Irrlicht con 90000 poligonos en varios meshbuffers y la cosa no bajaba de 90 fps.
Las texturas deberían tener resoluciones horizontal y vertical que sean potencia de 2 (512x512, 256x64 y así) Y no demasiado grandes. De máximo puede ser recomendable 512x512, pero pueden ser mayores.
Luego, algo secundario puede ser que trates de exportar las mallas a un archivo directX o un B3D. Estos tipos de archivo están más orientados a aplicaciones en tiempo real.
Y por último, las tarjetas de video de Intel no se caracterizan por ser demasiado rápidas, prueba a usar una ATI o una NVIDIA (si es para Wii, la ATI es la más próxima al hardware final)
Y por último: 35000 triangulos para una bateria?! macho, optimiza el modelo un poco!
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Para Mel:
Gracias por contestar, ahora mismo voy a probar todo lo que me has puesto a ver si consigo que mejore esto. Las texturas si sabia que tenían que estar en potencia de 2, al principio era una de 1024x1024 y las otras de 512x512 pero vamos que las pase todas a 256x256 y la cosa seguía igual.
Y oye que al principio eran 65000 polígonos XD, le he puesto sus detalles ya que es lo único que se va a ver, pero también me he pasado con cosas pequeñas que luego se van a ver de lejos. También como digo es mi primer juego en 3D por lo que también estoy experimentando con ello.
EDIT!!
Bueno contesto ya en ingles para que lo puedan entender todos ya que voy a pedir ayuda con una cosa. Muchas gracias de nuevo Mel.
Hi everyone. I check all the things Mel told me about (window size, 32 bit color mode, checking the storage of the mesh, etc). But all this failed, so I check the thing I belived since the start of the problem that it would be the problem, the .obj mesh.
As I said I'm new in 3D, and I only know a little of 3Ds max, so all the different formats of mesh is a new world for me. First I tried to get plugins to 3dsmax for exporting to other models. I get the ogremax exporter, because I saw irrlicht is compatible with the .mesh format, but it can't load the mesh I exported. Then I get another plug-in to export to .x format, but the result was a disaster, I have many little objects and in this format I get all this objects like if they all are situated in (0,0,0) coordinates.
So I was checking the b3d format. I didn't found nothing for 3dsmax2010 but I get a demo of fragMOTION that exports and imports many mesh formats. I load in this program the .obj original, and export in b3d format.
MAGIC!! with the b3d i'm getting now 70-90 fps with the same tris and the same textures.
The problem I have now is this program is a demo for 20 days (it's a commercial program, 50$ the complete version :S). So do you know another free program that do the same?
Also I only know how to use 3dsmax, but I can try Maya or Blender, anyone of this editors loads the .obj and export to b3d???
Thanks for all.
Gracias por contestar, ahora mismo voy a probar todo lo que me has puesto a ver si consigo que mejore esto. Las texturas si sabia que tenían que estar en potencia de 2, al principio era una de 1024x1024 y las otras de 512x512 pero vamos que las pase todas a 256x256 y la cosa seguía igual.
Y oye que al principio eran 65000 polígonos XD, le he puesto sus detalles ya que es lo único que se va a ver, pero también me he pasado con cosas pequeñas que luego se van a ver de lejos. También como digo es mi primer juego en 3D por lo que también estoy experimentando con ello.
EDIT!!
Bueno contesto ya en ingles para que lo puedan entender todos ya que voy a pedir ayuda con una cosa. Muchas gracias de nuevo Mel.
Hi everyone. I check all the things Mel told me about (window size, 32 bit color mode, checking the storage of the mesh, etc). But all this failed, so I check the thing I belived since the start of the problem that it would be the problem, the .obj mesh.
As I said I'm new in 3D, and I only know a little of 3Ds max, so all the different formats of mesh is a new world for me. First I tried to get plugins to 3dsmax for exporting to other models. I get the ogremax exporter, because I saw irrlicht is compatible with the .mesh format, but it can't load the mesh I exported. Then I get another plug-in to export to .x format, but the result was a disaster, I have many little objects and in this format I get all this objects like if they all are situated in (0,0,0) coordinates.
So I was checking the b3d format. I didn't found nothing for 3dsmax2010 but I get a demo of fragMOTION that exports and imports many mesh formats. I load in this program the .obj original, and export in b3d format.
MAGIC!! with the b3d i'm getting now 70-90 fps with the same tris and the same textures.
The problem I have now is this program is a demo for 20 days (it's a commercial program, 50$ the complete version :S). So do you know another free program that do the same?
Also I only know how to use 3dsmax, but I can try Maya or Blender, anyone of this editors loads the .obj and export to b3d???
Thanks for all.
Last edited by Monio666 on Sat Nov 20, 2010 7:44 pm, edited 3 times in total.
blender can do just that (imports .obj and exports .b3d using plugin).... for older 2.49 version. for version 2.5 i'm not sure whether there is a fully compatible plugin for .b3d yet.
hola como estas... err i don't speak spanish
hola como estas... err i don't speak spanish
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com

