Skip to main content
gamedev.net
🔒 Locked

Picking Performance

Started by Phoresis 3 replies 550+ views
Original Post
Phoresis
Phoresis
Would it be completely stupid to call a picking algorithm everytime the user moves his mouse to work out what part of a shape the user's cursor is hovering over? Is there a massive performance hit doing it this way, or is it a viable option?
Sneftel
Sneftel
That depends on how efficient the picking algorithm is, and how much time you can allot to it. It's not an unreasonable thing to do.
Phoresis
Phoresis
Sorry, I should have been more specific. This is by rendering in selection mode, using a gluPickMatrix. Just to clarify.
CodeMunkie
CodeMunkie
In that case the performance will depend on how many vertices your card will have to transform and how many fragments it will have to rasterize since you effectively have to render your scene twice. As long as you do the obvious stuff like frustum culling, turn off textures, lighting and other unneeded states, and use a lower LOD mesh, you should be just fine with this method.
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
Sneftel
Sneftel
Also, consider only re-picking every 2-4 frames. The latency will generally be unnoticeable.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.