Jump to content

Lag in CameraPick


Gilmer
 Share

Recommended Posts

Hello,

 

I'm using CameraPick, everything is working OK, but I noticed that the first Pick it takes longer, even causes a stop in fps, which can be?

 

// Game loop
while( !KeyHit() && !AppTerminate() )
{
if( !AppSuspended() ) // We are not in focus!
{

// Faz um pick e pega a entidade e altera de cor
if (MouseHit(1))
{

if ( CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),100)))
{
EntityColor(pick.entity,Vec4(1,0,0,0));
}
}


// Update timing and world
UpdateAppTime();
UpdateWorld(AppSpeed()) ;

// Render
UpdateFramework();
RenderFramework();

//DrawText(10,10,"FPS: %f",FPS());

Flip(0);
}
}

Link to comment
Share on other sites

;) hehe... if the first pick is on a high polygon object it will do that... if its a static mesh, then you can use the GMF processor on it, and it appears to help a little... if its a animated mesh, youre screwed... Ive gotten around it by causing the camera to do a pick on the high polygon animated mesh while the game is starting...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Yep, this is a known problem or side effect. It's due to the creation of an internal data structure in the engine. Current work around is to pick everything once prior to starting the game. Not great I know!

 

lol looks like two people beat me to it ;)

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...