From 8a747276d721a830c1ab48c8069515f93bb74d21 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sat, 9 Sep 2017 16:28:11 -0400 Subject: [PATCH] Make sure apply = false for all forced render states --- jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java | 2 +- .../src/main/java/com/jme3/shadow/AbstractShadowRenderer.java | 2 +- .../src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java | 2 +- .../src/main/java/com/jme3/niftygui/RenderDeviceJme.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java b/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java index a3125dd1e..92828b807 100644 --- a/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java +++ b/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java @@ -60,7 +60,7 @@ public class PreDepthProcessor implements SceneProcessor { preDepth.getAdditionalRenderState().setPolyOffset(0, 0); preDepth.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); - forcedRS = new RenderState(); + forcedRS = RenderState.ADDITIONAL.clone(); forcedRS.setDepthTest(true); forcedRS.setDepthWrite(false); } diff --git a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java index ff967f584..8494cd0b3 100644 --- a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java +++ b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java @@ -94,7 +94,7 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable, protected EdgeFilteringMode edgeFilteringMode = EdgeFilteringMode.Bilinear; protected CompareMode shadowCompareMode = CompareMode.Hardware; protected Picture[] dispPic; - protected RenderState forcedRenderState = new RenderState(); + protected RenderState forcedRenderState = RenderState.ADDITIONAL.clone(); protected boolean renderBackFacesShadows = true; protected AppProfiler prof; diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java index 9dd831020..cea3b7531 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java @@ -453,7 +453,7 @@ public class JmeBatchRenderBackend implements BatchRenderBackend { private final Mesh mesh = new Mesh(); private final Geometry meshGeometry = new Geometry("nifty-quad", mesh); - private final RenderState renderState = new RenderState(); + private final RenderState renderState = RenderState.ADDITIONAL.clone(); private FloatBuffer vertexPosBuffer; private FloatBuffer vertexTexCoordBuffer; diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java index ab0fc6659..071cbbe05 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java @@ -73,7 +73,7 @@ public class RenderDeviceJme implements RenderDevice { private VertexBuffer quadColor; private Matrix4f tempMat = new Matrix4f(); private ColorRGBA tempColor = new ColorRGBA(); - private RenderState renderState = new RenderState(); + private RenderState renderState = RenderState.ADDITIONAL.clone(); private Material colorMaterial; private Material textureColorMaterial;