diff --git a/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java b/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java index 10afa47da..90b50a3a9 100644 --- a/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java @@ -44,6 +44,7 @@ import com.jme3.renderer.ViewPort; import com.jme3.renderer.queue.RenderQueue; import com.jme3.system.JmeSystem; import com.jme3.texture.FrameBuffer; +import com.jme3.texture.Image; import com.jme3.util.BufferUtils; import java.io.File; import java.io.FileOutputStream; @@ -229,7 +230,7 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen int viewHeight = (int) ((curCamera.getViewPortTop() - curCamera.getViewPortBottom()) * curCamera.getHeight()); renderer.setViewPort(0, 0, width, height); - renderer.readFrameBuffer(out, outBuf); + renderer.readFrameBufferWithFormat(out, outBuf, Image.Format.BGRA8); renderer.setViewPort(viewX, viewY, viewWidth, viewHeight); File file; diff --git a/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java b/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java index 85c8cb7f6..9466b4a50 100644 --- a/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java +++ b/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java @@ -40,6 +40,7 @@ import com.jme3.renderer.ViewPort; import com.jme3.renderer.queue.RenderQueue; import com.jme3.system.Timer; import com.jme3.texture.FrameBuffer; +import com.jme3.texture.Image; import com.jme3.util.BufferUtils; import com.jme3.util.Screenshots; import java.awt.image.BufferedImage; @@ -228,7 +229,7 @@ public class VideoRecorderAppState extends AbstractAppState { final WorkItem item = freeItems.take(); usedItems.add(item); item.buffer.clear(); - renderer.readFrameBuffer(out, item.buffer); + renderer.readFrameBufferWithFormat(out, item.buffer, Image.Format.BGRA8); executor.submit(new Callable() { public Void call() throws Exception { diff --git a/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java b/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java index c09d684ff..1bdc1926e 100644 --- a/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java +++ b/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java @@ -155,7 +155,7 @@ public class AwtPanel extends Canvas implements SceneProcessor { public void repaintInThread(){ // Convert screenshot. byteBuf.clear(); - rm.getRenderer().readFrameBuffer(fb, byteBuf); + rm.getRenderer().readFrameBufferWithFormat(fb, byteBuf,Format.BGRA8); synchronized (lock){ // All operations on img must be synchronized @@ -168,7 +168,7 @@ public class AwtPanel extends Canvas implements SceneProcessor { public void drawFrameInThread(){ // Convert screenshot. byteBuf.clear(); - rm.getRenderer().readFrameBuffer(fb, byteBuf); + rm.getRenderer().readFrameBufferWithFormat(fb, byteBuf,Format.BGRA8); Screenshots.convertScreenShot2(intBuf, img); synchronized (lock){ diff --git a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java index 550a68949..b8d0f40d4 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java +++ b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java @@ -48,6 +48,7 @@ import com.jme3.scene.shape.Box; import com.jme3.system.AppSettings; import com.jme3.system.JmeContext.Type; import com.jme3.texture.FrameBuffer; +import com.jme3.texture.Image; import com.jme3.texture.Image.Format; import com.jme3.texture.Texture2D; import com.jme3.util.BufferUtils; @@ -158,7 +159,7 @@ public class TestRenderToMemory extends SimpleApplication implements SceneProces public void updateImageContents(){ cpuBuf.clear(); - renderer.readFrameBuffer(offBuffer, cpuBuf); + renderer.readFrameBufferWithFormat(offBuffer, cpuBuf, Image.Format.BGRA8); synchronized (image) { Screenshots.convertScreenShot(cpuBuf, image);