|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2009-2021 jMonkeyEngine
|
|
|
+ * Copyright (c) 2009-2022 jMonkeyEngine
|
|
|
* All rights reserved.
|
|
|
*
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -45,6 +45,7 @@ import com.jme3.renderer.Renderer;
|
|
|
import com.jme3.renderer.ViewPort;
|
|
|
import com.jme3.renderer.queue.RenderQueue;
|
|
|
import com.jme3.texture.FrameBuffer;
|
|
|
+import com.jme3.texture.image.ColorSpace;
|
|
|
import de.lessvoid.nifty.Nifty;
|
|
|
import de.lessvoid.nifty.render.batch.BatchRenderConfiguration;
|
|
|
import de.lessvoid.nifty.render.batch.BatchRenderDevice;
|
|
@@ -243,8 +244,10 @@ public class NiftyJmeDisplay implements SceneProcessor {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Create a standard NiftyJmeDisplay. This uses the old Nifty renderer. It's probably slower than the batched
|
|
|
+ * Create a standard NiftyJmeDisplay. This uses the old Nifty renderer.
|
|
|
+ * It's probably slower than the batched
|
|
|
* renderer and is mainly here for backwards compatibility.
|
|
|
+ * Nifty colors are assumed to be in Linear colorspace (no gamma correction).
|
|
|
*
|
|
|
* @param assetManager jME AssetManager
|
|
|
* @param inputManager jME InputManager
|
|
@@ -255,9 +258,28 @@ public class NiftyJmeDisplay implements SceneProcessor {
|
|
|
InputManager inputManager,
|
|
|
AudioRenderer audioRenderer,
|
|
|
ViewPort vp) {
|
|
|
+ this(assetManager, inputManager, audioRenderer, vp, ColorSpace.Linear);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Create a standard NiftyJmeDisplay. This uses the old Nifty renderer.
|
|
|
+ * It's probably slower than the batched
|
|
|
+ * renderer and is mainly here for backwards compatibility.
|
|
|
+ *
|
|
|
+ * @param assetManager jME AssetManager
|
|
|
+ * @param inputManager jME InputManager
|
|
|
+ * @param audioRenderer jME AudioRenderer
|
|
|
+ * @param vp Viewport to use
|
|
|
+ * @param colorSpace the ColorSpace to use for Nifty colors (sRGB or Linear)
|
|
|
+ */
|
|
|
+ public NiftyJmeDisplay(AssetManager assetManager,
|
|
|
+ InputManager inputManager,
|
|
|
+ AudioRenderer audioRenderer,
|
|
|
+ ViewPort vp,
|
|
|
+ ColorSpace colorSpace) {
|
|
|
initialize(assetManager, inputManager, audioRenderer, vp);
|
|
|
|
|
|
- this.renderDev = new RenderDeviceJme(this);
|
|
|
+ this.renderDev = new RenderDeviceJme(this, colorSpace);
|
|
|
this.batchRendererBackend = null;
|
|
|
|
|
|
nifty = new Nifty(renderDev, soundDev, inputSys, new AccurateTimeProvider());
|