diff --git a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java index 264e23aba..f754c9e69 100644 --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java @@ -1051,7 +1051,7 @@ public class OGLESShaderRenderer implements Renderer { } } else { logger.log(Level.WARNING, "Bad compile of:\n{0}", - new Object[]{ShaderDebug.formatShaderSource(source.getDefines(), source.getSource())}); + new Object[]{ShaderDebug.formatShaderSource(source.getDefines(), source.getSource(),stringBuf.toString())}); if (infoLog != null) { throw new RendererException("compile error in:" + source + " error:" + infoLog); } else { diff --git a/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java b/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java index e088cc2d8..d117b72d3 100644 --- a/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java +++ b/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java @@ -995,10 +995,10 @@ public class LwjglRenderer implements Renderer { new Object[]{source.getName(), infoLog}); } else { logger.log(Level.FINE, "{0} compile success", source.getName()); - } - } else { + } + } else { logger.log(Level.WARNING, "Bad compile of:\n{0}", - new Object[]{ShaderDebug.formatShaderSource(source.getDefines(), source.getSource())}); + new Object[]{ShaderDebug.formatShaderSource(source.getDefines(), source.getSource(),stringBuf.toString())}); if (infoLog != null) { throw new RendererException("compile error in:" + source + " error:" + infoLog); } else { diff --git a/engine/src/tools/jme3tools/shader/ShaderDebug.java b/engine/src/tools/jme3tools/shader/ShaderDebug.java index 5421accff..29df6ffe1 100644 --- a/engine/src/tools/jme3tools/shader/ShaderDebug.java +++ b/engine/src/tools/jme3tools/shader/ShaderDebug.java @@ -43,11 +43,18 @@ public class ShaderDebug { * @param source the source * @return the formated source code */ - public static String formatShaderSource(String defines, String source) { + public static String formatShaderSource(String defines, String source,String version) { + String[] lines0 = version.split("\n"); String[] lines = defines.split("\n"); String[] lines2 = source.split("\n"); int nblines = 0; StringBuilder out = new StringBuilder(); + if (!version.equals("")) { + for (String string : lines0) { + nblines++; + out.append(nblines).append("\t").append(string).append("\n"); + } + } if (!defines.equals("")) { for (String string : lines) { nblines++;