소스 검색

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.
b00nation 7 년 전
부모
커밋
0d5f18c3a8
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java

+ 2 - 1
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());