From 6d5758c91490828d96a0b8050cf6801a68efebf1 Mon Sep 17 00:00:00 2001 From: b00nation <25694121+b00nation@users.noreply.github.com> Date: Thu, 8 Mar 2018 14:36:23 +0100 Subject: [PATCH] Update MaterialDebugAppState.java I was debugging my application to dig down the issue why the shaders are recognized of change but not actually reloaded. I came to this solution. --- .../src/main/java/com/jme3/util/MaterialDebugAppState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java b/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java index 01464f67b..b0f3565e4 100644 --- a/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java +++ b/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java @@ -200,7 +200,8 @@ public class MaterialDebugAppState extends AbstractAppState { assetManager.clearCache(); //creating a dummy mat with the mat def of the mat to reload - Material dummy = new Material(mat.getMaterialDef()); + // Force the reloading of the asset, otherwise the new shader code will not be applied. + Material dummy = new Material(assetManager, mat.getMaterialDef().getAssetName()); for (MatParam matParam : mat.getParams()) { dummy.setParam(matParam.getName(), matParam.getVarType(), matParam.getValue());