Advertisement

my opengl app is REALLY slow

Started by April 04, 2002 04:37 PM
21 comments, last by feroCT5 22 years, 10 months ago
You wanted my pixelformat code?

here it is:


  with pfd do    //Tells Windows How We Want Things To Be  begin    nSize:= SizeOf( PIXELFORMATDESCRIPTOR ); // Size Of This Pixel Format Descriptor    nVersion:= 1;                            // Version Number (?)    dwFlags:= PFD_DRAW_TO_WINDOW             // Format Must Support Window      or PFD_SUPPORT_OPENGL                  // Format Must Support OpenGL      or PFD_DOUBLEBUFFER;                   // Must Support Double Buffering    iPixelType:= PFD_TYPE_RGBA;              // Request An RGBA Format    cColorBits:= 16;                         // Select Our Color Depth    cRedBits:= 0;                            // Color Bits Ignored    cRedShift:= 0;    cGreenBits:= 0;    cBlueBits:= 0;    cBlueShift:= 0;    cAlphaBits:= 0;                          // No Alpha Buffer    cAlphaShift:= 0;                         // Shift Bit Ignored    cAccumBits:= 0;                          // No Accumulation Buffer    cAccumRedBits:= 0;                       // Accumulation Bits Ignored    cAccumGreenBits:= 0;    cAccumBlueBits:= 0;    cAccumAlphaBits:= 0;    cDepthBits:= 32;                         // 16Bit Z-Buffer (Depth Buffer)    cStencilBits:= 0;                        // No Stencil Buffer    cAuxBuffers:= 0;                         // No Auxiliary Buffer    iLayerType:= PFD_MAIN_PLANE;             // Main Drawing Layer    bReserved:= 0;                           // Reserved    dwLayerMask:= 0;                         // Layer Masks Ignored    dwVisibleMask:= 0;    dwDamageMask:= 0;  end;end;  


-- Andy aka feroCT5

[edited by - feroCT5 on April 5, 2002 3:24:09 PM]
32bit zbuffer wit 16bit colormode..

try with 16 on both or 32color, 24depth and 8stencil, or 32,24,0 or others

but no 32bit zbuffer, i think it isn''t supported at all more than 24bits for gf2
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Advertisement
hm,

i never paid attention to the pixelformat stuff - but setting it up to values making more sense didn''t affect my framerate!

i checked the GL_RENDERER (it is in both cases hardware: GeForce 3 Ti200 or GeForce 2 MX). i set up the pixelformat. the framerate on the GF3 machine is about 100 fps - the framerate on the GF2 machine is 19 fps (!). the drivers are the latest (nvidia detonator 28.32). ok, on the GF3 machine, i''m using win xp pro - but is it really five times faster than win 98 se?!

i''ll now post my InitGL() source code - perhaps some of you will see the mistake i made...

(keep in mind: it''s delphi!)


  function InitGL: Bool;	// All Setup For OpenGL Goes Herebegin  LoadGLTextures();  glEnable(GL_TEXTURE_2D); // Enable Texture Mapping  glBlendFunc(GL_SRC_ALPHA,GL_ONE);    glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading  glClearColor(0,0,0,0); // Black Background  glClearDepth(1.0); // Depth Buffer Setup  glDepthFunc(GL_LESS); // The Type Of Depth Test To Do  glEnable(GL_DEPTH_TEST); // Enables Depth Testing  glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST); // Realy Nice perspective calculations  glMatrixMode(GL_MODELVIEW);  glLightfv(GL_LIGHT1, GL_AMBIENT, @LightAmbient);  glEnable(GL_LIGHT1);  glLightfv(GL_LIGHT2, GL_DIFFUSE, @LightDiffuse);  glLightfv(GL_LIGHT2, GL_POSITION, @LightPosition);  glEnable(GL_LIGHT2);  glEnable(GL_LIGHTING);//  ShowMessage(glGetString(GL_RENDERER));  initGL:=true;end;  


i really don''t know what to do - it can''t be that 180 polygons and 3 mb of uncompressed textures is too much for a gf2mx (32mb)...

please help me.....

thx -- Andy aka feroCT5
do you use highres mode and/or draw a lot of large triangles?
the 19->100fps difference might be fillrate issue. gf2mx fillrate is very low comparing to gf3 fillrate, which is 3 times as large for ge2mx400 vs ge3ti200 and 5 times if you own the ge2mx 200. So this can be an explanation for your problem
With best regards, Mirek Czerwiñski
i draw about 180 quads, my viewport is 480*480 pixels - it''s a kind of 3d-monopoly and these quads are the street fields the players walk on. the coord range is -9.76 to +9.76 (x/y) and 0 to 24 (z), but 24 is just the position of the camera. the size of the board is 19.52*19.52*0.2 (x*y*z). texture size is (mostly) 256*256 pixels (cut to 160*256). each street is a single texture.

click here or here to get a screenshot of my app (opens in a new window).

-- Andy aka feroCT5
quote:
Original post by feroCT5
ok, on the GF3 machine, i''m using win xp pro - but is it really five times faster than win 98 se?!



Actually, Win98 is slightly faster than WinXP!
But that should be no surprise at all...


Yesterday we still stood at the verge of the abyss,
today we''re a step onward!
Yesterday we still stood at the verge of the abyss,today we're a step onward! Don't klick me!!!
Advertisement
quote:
Original post by Vaporisator
Actually, Win98 is slightly faster than WinXP!


Out of interest, how do you measure the speed of an OS?

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
Yeah, Windows 98 runs great - until you try running more than one app at a time ...
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
The use of triangle strips is mostly faster than te use of quads. You must also test your engine at a system with a 3Dfx card becouse they have a stand-alone opengl player but not the standard opengl support. If the engine is really slow at 3Dfx cards then you must use glsetup, see www.glsetup.org
The use of triangle strips is mostly faster than te use of quads. You must also test your engine at a system with a 3Dfx card becouse they have a stand-alone opengl player but not the standard opengl support. If the engine is really slow at 3Dfx cards then you must use glsetup, see www.glsetup.org

This topic is closed to new replies.

Advertisement