Skip to main content
GameDev.net gamedev.net
🔒 Locked

Does Select respect Framebuffer tests

Started by vbbartlett Mar 21, 2005 at 1:13 PM 0 replies 900+ views
Original Post
vbbartlett
vbbartlett
Specifically does the selection in Opengl respect the stencil buffer? If so is there a specific way to make this occur? I have the stencil buffer working in that it limits the drawing of a basic scene (it has 3 lines, 1 fully enclose in the stencil, 1 partially enclosed, and 1 outside the stencil) This then displays 3 lines when the stencil is off and 2 lines, one a full line and the second a partial when the stencil is active. Now I use the select mode but am returned all three lines' ids...
Brother Bob
Brother Bob
The selection test is purely a geometrical test. The objects are transformed into clip space, and if the object intersects the view volume, a hit is recorded. No fragments involved.

If you need the stencil buffer to affect the hit test, you need another method absed on fragments. Color based selection for example. Draw each object with it's own color, read back the color under the mouse, and map the color to an object. This can be done in the back buffer, so nothing involved in this selection test have to show up on the screen.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.