Skip to content

Commit

Permalink
#2224 Fix bug where the clipRect would be left in the openGL state le…
Browse files Browse the repository at this point in the history
…ading to surprising (clipped) results when later using GLRenderer#copyFrameBuffer (#2225)
  • Loading branch information
richardTingle authored Mar 30, 2024
1 parent 1332547 commit 7d5a10b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,12 @@ public void renderViewPort(ViewPort vp, float tpf) {
// clear any remaining spatials that were not rendered.
clearQueue(vp);

/*
* the call to setCamera will indirectly cause a clipRect to be set, must be cleared to avoid surprising results
* if renderer#copyFrameBuffer is used later
*/
renderer.clearClipRect();

if (prof != null) {
prof.vpStep(VpStep.EndRender, vp, null);
}
Expand Down Expand Up @@ -1344,8 +1350,7 @@ public void setRenderFilter(Predicate<Geometry> filter) {
/**
* Returns the render filter that the RenderManager is currently using
*
* @param filter
* the render filter
* @return the render filter
*/
public Predicate<Geometry> getRenderFilter() {
return renderFilter;
Expand Down

0 comments on commit 7d5a10b

Please sign in to comment.