fixed inverted red and blue channels in OffScenePanel and ScenePreviewProcessor , has the default format of readFrameBuffer has been set to RGBA in jme core

experimental
Nehon 10 years ago
parent 384a60b118
commit 2007cd5543
  1. 2
      sdk/jme3-core/src/com/jme3/gde/core/scene/OffScenePanel.java
  2. 2
      sdk/jme3-core/src/com/jme3/gde/core/scene/ScenePreviewProcessor.java

@ -219,7 +219,7 @@ public class OffScenePanel extends javax.swing.JPanel implements SceneProcessor
public void postFrame(FrameBuffer fb) {
// cpuBuf.clear();
SceneApplication.getApplication().getRenderer().readFrameBuffer(offBuffer, cpuBuf);
SceneApplication.getApplication().getRenderer().readFrameBufferWithFormat(offBuffer, cpuBuf,Format.BGRA8);
//
// // copy native memory to java memory
// cpuBuf.clear();

@ -169,7 +169,7 @@ public class ScenePreviewProcessor implements SceneProcessor {
public void postFrame(FrameBuffer fb) {
if (currentPreviewRequest != null) {
cpuBuf.clear();
SceneApplication.getApplication().getRenderer().readFrameBuffer(offBuffer, cpuBuf);
SceneApplication.getApplication().getRenderer().readFrameBufferWithFormat(offBuffer, cpuBuf, Format.BGRA8);
// copy native memory to java memory
cpuBuf.clear();

Loading…
Cancel
Save