|
|
|
@ -77,6 +77,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { |
|
|
|
|
private int originalHeight; |
|
|
|
|
private int lastFilterIndex = -1; |
|
|
|
|
private boolean cameraInit = false; |
|
|
|
|
private boolean clearColor= true; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Create a FilterProcessor |
|
|
|
@ -99,7 +100,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { |
|
|
|
|
*/ |
|
|
|
|
public void addFilter(Filter filter) { |
|
|
|
|
if (filter == null) { |
|
|
|
|
throw new IllegalArgumentException( "Filter cannot be null." ); |
|
|
|
|
throw new IllegalArgumentException("Filter cannot be null."); |
|
|
|
|
} |
|
|
|
|
filters.add(filter); |
|
|
|
|
|
|
|
|
@ -117,7 +118,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { |
|
|
|
|
*/ |
|
|
|
|
public void removeFilter(Filter filter) { |
|
|
|
|
if (filter == null) { |
|
|
|
|
throw new IllegalArgumentException( "Filter cannot be null." ); |
|
|
|
|
throw new IllegalArgumentException("Filter cannot be null."); |
|
|
|
|
} |
|
|
|
|
filters.remove(filter); |
|
|
|
|
filter.cleanup(renderer); |
|
|
|
@ -196,7 +197,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable { |
|
|
|
|
|
|
|
|
|
renderManager.setCamera(filterCam, true); |
|
|
|
|
r.setFrameBuffer(buff); |
|
|
|
|
r.clearBuffers(false, true, true); |
|
|
|
|
r.clearBuffers(clearColor, true, true); |
|
|
|
|
renderManager.renderGeometry(fsQuad); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -392,6 +393,16 @@ public class FilterPostProcessor implements SceneProcessor, Savable { |
|
|
|
|
height = (int) (h * (Math.abs(bottom - top))); |
|
|
|
|
width = Math.max(1, width); |
|
|
|
|
height = Math.max(1, height); |
|
|
|
|
|
|
|
|
|
//Testing original versus actual viewport dimension.
|
|
|
|
|
//If they are different we are in a multiview situation and color from other view port must not be cleared.
|
|
|
|
|
//However, not clearing the color can cause issues when AlphaToCoverage is active on the renderer.
|
|
|
|
|
if(originalWidth!=width || originalHeight!=height){ |
|
|
|
|
clearColor = false; |
|
|
|
|
}else{ |
|
|
|
|
clearColor = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cam.resize(width, height, false); |
|
|
|
|
cameraInit = true; |
|
|
|
|
computeDepth = false; |
|
|
|
|