code: function getFog (data) {
    var fog;
    if (data.type === 'exponential') {
      fog = new THREE.FogExp2(data.color, data.density);
    } else {
      fog = new THREE.Fog(data.color, data.near, data.far);
    }
    fog.name = data.type;
    return fog;
  }
docs: Creates a fog object. Sets fog.name to be able to detect fog type changes.
  
  @param {object} data - Fog data.
  @returns {object} fog