Awt Panel now supports gamma correct pipeline. Default stays non srgb for backward compatibility. But IMO it should be set to srgb by default to promote the srgb pipeline.

experimental
Nehon 10 years ago
parent ea2e25c2e6
commit 2aa50694b8
  1. 8
      jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java
  2. 6
      jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java

@ -58,6 +58,7 @@ public class AwtPanel extends Canvas implements SceneProcessor {
private BufferedImage img;
private FrameBuffer fb;
private boolean srgb = false;
private ByteBuffer byteBuf;
private IntBuffer intBuf;
private RenderManager rm;
@ -78,8 +79,12 @@ public class AwtPanel extends Canvas implements SceneProcessor {
private final Object lock = new Object();
public AwtPanel(PaintMode paintMode){
this(paintMode, false);
}
public AwtPanel(PaintMode paintMode, boolean srgb){
this.paintMode = paintMode;
this.srgb = srgb;
if (paintMode == PaintMode.Accelerated){
setIgnoreRepaint(true);
}
@ -246,6 +251,7 @@ public class AwtPanel extends Canvas implements SceneProcessor {
fb = new FrameBuffer(width, height, 1);
fb.setDepthBuffer(Format.Depth);
fb.setColorBuffer(Format.RGB8);
fb.setSrgb(srgb);
if (attachAsMain){
rm.getRenderer().setMainFrameBufferOverride(fb);

@ -153,6 +153,12 @@ public class AwtPanelsContext implements JmeContext {
panels.add(panel);
return panel;
}
public AwtPanel createPanel(PaintMode paintMode, boolean srgb){
AwtPanel panel = new AwtPanel(paintMode, srgb);
panels.add(panel);
return panel;
}
private void initInThread(){
listener.initialize();

Loading…
Cancel
Save