* Formatting and names in ShaderDebug

* Remove shininess=0 in TestParallax, its bad

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9554 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 28926b8383
commit 9b9fa57de4
  1. 7
      engine/src/test/jme3test/material/TestParallax.java
  2. 14
      engine/src/tools/jme3tools/shader/ShaderDebug.java

@ -77,7 +77,6 @@ public class TestParallax extends SimpleApplication {
mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall2.j3m");
mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.setFloat("Shininess", 0);
// Node floorGeom = (Node) assetManager.loadAsset("Models/WaterTest/WaterTest.mesh.xml");
//Geometry g = ((Geometry) floorGeom.getChild(0));
@ -115,7 +114,6 @@ public class TestParallax extends SimpleApplication {
public void simpleInitApp() {
cam.setLocation(new Vector3f(-15.445636f, 30.162927f, 60.252777f));
cam.setRotation(new Quaternion(0.05173137f, 0.92363626f, -0.13454558f, 0.35513034f));
flyCam.setMoveSpeed(30);
@ -152,11 +150,6 @@ public class TestParallax extends SimpleApplication {
}
}, "toggleSteep");
inputManager.addMapping("toggleSteep", new KeyTrigger(KeyInput.KEY_SPACE));
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
FXAAFilter fxaa = new FXAAFilter();
fxaa.setReduceMul(0.08f);
fpp.addFilter(fxaa);
viewPort.addProcessor(fpp);
}
float parallaxHeigh = 0.05f;
float time = 0;

@ -43,25 +43,25 @@ public class ShaderDebug {
* @param source the source
* @return the formated source code
*/
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");
public static String formatShaderSource(String defines, String source, String version) {
String[] versionLines = version.split("\n");
String[] definesLines = defines.split("\n");
String[] sourceLines = source.split("\n");
int nblines = 0;
StringBuilder out = new StringBuilder();
if (!version.equals("")) {
for (String string : lines0) {
for (String string : versionLines) {
nblines++;
out.append(nblines).append("\t").append(string).append("\n");
}
}
if (!defines.equals("")) {
for (String string : lines) {
for (String string : definesLines) {
nblines++;
out.append(nblines).append("\t").append(string).append("\n");
}
}
for (String string : lines2) {
for (String string : sourceLines) {
nblines++;
out.append(nblines).append("\t").append(string).append("\n");
}

Loading…
Cancel
Save