Speedy models...how do they do it?

Started by
22 comments, last by Dark_Streak 21 years, 9 months ago
I am still having no luck, and I am still no closer to solving this mystery. Which is quite frankly beginning to really p*** me off, because what sort of game will it be if it struggles to display one model.

Anyway, I wont give up till it''s solved. Thanks to everyone who is trying to help me solve this.
Just to clear something up...I am drawing a terrain and a sky plane. I did not explain this before, some of you thought I was just drawing a model - this will explain why my framerate is lower , but it still does not explain why I am getting half the framerate when I draw my model.

I used glGetString(GL_VENDOR), glGetString(GL_VERSION) and glGetString(GL_RENDERER) and was told that I am using: NVIDIA Corporation V1.3.0 (Geforce 2 GTS/PCI/3DNOW!).
So I take it this means Im definately not in software mode.

In answer to Anonymous Poster: The texture I am using for the model is 256 * 256, as are most of my textures.

Here is my drawing code:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

g_Camera.Look();

setLights();

glEnable(GL_LIGHTING);
drawBaddy(10,vNewPos.y,10); // This is where I draw the model.

glPushMatrix();
glTranslatef(0,(vNewPos.y + 0.0001f),0);
glDisable(GL_LIGHT0);
glDrawShed();
glEnable(GL_LIGHT0);
glPopMatrix();

glDisable(GL_LIGHTING);
RenderHeightMap();
glEnable(GL_TEXTURE_2D); // terrain turns off texturing

glBindTexture(GL_TEXTURE_2D, g_Texture[3]);
RenderSkyPlane();

glDrawHUD();

SwapBuffers(g_hDC);

And thats it. In my initialisation code I do the following to load my model:

Load3ds.Import3DS(&g_3DModel, FILE_NAME); // Load my model
BuildBaddy(); // Draw into a display list.


Below is my function for calling the model display list.

void drawBaddy(float x, float y, float z)
{
glDisable(GL_FOG);
glPushMatrix();
glTranslatef(x, y, z);
glRotatef(shedRot,0,1,0);
glCallList(glBaddies);
glPopMatrix();
glEnable(GL_FOG);
}

Thanks guys. Hope you can see something I can''t
Advertisement
just a weird guess, what screen res are you running the app at?
(windowed ?)

cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states )
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
I am running the game at 800 * 600 with 16 bits per pixel.

Changing these values makes no significant difference. I can run it in windowed and fullscreen mode.

Also, I realise that the way I calculate FPS and display it to the window frame may not be the best way to check FPS, but this is irelevant because I notice a slight stutter when viewing the model in my scene, which implies the model is indeed incurring a performance hit. Why though?

On the point of using models, I would like to improve it. So, anyone know of any good tutorials helping people learn how to create models for games. I have seen lots of tutorials for 3D studio max, but they are all concerned with making nice scenes and special effects...and they dont seem to be bothered how many polygons their scenes will end up having. Fair enough, I guess as they wont be sticking what they have made into a game.

[edited by - Dark_Streak on June 28, 2002 5:07:00 PM]
There''s a great tutorial on modelling by Paul Steed here: Part 1 and Part 2. He assume you''re already familiar with MAX, so if that''s you, then this is good.

codeka.com - Just click it.

This topic is closed to new replies.

Advertisement