use of com.jme3.asset.AssetManager in project jmonkeyengine by jMonkeyEngine.
the class TestNiftyExamples method simpleInitApp.
public void simpleInitApp() {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
nifty = niftyDisplay.getNifty();
nifty.fromXml("all/intro.xml", "start");
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
// disable the fly cam
flyCam.setEnabled(false);
}
use of com.jme3.asset.AssetManager in project jmonkeyengine by jMonkeyEngine.
the class TestToneMapFilter method simpleInitApp.
@Override
public void simpleInitApp() {
System.out.println("== Tone Mapping Sample ==");
System.out.println(" SPACE:\tToggle tone-mapping OFF or ON");
System.out.println(" Y:\tIncrease white-point");
System.out.println(" H:\tDecrease white-point");
fpp = new FilterPostProcessor(assetManager);
toneMapFilter = new ToneMapFilter();
fpp.addFilter(toneMapFilter);
viewPort.addProcessor(fpp);
rootNode.attachChild(createHDRBox());
cam.setLocation(new Vector3f(0f, 0f, 3f));
initInputs();
}
use of com.jme3.asset.AssetManager in project jmonkeyengine by jMonkeyEngine.
the class TestToneMapFilter method createHDRBox.
public Geometry createHDRBox() {
Box boxMesh = new Box(1, 1, 1);
Geometry box = new Geometry("Box", boxMesh);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Textures/HdrTest/Memorial.hdr"));
box.setMaterial(mat);
return box;
}
use of com.jme3.asset.AssetManager in project jmonkeyengine by jMonkeyEngine.
the class TestTransparentCartoonEdge method simpleInitApp.
public void simpleInitApp() {
renderManager.setAlphaToCoverage(true);
cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f));
cam.setRotation(new Quaternion(-0.0044764364f, 0.9767943f, 0.21314798f, 0.020512417f));
// cam.setLocation(new Vector3f(2.0606942f, 3.20342f, 6.7860126f));
// cam.setRotation(new Quaternion(-0.017481906f, 0.98241085f, -0.12393151f, -0.13857932f));
viewPort.setBackgroundColor(ColorRGBA.DarkGray);
Quad q = new Quad(20, 20);
q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(5));
Geometry geom = new Geometry("floor", q);
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
geom.setMaterial(mat);
geom.rotate(-FastMath.HALF_PI, 0, 0);
geom.center();
geom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(geom);
// create the geometry and attach it
Spatial teaGeom = assetManager.loadModel("Models/Tree/Tree.mesh.j3o");
teaGeom.setQueueBucket(Bucket.Transparent);
teaGeom.setShadowMode(ShadowMode.Cast);
makeToonish(teaGeom);
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(2));
rootNode.addLight(al);
DirectionalLight dl1 = new DirectionalLight();
dl1.setDirection(new Vector3f(1, -1, 1).normalizeLocal());
dl1.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
rootNode.addLight(dl1);
DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
dl.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
rootNode.addLight(dl);
rootNode.attachChild(teaGeom);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
CartoonEdgeFilter toon = new CartoonEdgeFilter();
toon.setEdgeWidth(0.5f);
toon.setEdgeIntensity(1.0f);
toon.setNormalThreshold(0.8f);
fpp.addFilter(toon);
viewPort.addProcessor(fpp);
}
use of com.jme3.asset.AssetManager in project jmonkeyengine by jMonkeyEngine.
the class TestHoverTank method simpleInitApp.
@Override
public void simpleInitApp() {
Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
flyCam.setEnabled(false);
ChaseCamera chaseCam = new ChaseCamera(cam, tank, inputManager);
chaseCam.setSmoothMotion(true);
chaseCam.setMaxDistance(100000);
chaseCam.setMinVerticalRotation(-FastMath.PI / 2);
viewPort.setBackgroundColor(ColorRGBA.DarkGray);
Geometry tankGeom = (Geometry) tank.getChild(0);
LodControl control = new LodControl();
tankGeom.addControl(control);
rootNode.attachChild(tank);
Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
DirectionalLight dl = new DirectionalLight();
dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
dl.setDirection(lightDir);
Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
DirectionalLight dl2 = new DirectionalLight();
dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
dl2.setDirection(lightDir2);
rootNode.addLight(dl);
rootNode.addLight(dl2);
rootNode.attachChild(tank);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);
bf.setBloomIntensity(2.0f);
bf.setExposurePower(1.3f);
fpp.addFilter(bf);
BloomUI bui = new BloomUI(inputManager, bf);
viewPort.addProcessor(fpp);
}
Aggregations