Looking at converting to using RenderPass. My game implementation was created back in October so its knows nothing about RenderPass or PassManagers. This is the first time if delved into passes
Can someone please confirm if the the following is accurate about passes.
Spatials are attached to passes. The spatial is also attached to the scenegraph
The spatial attached to the pass is rendered using the pass
All children of the spatial inherit the pass
Any spatials in the scenegraph are always rendered by the DisplaySystem Renderer first ( unless ondraw of the spatial is overridden )
The pass is the last render operation within a frame
A pass can contain many spatials
A pass manager simply holds current passes and calls the method renderPasses and updatePasses when instructed to do so
q1. There is an update method in Pass, but havent seen an implementation of it in the demos. What treats can be done here ? fade …
q2. If the spatial is culled, are any checks required in the pass to avoid rendering a culled spatial
it's much simpler than that. i the "traditional" scene you would have a root node wich you would render by calling the renderer's draw() method.
when using the pass system, you add the nodes(usually the scene root) you want to render to the pass, an let the pass render them. depending on you app, you can use one or more render passes (see BasicPassManager). so for example if you want to have a scene where some objects are rendered "normally" and soem other objects are rendered with an outline, you would create a RenderPass and an OutlinePass and add them to the pass manager. then you would add the "normal" rendered Nodes to the RenderPass. the Nodes ones you want to be outlined have to be added to the OutlinePass.
in the app's update method you would only have to update the pass manager.
so:
partially true: spatials are added to the render pass, but the same spatials would usually be the scene (or a part of it)
true
i suppose you mean that the hierarchy of a spatial added to a pas is rendered by the same pass. if that's what you mean, then it's true.
false: the pass decides how the spatials are rendered and how they are rendered.
i'm not sure what you mean. usually if you use the pass system, then the passes are the only render operations.
true
true
q1. i suppose that method is there in case the pass needs to do some update operations before or after it is rendered. i'm not sure tough.
q2. i suppose it depends on what pass you use. usually the passes should be implemented so they consider such things. but for example think of the shadow pass: if an object is out of view (culled) you might still want to see if its shadow hast to be rendered. but i don't really took a close look at the shadow passes, so i'm actually only speculating
btw: if i did any mistakes in the explanations above, please correct me. if the above is at leat partially correct, then it could be added to the wiki after reformulating it (then at least something would be in there)