0
\$\begingroup\$

I am writing an Oculus Rift application, I am rendering a very high poly mesh that I wish to be able to perform picking on using the Oculus Touch. Ideally, I want to be able to get the "triangle" id and other information attached to it.

Currently, I am using an OBB Tree and ray casting to perform picking on the CPU, It works perfectly, the problem is that even with OBB tree the picking process is slow. I thought I'd perform picking on the GPU by rendering the view (from the point of view of the Oculus Touch) to an FBO using a custom shader that outputs "triangle information" to the buffer and then use glReadPixels to read the central pixel data. The problem I am facing is that the Oculus does distortion to my on-screen scene but there is no way to apply it to the off-screen buffer, so there is significant difference between the on-screen buffer and the off-screen buffer.

My question is, Is ray casting the only feasible way to do picking in Oculus Apps or is there a way to perform the faster FBO picking even when the view distorted?

\$\endgroup\$
0
\$\begingroup\$

Okay, I found a way to solve this problem. It is less than idle but it reduces the amount of processing done on the CPU by a lot.

My problem is that I cannot just pick the middle pixel from the FBO to get my picked items. So I went for an educated brute-force approach.

I tell my picking shader to discard all non-hits (pixels that are outside my Oculus touch pointer) and instead of picking the middle point of the FBO I would just search the whole FBO for hits and if intelligently pick the region to look I can get away with a lot less than doing an Octree search.

The following image show my "solution". On the left is what is rendered to the Oculus, and on the right is the view from the point of view of the right hand touch controller.

Left is what is rendered to the Oculus, Right is the view from the point of view of the right hand touch controller

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.