Advertisement

Why is ogl so slooooooow

Started by April 15, 2002 08:23 PM
3 comments, last by InfestedFurby 22 years, 10 months ago
On a pentium 90 that is but still...... heres the predicament i wanna write a simple network game i have 2 comps on a lan p90 windows/linux 24 ram noname video card 1mb no accel p650 windows 192 ram geforce2 32 mb now the gfx for the game are gonna be all 2d and i wanted to try opengl for the projects gfx (i already use it extensively for 3d things i make) the problem is... just drawing a few solid color quads on the screen (or simply doing nothing) runs at <10 fps on my p90 in 640x480 res 24 bit color i use double buffering i got the same framerate off of nehes basecode and my own basecode i wrote off the sdl library (for portability to linux) im just wondering how opengl software mode manages to be that slow..... do they just not care and therefore do a half assed job for that or am i doing something horribly wrong? heres my draw function if it helps void draw() { glClear(GL_COLOR_BUFFER_BIT); sdlwrap_projection_mode(PROJECTION_2D);// this is a funtion from my basecode... all it does it load a premade matrix (made with glOrtho) as the projection matrix glBegin(GL_QUADS); glColor3f(1.0,0.0,0.0); //4 vertices here glEnd(); SDL_GL_SwapBuffers();//switch the buffers sdl style (doing this with nehes windows code produces the same fps though) } ive only been using opengl for a few months so there might be a glMakeWorkWellOnCrapComputer(); or something thx in advance for any help - InfestedFurby ps. i have GL_DEPTH_TEST disabled cause i dont need it in 2d [edited by - InfestedFurby on April 15, 2002 9:26:44 PM]
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net
640x480 24bit *double* buffered on an 1mb video card ?! You can't even fit both buffers on the card at the same time. Your app is constantly swapping megabytes of data each frame over your slow bus/p90...

512x384x16 double buffered is the maximum such a card could do.

Edit: 600x400x16 could *perhaps* work.

[edited by - Yann L on April 15, 2002 9:49:42 PM]
Advertisement
also software anit gonna be fast (esp not on a p90)
every pixel has to go through a lot of functions in the opengl pipeline eg (limited selection) alpha/stencil/depth test+ texturing blending etc etc

disable as much as possible
esp per pixel stuff eg texturing/blending etc

http://uk.geocities.com/sloppyturds/gotterdammerung.html
very simple fixes you wont like.

dont use 24bit mode, VERY few modern cards even support that mode in 2d, let alone 3d. stick to 16 or 32bit (but your game should run in both). 16bit is definatly the way to go on a p90. lower the res, 640x480 is too much data, try 320x240 or at least 512x384.

switch to the 2d portion of sdl (which uses directdraw on windows and svgalib/GGI/AAlib on linux). this will run MUCH faster (but you should still lower the resolution and switch to 16bit or 32bit as 24 bit is dead and not even support as a desktop resolution on geforce3).

you MUST disable ALL filtering/blending/zbuffer/anything that makes things look nice and is accelerated by video cards but will be slow when done using the cpu.

you basically have to decide.

1. reduce graphic effects to run on a p90 with no 3d card (and a quite pathetic video card). switching to 2d sdl stuff (since it is a 2d game anyway). this will GREATLY improve performence (in fact so much you will be amazed that you did not do this sooner).

2. get a voodoo2 card for the p90 (pretty sure that meets the min req). though not sure if sdl probally accelerates on a voodoo2 using opengl under linux. so some research on that before you start seraching for one to buy.

3. scrap the p90 and dont write a networking game. instead work on a single player game until you can find a friend (ie that lives by you and is someone you already know) willing to test the game with you.

4. write two versions of the graphics engine, the p90 versions usese the 2d sdl api while the p650 version uses the opengl sdl api.

in the end you are using the wrong api for the job. when writing a 2d game, you should use a 2d api unless you have proper 3d hardware that will give you an advantage over using just the 2d api.
well the reason i did 24bit is that my screwed up gfx card doesnt allow 16 bit

but i never thought of the size thing... ill make it run in a res that fits on the card

thanks guys
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net

This topic is closed to new replies.

Advertisement