OpenGLContext.passes._flat
Flat rendering passes (base implementation)
Functions
Classes
class FlatPass(
SGObserver
):
Flat rendering pass with a single function to render scenegraph
Uses structural scenegraph observations to allow the actual
rendering pass be a simple iteration over the paths known
to be active in the scenegraph.
Rendering Attributes:
- visible
- whether we are currently rendering a visible pass
- transparent
- whether we are currently doing a transparent pass
- lighting
- whether we currently are rendering a lit pass
- context
- context for which we are rendering
- cache
- cache of the context for which we are rendering
- projection
- projection matrix of current view platform
- modelView
- model-view matrix of current view platform
- viewport
- 4-component viewport definition for current context
- frustum
- viewing-frustum definition for current view platform
- MAX_LIGHTS
- queried maximum number of lights
passCount -- not used, always set to 0 for code that expects
a passCount to be available.
transform -- ignored, legacy code only
uniforms
frustumVisibilityFilter(
self
,
records
)
Filter records for visibility using frustum planes
This does per-object culling based on frustum lookups
rather than object query values. It should be fast
*if* the frustcullaccel module is available, if not
it will be dog-slow.
renderGeometry(
self
,
mvmatrix
)
Render geometry present in the given mvmatrix
Intended for use in e.g. setting up a light texture, this
operation *just* does a query to find the visible objects
and then passes them (all) to renderOpaque
renderTransparent(
self
,
toRender
)
Render the transparent geometry from toRender (in forward order)
class SGObserver(
object
):
Observer of a scenegraph that creates a flat set of paths
Uses dispatcher watches to observe any changes to the (rendering)
structure of a scenegraph and uses it to update an internal set
of paths for all renderable objects in the scenegraph.
__init__(
self
,
scene
,
contexts
)
Initialize the FlatPass for this scene and set of contexts
- scene
- the scenegraph to manage as a flattened hierarchy
- contexts
- set of (weakrefs to) contexts to be serviced, normally is a reference to Context.allContexts