Make sure apply = false for all forced render states

This commit is contained in:
Kirill Vainer 2017-09-09 16:28:11 -04:00
parent ce28e35393
commit 8a747276d7
4 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,7 @@ public class PreDepthProcessor implements SceneProcessor {
preDepth.getAdditionalRenderState().setPolyOffset(0, 0); preDepth.getAdditionalRenderState().setPolyOffset(0, 0);
preDepth.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); preDepth.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back);
forcedRS = new RenderState(); forcedRS = RenderState.ADDITIONAL.clone();
forcedRS.setDepthTest(true); forcedRS.setDepthTest(true);
forcedRS.setDepthWrite(false); forcedRS.setDepthWrite(false);
} }

View File

@ -94,7 +94,7 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable,
protected EdgeFilteringMode edgeFilteringMode = EdgeFilteringMode.Bilinear; protected EdgeFilteringMode edgeFilteringMode = EdgeFilteringMode.Bilinear;
protected CompareMode shadowCompareMode = CompareMode.Hardware; protected CompareMode shadowCompareMode = CompareMode.Hardware;
protected Picture[] dispPic; protected Picture[] dispPic;
protected RenderState forcedRenderState = new RenderState(); protected RenderState forcedRenderState = RenderState.ADDITIONAL.clone();
protected boolean renderBackFacesShadows = true; protected boolean renderBackFacesShadows = true;
protected AppProfiler prof; protected AppProfiler prof;

View File

@ -453,7 +453,7 @@ public class JmeBatchRenderBackend implements BatchRenderBackend {
private final Mesh mesh = new Mesh(); private final Mesh mesh = new Mesh();
private final Geometry meshGeometry = new Geometry("nifty-quad", 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 vertexPosBuffer;
private FloatBuffer vertexTexCoordBuffer; private FloatBuffer vertexTexCoordBuffer;

View File

@ -73,7 +73,7 @@ public class RenderDeviceJme implements RenderDevice {
private VertexBuffer quadColor; private VertexBuffer quadColor;
private Matrix4f tempMat = new Matrix4f(); private Matrix4f tempMat = new Matrix4f();
private ColorRGBA tempColor = new ColorRGBA(); private ColorRGBA tempColor = new ColorRGBA();
private RenderState renderState = new RenderState(); private RenderState renderState = RenderState.ADDITIONAL.clone();
private Material colorMaterial; private Material colorMaterial;
private Material textureColorMaterial; private Material textureColorMaterial;