PDA

View Full Version : Picking Slowdown in Fullscreen Mode?!



Heaven
02-09-2002, 01:08 AM
Hi there. This is weird. I'm trying to get picking working using the GL_SELECT rendermode. When I'm in fullscreen mode, each pick takes like 1 full second to process. When I'm in windowed mode it works fine, with no noticable slowdown!

I'm working on a Voodoo 3 Velocity 100 (8 Mb), but why in the world would windowed picking be faster than fullscreen?

if (mouse.rbutton)
{
glSelectBuffer (32, selectBuf);
glRenderMode(GL_SELECT);

glInitNames();
glPushName(0);

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();

gluPickMatrix((GLdouble)mouse.x,(GLdouble)screenHe ight-((GLdouble)mouse.y),1.0,1.0,viewport);

double z=cam.range;
double v=z/1.33333333333333333;
glOrtho(-z,z,-v,v,1,100);

glMatrixMode(GL_MODELVIEW);
map.drawTerrain2(0,0,0);

glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);

hits = glRenderMode(GL_RENDER);
}

First I init the selection buffer. Then I set up my view volume to an area right around the cursor. drawTerrain2 is the same func I use to render my heightmapped tiles, but when picking I only draw the column of tiles the mouse cursor is on. Finally I get my old projection back and find the number of hits.

Again, when I'm windowed I can hold the right mouse button down and drag it around the screen and the selected tile gets highlighted fine, in realtime.

When I do this in fullscreen each pick takes 1 second! My fps actually drops to 1 or less!

Help!

Thanks in advance for any suggestions.

Care,
Chris
Florida, USA
RTS Engine in Development http://www.knology.net/~heaven/rts.htm

Heaven
02-11-2002, 08:02 AM
After reloading the latest drivers (by way of the GLSETUP program) I now get an illegal operation and my engine crashes to the desktop in fullscreen mode when I right click.

Geesh.

When I do a glString(GL_RENDERER) it shows as:
Voodoo 1/2 Banshee/1 TMU/8 MB

It wouldn't be so bad, except when I try to rerun the thing (after recompiling a change) it tells me it can't activate a rendering context. I.e., I have to restart my computer.

Anybody got any ideas?

Thanks in advance,
Chris
Florida, USA
RTS in Development http://www.knology.net/~heaven/rts.htm

MButchers
02-12-2002, 08:36 AM
Hello there,

I recently did a simular engine to yours but
abandoned it in preference for another engine
as it didnt quite suite the game I am working
on.

function TISOEngine.ViewToWorld(X,Y: Single): TVector3f;
var
sXNear,sYNear,sZNear: GLdouble;
sXFar,sYFar,sZFar: GLdouble;
sRealY: GLdouble;
vResult: TVector3f;
vDepth: GLfloat;
begin
sRealY := mViewport[3] - Round(Y) -1;

glReadPixels(Round(X),Round(sRealY),1,1,GL_DEPTH_C OMPONENT,GL_FLOAT,@vDepth);
gluUnProject(X,sRealY,vDepth,@mModel,@mProj,@mView port,sXNear,sYNear,sZNear);
Result := Vector3f(sXNear,sYNear,sZNear);
end;


its not the answer to the why your problem
happens, but you may be able to use it
instead.

Hope it helps

Mark.

Heaven
02-12-2002, 09:33 PM
Well. I tried several different driver versions for the Voodoo3 and finally, using 3dfx beta 1.07 drivers dated 1-15-2001 (actually shows up in game as 1-16-01), fullscreen picking works at full throttle.

Praise the God of Abraham, Isaac, and Jacob!

Unfortunately, and no doubt needlessly, I got so frustrated I ended up reinstalling Win95 two times. Man what a waste of time.

Take care,
Chris
Florida, USA