Login  Register

Re: picking

Posted by jmaasing on Dec 29, 2013; 8:55am
URL: https://forum.jogamp.org/picking-tp4031052p4031076.html

gouessej wrote
I'm not stuck in an old thinking, I just say that shader based picking is only worth in a fully shader based architecture. Moving an operation into a shader doesn't drive it magically faster. JMonkeyEngine 3 has a fully shader based renderer and it does NOT use shaders for the picking as far as I know.
I'm pretty sure jMonkeyEngine uses BIH-tree for scene graph picking (http://en.wikipedia.org/wiki/Bounding_interval_hierarchy) or if you use Bullet physics you usually do ray casts in that engine (http://bulletphysics.org/wordpress/).

Each time I enter a new job I find a new "private" scenegraph with some poorly implemented algorithms (with a very few exceptions) :s
Nothing wrong with writing a poorly implemented scene graph, I've done it many times

To the OP, we are derailing this topic because the original question (i.e. is it possible in OpenGL) is I think answered with yes. The thing is there are a lot of engines available with OpenGL based graphics and there is a lot to learn by comparing how they do things. If what you learn is best-practice or old-set-ways-of-thinking is up for debate.

The engines I know use ray casts to do picking. I think the reason is that ray casts are so useful for all sorts of things that they all have pretty optimized ray casts, and then picking is just another application of a really fast ray cast.