| | |
- RenderMode
-
- OpaqueRenderMode
- SelectRenderMode
- TransparentRenderMode
class OpaqueRenderMode(RenderMode) |
| |
Basic opaque geometry rendering |
| |
- Draw(self, client) from RenderMode
- Render(self, client) from RenderMode
- RenderSetup(self, client)
- Extends RenderMode's functionality by creating a new RenderPass object
- RenderShutdown(self, client) from RenderMode
- SetupBindables(self, client) from RenderMode
- SetupDisplay(self, client) from RenderMode
- __call__(self, client) from RenderMode
- doCache(self, client)
- Caches matrix values within the RenderPass object, suppresses redraw
- shouldDraw(self, client)
- Checks the client's shouldRedraw() value, then calls suppressRedraw
|
class RenderMode |
| |
Abstract Base class for all rendering modes. |
| |
- Draw(self, client)
- Basic drawing algorithm
Resets model view matrix,
calls RenderSetup
calls doCache
calls Render
calls RenderShutdown
- Render(self, client)
- Do the actual rendering of the scene,
by default, simply defer to the client
- RenderSetup(self, client)
- Set up the context for rendering prior to scene rendering
- RenderShutdown(self, client)
- Customization point for cleanup of the context after a rendering pass
The default implementation does nothing.
- SetupBindables(self, client)
- Basic implementation of "bindable" setup procedure
This implementation calls:
Context.Viewpoint
Context.Background
Context.Lights
This is a customization point for those wishing to
introduce new set up calls before their rendering loop,
such as "fog", special effects etc.
- SetupDisplay(self, client)
- Establishes rendering parameters for context's rendering pass
If the client has an attribute SetupDisplay, we will defer to that
method.
- __call__(self, client)
- Primary external API, the client is the Context instance
which is being drawn to by the rendering mode.
- doCache(self, client)
- Cache any values for post-setup work
- shouldDraw(self, client)
- Test whether this pass should be performed,
This implementation just returns 1, subclasses
should return an intelligent value
|
class SelectRenderMode(RenderMode) |
| |
glSelectBuffer-based selection rendering mode |
| |
- Draw(self, client) from RenderMode
- Render(self, client) from RenderMode
- RenderSetup(self, client)
- Set up the selection buffer, and the pick matrix.
- RenderShutdown(self, client)
- Stores the name stack for the processing loop
- SetupBindables(self, client) from RenderMode
- SetupDisplay(self, client) from RenderMode
- __call__(self, client)
- Renders the scene once for each distinct x,y pickPoint
in the list of client.currentPass.getPickEvents() events.
Calls client.ProcessEvent for each event.
Note: there is currently no machinery for assuring that events
arrive in their original sequence
Note: events with identical type, key pairs will also be lost
due to the way the RenderPass object stores the pickEvents.
- doCache(self, client) from RenderMode
- shouldDraw(self, client)
- Only draw if there are picking events pending
|
class TransparentRenderMode(RenderMode) |
| |
Blend-based transparent/translucent geometry rendering |
| |
- Draw(self, client) from RenderMode
- Render(self, client)
- Unlike other rendering modes, this mode does not defer
to the client's rendering mode. Instead, it iterates through
the client.currentPass.getTransparent() list. That list
is populated through calls to Context.addTransparentObject( object)
and each object so-added should provide a Render( mode ) method.
- RenderSetup(self, client) from RenderMode
- RenderShutdown(self, client)
- Disables the transparency rendering parameters
Clears the list of transparent objects.
- SetupBindables(self, client) from RenderMode
- SetupDisplay(self, client)
- Defers to the client's SetupDisplay if available,
Otherwise initializes a fairly standard set of
transparent rendering parameters.
- __call__(self, client) from RenderMode
- doCache(self, client) from RenderMode
- shouldDraw(self, client)
- Checks to see if there are registered transparent objects
| |