I studying the code in renderManager and have a question/suggestion…
This method is in renderManager. Would anything terrible happen if one change the call to flushQueue(vp) to renderViewPortQueues(vp, false) ? (change line 41 to 42) below.
[java]
public void renderViewPort(ViewPort vp, float tpf) {
if (!vp.isEnabled()) {
return;
}
List<SceneProcessor> processors = vp.getProcessors();
if (processors.isEmpty()) {
processors = null;
}
if (processors != null) {
for (SceneProcessor proc : processors) {
if (!proc.isInitialized()) {
proc.initialize(this, vp);
}
proc.preFrame(tpf);
}
}
renderer.setFrameBuffer(vp.getOutputFrameBuffer());
setCamera(vp.getCamera(), false);
if (vp.isClearDepth() || vp.isClearColor() || vp.isClearStencil()) {
if (vp.isClearColor()) {
renderer.setBackgroundColor(vp.getBackgroundColor());
}
renderer.clearBuffers(vp.isClearColor(),
vp.isClearDepth(),
vp.isClearStencil());
}
List<Spatial> scenes = vp.getScenes();
for (int i = scenes.size() - 1; i >= 0; i–) {
renderScene(scenes.get(i), vp);
}
if (processors != null) {
for (SceneProcessor proc : processors) {
proc.postQueue(vp.getQueue());
}
}
//flushQueue(vp);
renderViewPortQueues(vp, false);
if (processors != null) {
for (SceneProcessor proc : processors) {
proc.postFrame(vp.getOutputFrameBuffer());
}
}
//renders the translucent objects queue after processors have been rendered
renderTranslucentQueue(vp);
// clear any remaining spatials that were not rendered.
clearQueue(vp);
}
[/java]
This change would make the ViewPort RenderQueues available to SceneProcessor#postFrame method, which could become handy. For instance I think the implementation of the TranslucentBucketFilter would become much more straight forward, also I happen to need the the queues in the postFrame method ^^
Since the queues are cleared at the end of this methods anyways I can’t see any drawbacks, please enlighten me!
shameless self bump.
Just wanna know if this has any drawbacks…
As long as the clearQueue is called at the end of the method i guess it’s ok.
But i guess that on a design stand point queues are meant to be empty when calling postFrame.
What do you want to do exactly?