Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Color picking with hidden faces?

  1. #1
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    17

    Question Color picking with hidden faces?

    I searched and couldn't find anything on this topic.

    I would like to use color picking to select mesh faces, however I would also like to select all faces, including faces that might be hidden behind those faces.

    I understand that color picking only renders out solid colors, so it would be impossible to know if a face is hidden or not.

    Is there anything that can be done to get color picking to select hidden faces?

    I don't want to use ray-picking right now.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    Pick by colour only gives you the object cloest to the camera since there is only 1 colour stored; if you want all objects along a ray you need some sort of ray-picking or you need to render without a depth buffers and culling enabled and record all the colours that a fragment tried to render. This requires the use of atomics and chaining the fragments into a buffer (http://www.geeks3d.com/20120309/open...-of-fragments/) which is not available on all graphics cards.

  3. #3
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    17
    Quote Originally Posted by tonyo_au View Post
    Pick by colour only gives you the object cloest to the camera since there is only 1 colour stored; if you want all objects along a ray you need some sort of ray-picking or you need to render without a depth buffers and culling enabled and record all the colours that a fragment tried to render. This requires the use of atomics and chaining the fragments into a buffer (http://www.geeks3d.com/20120309/open...-of-fragments/) which is not available on all graphics cards.
    Thanks, I need to support at least OpenGL 2.0, so I wouldn't be able to use it.

    I did come up with a solution, but it's not very efficient.

    I would have to render the scene in multiple passes. For each pass, all selected faces would be removed from the rendering process, leaving behind the hidden faces. So, basically, just keep peeling back layers until there's nothing left.

    I haven't tried it, but it's probably very slow.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    786
    Relevant key words to search for could be "order independent transparency" and "depth peeling" - these have nothing to do with picking, but they handle the fact that multiple faces cover a fragment (in order to get the correct blending result), so you may borrow some ideas.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •