Example usage for com.badlogic.gdx.graphics.g3d.attributes ColorAttribute Fog

List of usage examples for com.badlogic.gdx.graphics.g3d.attributes ColorAttribute Fog

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.attributes ColorAttribute Fog.

Prototype

long Fog

To view the source code for com.badlogic.gdx.graphics.g3d.attributes ColorAttribute Fog.

Click Source Link

Usage

From source file:br.com.raphaelbruno.game.zombieinvaders.vr.model.ScreenBase.java

License:Apache License

private void setupEnviroment() {
    camera = new CardboardCamera();
    camera.position.set(0f, CAMERA_Y, 0f);
    camera.lookAt(0f, CAMERA_Y, -1f);/*from   www. ja  va 2s  . c  om*/
    camera.near = Z_NEAR;
    camera.far = Z_FAR;

    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 0.5f));
    environment.set(new ColorAttribute(ColorAttribute.Fog, BACKGROUND_COLOR.r, BACKGROUND_COLOR.g,
            BACKGROUND_COLOR.b, BACKGROUND_COLOR.a));
    environment.add(new DirectionalLight().set(0.6f, 0.6f, 0.4f, -0.5f, -0.6f, -0.5f));
    environment.add(new DirectionalLight().set(0.6f, 0.6f, 0.4f, 0.5f, -0.6f, 0.5f));
}

From source file:com.andgate.ikou.view.GameScreen.java

License:Open Source License

private void createEnvironment() {
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
    environment.set(new ColorAttribute(ColorAttribute.Fog, 1f, 1f, 1f, 1f));
    environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

    shadowLight = new DirectionalShadowLight(1024, 1024, 60f, 60f, .1f, 50f);
    shadowLight.set(0.8f, 0.8f, 0.8f, -1f, -.8f, -.2f);
    //environment.shadowMap = shadowLight;

    shadowBatch = new ModelBatch(new DepthShaderProvider());
}

From source file:com.github.fauu.helix.manager.WeatherMan.java

License:Open Source License

public void setToType(WeatherType type) {
    Environment environment = new Environment();
    Bloom bloom = null;/* ww  w . j a  v  a2s  . c  o  m*/
    ParticleEffect precipitationEffect = null;

    switch (type) {
    case NONE:
        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1, 1, 1, 1));
        break;
    case SUNNY:
        bloom = new Bloom();
        bloom.setBloomIntesity(1.1f);
        bloom.setOriginalIntesity(1);

        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1, 1, 1, 1));
        break;
    case OVERCAST:
        bloom = new Bloom();
        bloom.setBloomIntesity(.6f);
        bloom.setOriginalIntesity(.8f);

        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .8f, .8f, .8f, 1));
        break;
    case RAINSTORM:
        bloom = new Bloom();
        bloom.setBloomIntesity(.2f);
        bloom.setOriginalIntesity(.2f);

        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .5f, .5f, .6f, 1));
        environment.set(new ColorAttribute(ColorAttribute.Fog, 1, 1, 1, 1));

        precipitationEffect = new ParticleEffect();
        precipitationEffect.load(Gdx.files.internal("effect/rain.p"), Gdx.files.internal("effect"));
        precipitationEffect.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
        precipitationEffect.start();
        break;
    default:
        throw new IllegalStateException();
    }

    weather.setEnvironment(environment);
    weather.setBloom(bloom);
    weather.setParticleEffect(precipitationEffect);
}