From 66bf6b20b9a6d148daf9671f61e99007fc94f910 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 11 Jun 2011 18:02:57 +0000 Subject: [PATCH] * RenderState.copyMergedTo() now properly combines stencil state git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7582 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../core/com/jme3/material/RenderState.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/engine/src/core/com/jme3/material/RenderState.java b/engine/src/core/com/jme3/material/RenderState.java index f549f39be..15eff49f5 100644 --- a/engine/src/core/com/jme3/material/RenderState.java +++ b/engine/src/core/com/jme3/material/RenderState.java @@ -1015,8 +1015,30 @@ public class RenderState implements Cloneable, Savable { } if (additionalState.applyStencilTest){ state.stencilTest = additionalState.stencilTest; + + state.frontStencilStencilFailOperation = additionalState.frontStencilStencilFailOperation; + state.frontStencilDepthFailOperation = additionalState.frontStencilDepthFailOperation; + state.frontStencilDepthPassOperation = additionalState.frontStencilDepthPassOperation; + + state.backStencilStencilFailOperation = additionalState.backStencilStencilFailOperation; + state.backStencilDepthFailOperation = additionalState.backStencilDepthFailOperation; + state.backStencilDepthPassOperation = additionalState.backStencilDepthPassOperation; + + state.frontStencilFunction = additionalState.frontStencilFunction; + state.backStencilFunction = additionalState.backStencilFunction; }else{ state.stencilTest = stencilTest; + + state.frontStencilStencilFailOperation = frontStencilStencilFailOperation; + state.frontStencilDepthFailOperation = frontStencilDepthFailOperation; + state.frontStencilDepthPassOperation = frontStencilDepthPassOperation; + + state.backStencilStencilFailOperation = backStencilStencilFailOperation; + state.backStencilDepthFailOperation = backStencilDepthFailOperation; + state.backStencilDepthPassOperation = backStencilDepthPassOperation; + + state.frontStencilFunction = frontStencilFunction; + state.backStencilFunction = backStencilFunction; } return state; }