Remm0021 / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

Scene preprocessing #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
During the course of rendering a scene graph, it must pass through several
stages where culling, sorting, updating and other operations take place.
A scene is rendered, by specifying a root node and a camera object, these
are used to produce visible output on the screen. The scene graph is a tree
structure, so it must be flattened first to get a list of meshes, these
meshes are checked to be inside the camera frustum, then they are put into
render queue buckets based on their queue bucket state (set inside spatial)
they are then sorted in each bucket, and then rendered one by one, setting
the proper material, transform, etc. 

In some cases it may be necessary to access this information during
rendering for various purposes. For example, shadowing must have access to
the render queue so that a shadow map can be rendered based on the current
state. It is much more efficient to access objects when they are already in
the render queue rather than acquiring this information from a scene graph.
Another use case is accurate motion blur, which must know the transform
delta for all objects to be rendered, so that a motion vector texture can
be produced and used to apply the motion blur. 

The engine must provide a means to access this information to allow
processes such as shadow effects and motion blur to operate efficiently.
This is to be known as scene pre-processing, where multiple listeners are
registered to receive and manipulate the scene before it is rendered.

Further details will be provided later.

Original issue reported on code.google.com by ShadowIs...@gmail.com on 11 Sep 2009 at 3:56

GoogleCodeExporter commented 8 years ago
Example interface that would support this functionality:

interface SceneProcessor {
    void preScene(Spatial scene, Camera cam, Renderer r);
    void preQueue(RenderQueue queue);
    void preRender(Geometry geom);
    void postRender(Geometry geom);
    void postAll(FrameBuffer fb);
}

Original comment by ShadowIs...@gmail.com on 20 Sep 2009 at 5:10

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 26 Feb 2010 at 4:46

GoogleCodeExporter commented 8 years ago

Original comment by e.so...@gmail.com on 25 Mar 2010 at 9:13