Search in sources :

Example 46 with Texture

use of com.jme3.texture.Texture in project jmonkeyengine by jMonkeyEngine.

the class TestEverything method setupSkyBox.

public void setupSkyBox() {
    Texture envMap;
    if (renderer.getCaps().contains(Caps.FloatTexture)) {
        envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.hdr");
    } else {
        envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg");
    }
    rootNode.attachChild(SkyFactory.createSky(assetManager, envMap, new Vector3f(-1, -1, -1), true));
}
Also used : Texture(com.jme3.texture.Texture)

Example 47 with Texture

use of com.jme3.texture.Texture in project jmonkeyengine by jMonkeyEngine.

the class TestExplosionEffect method createSmokeTrail.

private void createSmokeTrail() {
    smoketrail = new ParticleEmitter("SmokeTrail", Type.Triangle, 22 * COUNT_FACTOR);
    smoketrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
    smoketrail.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
    smoketrail.setStartSize(.2f);
    smoketrail.setEndSize(1f);
    //        smoketrail.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f));
    smoketrail.setFacingVelocity(true);
    smoketrail.setParticlesPerSec(0);
    smoketrail.setGravity(0, 1, 0);
    smoketrail.setLowLife(.4f);
    smoketrail.setHighLife(.5f);
    smoketrail.setInitialVelocity(new Vector3f(0, 12, 0));
    smoketrail.setVelocityVariation(1);
    smoketrail.setImagesX(1);
    smoketrail.setImagesY(3);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/smoketrail.png"));
    smoketrail.setMaterial(mat);
    explosionEffect.attachChild(smoketrail);
}
Also used : ParticleEmitter(com.jme3.effect.ParticleEmitter) ColorRGBA(com.jme3.math.ColorRGBA) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material)

Example 48 with Texture

use of com.jme3.texture.Texture in project jmonkeyengine by jMonkeyEngine.

the class TestExplosionEffect method createDebris.

private void createDebris() {
    debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR);
    debris.setSelectRandomImage(true);
    debris.setRandomAngle(true);
    debris.setRotateSpeed(FastMath.TWO_PI * 4);
    debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, (float) (1.0f / COUNT_FACTOR_F)));
    debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f));
    debris.setStartSize(.2f);
    debris.setEndSize(.2f);
    //        debris.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f));
    debris.setParticlesPerSec(0);
    debris.setGravity(0, 12f, 0);
    debris.setLowLife(1.4f);
    debris.setHighLife(1.5f);
    debris.setInitialVelocity(new Vector3f(0, 15, 0));
    debris.setVelocityVariation(.60f);
    debris.setImagesX(3);
    debris.setImagesY(3);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/Debris.png"));
    debris.setMaterial(mat);
    explosionEffect.attachChild(debris);
}
Also used : ParticleEmitter(com.jme3.effect.ParticleEmitter) ColorRGBA(com.jme3.math.ColorRGBA) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material)

Example 49 with Texture

use of com.jme3.texture.Texture in project jmonkeyengine by jMonkeyEngine.

the class TestExplosionEffect method createRoundSpark.

private void createRoundSpark() {
    roundspark = new ParticleEmitter("RoundSpark", EMITTER_TYPE, 20 * COUNT_FACTOR);
    roundspark.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, (float) (1.0 / COUNT_FACTOR_F)));
    roundspark.setEndColor(new ColorRGBA(0, 0, 0, (float) (0.5f / COUNT_FACTOR_F)));
    roundspark.setStartSize(1.2f);
    roundspark.setEndSize(1.8f);
    roundspark.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f));
    roundspark.setParticlesPerSec(0);
    roundspark.setGravity(0, -.5f, 0);
    roundspark.setLowLife(1.8f);
    roundspark.setHighLife(2f);
    roundspark.setInitialVelocity(new Vector3f(0, 3, 0));
    roundspark.setVelocityVariation(.5f);
    roundspark.setImagesX(1);
    roundspark.setImagesY(1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/roundspark.png"));
    mat.setBoolean("PointSprite", POINT_SPRITE);
    roundspark.setMaterial(mat);
    explosionEffect.attachChild(roundspark);
}
Also used : ParticleEmitter(com.jme3.effect.ParticleEmitter) ColorRGBA(com.jme3.math.ColorRGBA) Vector3f(com.jme3.math.Vector3f) EmitterSphereShape(com.jme3.effect.shapes.EmitterSphereShape) Material(com.jme3.material.Material)

Example 50 with Texture

use of com.jme3.texture.Texture in project jmonkeyengine by jMonkeyEngine.

the class TestExplosionEffect method createSpark.

private void createSpark() {
    spark = new ParticleEmitter("Spark", Type.Triangle, 30 * COUNT_FACTOR);
    spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F)));
    spark.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f));
    spark.setStartSize(.5f);
    spark.setEndSize(.5f);
    spark.setFacingVelocity(true);
    spark.setParticlesPerSec(0);
    spark.setGravity(0, 5, 0);
    spark.setLowLife(1.1f);
    spark.setHighLife(1.5f);
    spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0));
    spark.getParticleInfluencer().setVelocityVariation(1);
    spark.setImagesX(1);
    spark.setImagesY(1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/spark.png"));
    spark.setMaterial(mat);
    explosionEffect.attachChild(spark);
}
Also used : ParticleEmitter(com.jme3.effect.ParticleEmitter) ColorRGBA(com.jme3.math.ColorRGBA) Vector3f(com.jme3.math.Vector3f) Material(com.jme3.material.Material)

Aggregations

Material (com.jme3.material.Material)97 Texture (com.jme3.texture.Texture)94 Vector3f (com.jme3.math.Vector3f)66 Geometry (com.jme3.scene.Geometry)40 Image (com.jme3.texture.Image)39 TextureKey (com.jme3.asset.TextureKey)31 ArrayList (java.util.ArrayList)27 Texture2D (com.jme3.texture.Texture2D)25 ColorRGBA (com.jme3.math.ColorRGBA)23 Box (com.jme3.scene.shape.Box)19 Spatial (com.jme3.scene.Spatial)18 TerrainQuad (com.jme3.terrain.geomipmap.TerrainQuad)18 ParticleEmitter (com.jme3.effect.ParticleEmitter)17 DirectionalLight (com.jme3.light.DirectionalLight)17 Vector2f (com.jme3.math.Vector2f)17 TerrainLodControl (com.jme3.terrain.geomipmap.TerrainLodControl)16 ByteBuffer (java.nio.ByteBuffer)16 AbstractHeightMap (com.jme3.terrain.heightmap.AbstractHeightMap)15 ImageBasedHeightMap (com.jme3.terrain.heightmap.ImageBasedHeightMap)15 Camera (com.jme3.renderer.Camera)14