How to use the expo-three.THREE.Fog function in expo-three

To help you get started, we’ve selected a few expo-three examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EvanBacon / Expo-Nitro-Roll / Game / Game.js View on Github external
createScene = () => {
    const scene = new THREE.Scene();
    // this.scene.background = color;
    scene.fog = new THREE.Fog(new THREE.Color(`hsl(20, 100%, 0%)`), 100, 950);
    scene.add(this);
    return scene;
  };
github EvanBacon / Expo-Voxel / js / lib / voxel-engine.js View on Github external
this.materialType = opts.materialType || THREE.MeshLambertMaterial;
  this.materialParams = opts.materialParams || {};
  this.items = [];
  this.voxels = voxel(this);
  this.scene = new THREE.Scene();
  this.view = opts.view;
  this.view.bindToScene(this.scene);
  this.camera = opts.getCamera();
  // let helper = new THREE.CameraHelper(this.camera);
  // this.scene.add(helper);

  if (!opts.lightsDisabled) this.addLights(this.scene);

  this.fogScale = opts.fogScale || 32;
  if (!opts.fogDisabled)
    this.scene.fog = new THREE.Fog(
      this.skyColor,
      0.00025,
      this.worldWidth() * this.fogScale,
    );

  this.collideVoxels = collisions(
    this.getBlock.bind(this),
    1,
    [Infinity, Infinity, Infinity],
    [-Infinity, -Infinity, -Infinity],
  );

  this.timer = this.initializeTimer(opts.tickFPS || 16);
  this.paused = false;

  this.spatial = new SpatialEventEmitter();
github expo / expo-three / example / screens / Effects / VignetteExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github expo / expo-three / example / screens / Effects / ParallaxBarrierExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github expo / expo-three / example / screens / Shaders / LavaExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github expo / expo-three / example / screens / Effects / AnaglyphExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github expo / expo-three / example / screens / Shaders / SkyExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github expo / expo-three / example / screens / Effects / VirtualBoyExample.js View on Github external
setupScene() {
    super.setupScene();
    this.scene.fog = new THREE.Fog(0xcccccc, 1, 1000);
  }
github EvanBacon / Sunset-Cyberspace / game / Game.js View on Github external
constructor(camera, scene, renderer, onPlay, onUpdateScore) {
    this.camera = camera;
    this.scene = scene;
    this.renderer = renderer;
    this.onPlay = onPlay;
    this.onUpdateScore = onUpdateScore;
    this.camera.position.z = Settings.FLOOR_DEPTH / 2 - 300;
    this.scene.fog = new THREE.Fog(
      Colors.fog,
      Settings.FLOOR_DEPTH / 2,
      Settings.FLOOR_DEPTH + 50,
    );
    this.renderer.setClearColor(Colors.backgroundColor, 1);
  }