[SDL] Example Of "Ray Casting" With SDL1.2+OpenGL?
Jacob Ole Juul Kolding
dacobi at gmail.com
Mon May 2 19:09:43 PDT 2011
(Sorry accidentally hit send)
I use a pixel color selection buffer to perform mouse selection of objects.
And with a simple fragment shader that just sets fragment color to the
current object id in
an off-screen RenderBuffer/FrameBufferObject, this is close to free on a GTX
2011/5/2 Christian Leger <chrism.leger at gmail.com>
> On Mon, May 2, 2011 at 7:17 AM, Armin Ronacher <
> armin.ronacher at active-4.com> wrote:
>> On 5/1/11 8:53 PM, Christian Leger wrote:
>> > I'm curious to know what is this clipping you refer to. Using which
>> > algorithms? Which data structures? Are there examples of well-known
>> > technologies that proceed in the manner you refer to? Or papers or
>> > websites that explain this? I'm really curious, because after 5-6 years
>> > of learning about game engine technologies (admittedly I've stayed away
>> > from commercial-only engines), I've never heard of clipping as an
>> > all-encompassing, best approach for object-picking or line-of-sight
>> > computations.
>> I suppose it refers to the now deprecated OpenGL select mode support
>> thing. I think it worked by having a buffer that attaches a value to a
>> pixel and then doing a screen space -> world space transformation and
>> finding what pixel value was hat and then going from that value back to
>> the object in question.
>> That is still possible, but you will most likely have to use multiple
>> render targets in modern OpenGL for something similar.
> I've never even bothered to read the red book's section on picking, always
> assuming it was really outdated.
> My guess is, though I haven't performed benchmarks, that to render a scene,
> even a partial, skeletal one, in order to to decide if one object is visible
> to another (again, referring to entities with 'eyes' in a virtual world), is
> on the far side of excessive. If I'm wrong I've love to learn it.
> SDL mailing list
> SDL at lists.libsdl.org
"It is no measure of health to be well adjusted to a profoundly sick
society." - Krishnamurti
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL