Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Complicated hit buffer question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bint  
View profile  
 More options Jul 21 2012, 2:52 pm
Newsgroups: comp.graphics.api.opengl
From: Bint <b...@ign.com>
Date: Sat, 21 Jul 2012 13:52:12 -0500
Local: Sat, Jul 21 2012 2:52 pm
Subject: Complicated hit buffer question
Hello,

  I have an iphone app which uses OpenGL ES 1.x.  I detect hits on objects
by drawing vertex buffer objects into an offscreen hit buffer, where each
object's color is a different number.  Then I read the buffer location to
tell which object was hit.

I am adding the ability to have various 'layers' of objects, and each layer
has its own hit vertex buffer object with object 'colors' ranging from 1 to
the number of objects.

This works fine as long as I only detect hits on one layer at a time, but
there are occasions when I want to draw all the layers together and detect a
hit.  In that case, I would have an object with color '1' on each layer, and
I wouldn't be able to tell which was the chosen object.

I'm wondering if there is a way to do this without re-rendering all these
vertext buffer objects.  I was thinking maybe there was some way that I
could tell opengl to add a value to every color it drew.  Is that possible?

So then say layer 1 has 100 objects, I would draw it normally.  Then I would
draw layer two with a color offset of 100, where that value would be added
to every pixel.  Is there anything like that available?

I imagine not, because the color are probably treated by their rgb channels
anyway,so that addition wouldn't work.  Any other suggestions of a way to do
it without reconstructing my vbo's?

Thanks
B


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.