Re: picking
Posted by
jmaasing on
Dec 26, 2013; 9:19am
URL: https://forum.jogamp.org/picking-tp4031052p4031062.html
ul wrote
Thanks,
Yes, the grapewine has it that OpenGL and Direct3D are feature equivalent, but the devil's in the details. I was wondering if anyone experienced in working with OpenGL shaders see any immediate problems with my approach. For example is there something similar to a Geometry shader which allows me to get hold of triangulated data? And can I output (pick) data back to the application from that shader?
I don't have experience in doing these advanced things so I can't give you specific pointers but as far as I know, yes, you certainly can do this. What you are looking for are probably tessellation shaders and transform feedback. There is a thing called geometry shaders in OpenGL that was introduced before tessellation shaders but aren't targeted to specific tessellation hardware so might not perform as good.
http://www.opengl.org/wiki/Tessellation_ShaderBut I guess I can see goussejs point, the usual approach is to keep the model of the world separate from the graphical presentation. Picking, physics simulation et c. are probably best done in the world model rather than picking against the graphical presentation. Still, use cases might be different so whatever works :)
I guess another thing that might be of interest is OpenCL, picking against a lot of spheres could probably be handled rather efficiently by compute shaders.
https://www.khronos.org/opencl/resources