diff --git a/jme3-core/src/main/java/com/jme3/material/Material.java b/jme3-core/src/main/java/com/jme3/material/Material.java index 73cd1b485..719da4748 100644 --- a/jme3-core/src/main/java/com/jme3/material/Material.java +++ b/jme3-core/src/main/java/com/jme3/material/Material.java @@ -819,7 +819,14 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { private void updateRenderState(RenderManager renderManager, Renderer renderer, TechniqueDef techniqueDef) { if (renderManager.getForcedRenderState() != null) { - renderer.applyRenderState(renderManager.getForcedRenderState()); + if (techniqueDef.getForcedRenderState() != null) { + renderer.applyRenderState( + techniqueDef.getForcedRenderState().copyMergedTo( + renderManager.getForcedRenderState(), + mergedRenderState)); + } else { + renderer.applyRenderState(renderManager.getForcedRenderState()); + } } else { if (techniqueDef.getRenderState() != null) { renderer.applyRenderState(techniqueDef.getRenderState().copyMergedTo(additionalState, mergedRenderState)); diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java index 817ca6b54..6479b3221 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java +++ b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java @@ -578,19 +578,11 @@ public class RenderManager { : TechniqueDef.DEFAULT_TECHNIQUE_NAME; geom.getMaterial().selectTechnique(forcedTechnique, this); - //saving forcedRenderState for future calls - RenderState tmpRs = forcedRenderState; - if (geom.getMaterial().getActiveTechnique().getDef().getForcedRenderState() != null) { - //forcing forced technique renderState - forcedRenderState = geom.getMaterial().getActiveTechnique().getDef().getForcedRenderState(); - } + // use geometry's material material.render(geom, this); material.selectTechnique(previousTechniqueName, this); - //restoring forcedRenderState - forcedRenderState = tmpRs; - //Reverted this part from revision 6197 //If forcedTechnique does not exists, and forcedMaterial is not set, the geom MUST NOT be rendered } else if (forcedMaterial != null) {