Skip to main content
gamedev.net
🔒 Locked

Fast picking, without rays

Started by kovacsp 2 replies 1k views
Original Post
kovacsp
kovacsp
Hi all, Currently I'm using an offscreen surface (I call it pick screen), that has the same resolution as my visible screen. I render every pickable object in it using some kind of ID as color. This way, I can pick every face of my objects, and can define special object in separate ID value areas. This is simple and great, but I think, that when I'm reading the picked element (that is, I read the pixel prom this buffer which is under the mouse cursor), the surface travels from videomem to the main mem through the AGP every time. Are you aware of any better solution, or at least some method for decreasing the memory consumption, thus the bandwidth requirement od this method? I think that picking by rays would be very-very problematic, since I don't want to check zillions of faces one by one, and using this solution, the Z buffer makes it easy to determine which object is the closest to me. Thanks for your answers in advance, Peter
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
Syranide
Syranide
I have in no way directly played with Direct3D or such... but I recall there being a tutorial for determining what vertice / object is under the mouse with an older MSDN.


OrenGL
OrenGL
Reading from the video memory every frame will slow things down.

You can use rays with some sort of bounding hierarchy so you can limit the triangles you test. For example you could use an Octtree to start and then bounding spheres for each object.
Don't shoot! I'm with the science team.....
Pipo DeClown
Pipo DeClown
1) Remove unseen meshes. (Octree or something)
2) Use low-poly meshes to check. (Less accurate but increases speed)

Topic Locked

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

Sign in to reply to this topic.