General Information


For a list of all Renderer Pick functions and related topics, see Renderer Picking.

The semantics of renderer picking are identical to rendering except that during picking, primitives are hit tested instead of converted to pixels.

All primitives which are passed to the rendering pipeline (i.e., they are not made invisible by the invisibility filter and they are not culled by the current culling mode) are eligible for picking. Picking uses the geometric definition of primitives, so it is possible for hollow, empty and transparent fill areas to be picked. However, it is implementation-dependent whether rendering effects which increase the area of the primitive (such as linewidth) are considered.

Two types of hit test rendering and traversals are supported:

pick one -
returns, at most, one primitive which satisfies the pick criteria.

pick all -
returns all hit primitives which satisfy the pick criteria, up to the application-specified maximum number of hits.

For both types, the hit test which is performed on the primitives is controlled by the specified pick device type. The pick inclusion and pick exclusion filters control which primitives are to be tested.

Pick Method

For a list of all Renderer Pick functions and related topics, see Renderer Picking.

The pick method determines which "hit" primitives are picked. For pick one, PEXlib defines four standard pick methods:

PEXPickLast -
Returns the last "hit" primitive which satisfies the pick filter test.

PEXPickClosestZ -
Returns the "hit" primitive which has a z value closest to the front clipping plane and satisfies the pick filter test. If multiple primitives satisfy this criteria, some of them may be returned.

PEXPickVisibleAny -
Returns any "hit" primitive which is visible (after HLHSR) and satisfies the pick filter test.

PEXPickVisibleClosest - All "hit" primitives which are visible are selected. Of those selected, the one which is closest to the pick position and satisfies the pick filter test is returned. If you specify an NPC pick volume, then the pick position is the center of the volume.

The Z-buffer contents may not be preserved when using the visible pick methods. The visible pick methods only return primitives which would be visible in the pick aperture if they were rendered using the renderer's current HLHSR mode. For example, if the HLHSR mode is enabled, then the pick method PEXPickClosestZ may return a primitive which is occluded by another primitive which does not satisfy the pick filter test. However, the pick method PEXPickVisibleAny guarantees that the picked primitive is not occluded.

For pick all (multiple primitives may be picked), PEXlib defines two standard pick methods:

PEXPickAllAll -
Returns the primitives, up to the maximum number of hits, which lie within or intersect the hit box.

PEXPickAllVisible - Returns the primitives visible (after HLHSR), up to the maximum number of hits, and that lie within or intersect the hit box.

A "pick first" can be accomplished by specifying the maximum number of hits to be one.

To inquire the supported pick methods, invoke the PEXGetEnumTypeInfo function.

Pick Inclusion and Exclusion Filters

For a list of all Renderer Pick functions and related topics, see Renderer Picking.

The renderer's pick inclusion and exclusion filters specify the name sets to be used to filter primitives during picking. See Renderer Attributes. The pick functions only return primitives which are not excluded by the pick filter. pick one returns a primitive which most closely satisfies the pick criteria and also passes the pick filter test. A flag is returned from pick one functions to indicate whether a primitive which did not satisfy the pick filter was a better candidate with the specified pick method.

Pick Start Path

For a list of all Renderer Pick functions and related topics, see Renderer Picking.

In addition to pick device type and pick inclusion and exclusion filters, you can further control pick all by using the renderer's pick start path. The pick start path indicates where to begin the next pick all and is bound at the start of the pick all rendering or traversal.

Drawables Associated With Renderers

For a list of all Renderer Pick functions and related topics, see Renderer Picking.

If a drawable that is associated with a renderer is destroyed or resized while the renderer is performing an immediate mode pick one or pick all hit test, then the pick operation is terminated and the renderer state is set to PEXIdle. The implementation ignores all subsequent output and traversal requests to the renderer until the next PEXEndPickOne or PEXEndPickAll (whichever is appropriate) which returns a pick status of PEXAbortedPick along with an empty pick path.

If a drawable that is associated with a renderer is moved, exposed or occluded while the renderer is performing a pick one or pick all hit test, then the implementation continues to process output commands and requests using the new drawable attributes until the pick operation is explicitly or implicitly terminated.