Added toon shader
This commit is contained in:
parent
6687ec186d
commit
8eced25964
2 changed files with 24 additions and 8 deletions
|
|
@ -13,7 +13,10 @@ sourceSets {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jmonkeyengine:jme3-core:${jme3Version}-stable"
|
compile "org.jmonkeyengine:jme3-core:${jme3Version}-stable"
|
||||||
compile "org.jmonkeyengine:jme3-terrain:${jme3Version}-stable"
|
// compile "org.jmonkeyengine:jme3-terrain:${jme3Version}-stable"
|
||||||
|
compile "org.jmonkeyengine:jme3-effects:${jme3Version}-stable"
|
||||||
|
compile "org.jmonkeyengine:jme3-jogg:${jme3Version}-stable"
|
||||||
|
compile "org.jmonkeyengine:jme3-niftygui:${jme3Version}-stable"
|
||||||
|
|
||||||
implementation 'se.koc:zutil:1.0.0-SNAPSHOT'
|
implementation 'se.koc:zutil:1.0.0-SNAPSHOT'
|
||||||
|
|
||||||
|
|
@ -34,10 +37,14 @@ task buildResources {
|
||||||
def targetFile = new File(tmpFile)
|
def targetFile = new File(tmpFile)
|
||||||
println " - Output: ${targetFile}"
|
println " - Output: ${targetFile}"
|
||||||
|
|
||||||
exec {
|
// exec {
|
||||||
executable "sh"
|
// executable "sh"
|
||||||
args "-c", "blender.exe --background '${sourceFile}' --python 'blender-export.py' -- '${targetFile}'"
|
// args "-c", "blender --background '${sourceFile}' --python 'blender-export.py' -- '${targetFile}'"
|
||||||
}
|
// }
|
||||||
|
// exec {
|
||||||
|
// executable "cmd"
|
||||||
|
// args "/c", "blender.exe --background '${sourceFile}' --python 'blender-export.py' -- '${targetFile}'"
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,17 @@ package se.cookery;
|
||||||
import com.jme3.app.SimpleApplication;
|
import com.jme3.app.SimpleApplication;
|
||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.post.FilterPostProcessor;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.terrain.geomipmap.TerrainQuad;
|
|
||||||
import se.cookery.core.world.Block;
|
import se.cookery.core.world.Block;
|
||||||
import se.cookery.core.world.gen.GrassLandWorldGenerator;
|
import se.cookery.core.world.gen.GrassLandWorldGenerator;
|
||||||
import se.cookery.gfx.character.Player;
|
import se.cookery.gfx.character.Player;
|
||||||
import se.cookery.gfx.terrain.TerrainMesh;
|
import se.cookery.gfx.terrain.TerrainMesh;
|
||||||
import se.cookery.gfx.util.MaterialUtil;
|
import se.cookery.gfx.util.MaterialUtil;
|
||||||
import se.cookery.gfx.util.WireFrameProcessor;
|
import se.cookery.gfx.util.WireFrameProcessor;
|
||||||
|
import com.jme3.post.filters.CartoonEdgeFilter;
|
||||||
|
|
||||||
public class CookeryClient extends SimpleApplication {
|
public class CookeryClient extends SimpleApplication {
|
||||||
private TerrainQuad terrain;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
|
|
@ -35,6 +35,15 @@ public class CookeryClient extends SimpleApplication {
|
||||||
rootNode.attachChild(player.getGfxNode());
|
rootNode.attachChild(player.getGfxNode());
|
||||||
|
|
||||||
// Wireframe mode
|
// Wireframe mode
|
||||||
viewPort.addProcessor(new WireFrameProcessor(assetManager));
|
// viewPort.addProcessor(new WireFrameProcessor(assetManager));
|
||||||
|
|
||||||
|
|
||||||
|
CartoonEdgeFilter toon = new CartoonEdgeFilter();
|
||||||
|
toon.setEdgeWidth(0.5f);
|
||||||
|
toon.setEdgeIntensity(1.0f);
|
||||||
|
toon.setNormalThreshold(0.8f);
|
||||||
|
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
|
||||||
|
fpp.addFilter(toon);
|
||||||
|
viewPort.addProcessor(fpp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue