RM: per-pass render method
This commit is contained in:
parent
18db26292f
commit
ea4d750d52
@ -586,6 +586,37 @@ public class RenderManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderGeometryListNew(GeometryList gl) {
|
||||||
|
int size = gl.size();
|
||||||
|
int pass = 0;
|
||||||
|
|
||||||
|
// Keep rendering geometries in the list
|
||||||
|
// checking each time if they need more passes.
|
||||||
|
// Geometries which need more passes are added to the beginning
|
||||||
|
// of the list and then another pass is executed.
|
||||||
|
// In the end, all geometries will have their passes rendered.
|
||||||
|
while (true) {
|
||||||
|
int writeIdx = 0;
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
Geometry obj = gl.get(i);
|
||||||
|
renderGeometry(obj);
|
||||||
|
boolean morePasses = true;
|
||||||
|
if (morePasses) {
|
||||||
|
// Geometry wants to be rendered again.
|
||||||
|
// Move it to the beginning of the list.
|
||||||
|
gl.set(writeIdx++, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// No geometries were written to the beginning of the list -
|
||||||
|
// all passes are finished.
|
||||||
|
if (writeIdx == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pass++;
|
||||||
|
size = writeIdx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preloads a scene for rendering.
|
* Preloads a scene for rendering.
|
||||||
* <p>
|
* <p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user