Skip to content

Commit

Permalink
add debug groups for shadow draw calls (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trass3r authored Oct 27, 2023
1 parent d89e379 commit b86310b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -967,19 +967,15 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) {
if (prof != null) {
prof.vpStep(VpStep.RenderBucket, vp, Bucket.Opaque);
}
this.renderer.pushDebugGroup(Bucket.Opaque.name());
rq.renderQueue(Bucket.Opaque, this, cam, flush);
this.renderer.popDebugGroup();

// render the sky, with depth range set to the farthest
if (!rq.isQueueEmpty(Bucket.Sky)) {
if (prof != null) {
prof.vpStep(VpStep.RenderBucket, vp, Bucket.Sky);
}
renderer.setDepthRange(1, 1);
this.renderer.pushDebugGroup(Bucket.Sky.name());
rq.renderQueue(Bucket.Sky, this, cam, flush);
this.renderer.popDebugGroup();
depthRangeChanged = true;
}

Expand All @@ -995,9 +991,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) {
renderer.setDepthRange(0, 1);
depthRangeChanged = false;
}
this.renderer.pushDebugGroup(Bucket.Transparent.name());
rq.renderQueue(Bucket.Transparent, this, cam, flush);
this.renderer.popDebugGroup();
}

if (!rq.isQueueEmpty(Bucket.Gui)) {
Expand All @@ -1006,9 +1000,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) {
}
renderer.setDepthRange(0, 0);
setCamera(cam, true);
this.renderer.pushDebugGroup(Bucket.Gui.name());
rq.renderQueue(Bucket.Gui, this, cam, flush);
this.renderer.popDebugGroup();
setCamera(cam, false);
depthRangeChanged = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ private void renderGeometryList(GeometryList list, RenderManager rm, Camera cam,
}

public void renderShadowQueue(GeometryList list, RenderManager rm, Camera cam, boolean clear) {
rm.getRenderer().pushDebugGroup("ShadowQueue");
renderGeometryList(list, rm, cam, clear);
rm.getRenderer().popDebugGroup();
}

public boolean isQueueEmpty(Bucket bucket) {
Expand All @@ -304,6 +306,7 @@ public void renderQueue(Bucket bucket, RenderManager rm, Camera cam) {
}

public void renderQueue(Bucket bucket, RenderManager rm, Camera cam, boolean clear) {
rm.getRenderer().pushDebugGroup(bucket.name());
switch (bucket) {
case Gui:
renderGeometryList(guiList, rm, cam, clear);
Expand All @@ -324,6 +327,7 @@ public void renderQueue(Bucket bucket, RenderManager rm, Camera cam, boolean cle
default:
throw new UnsupportedOperationException("Unsupported bucket type: " + bucket);
}
rm.getRenderer().popDebugGroup();
}

public void clear() {
Expand Down

0 comments on commit b86310b

Please sign in to comment.