function addLayerProps()

in gui.js [296:409]


    function addLayerProps(folder, config, layer, index) {
      if (is.fss(layer)) {
        const mirrorSwitch = folder.add(config, 'mirror' + index).name('rorschach');
        const lightSpeed = folder.add(config, 'lightSpeed' + index).name('light pace')
                                 .min(100).max(2000);
        const facesX = folder.add(config, 'facesX' + index).name('columns').min(1).max(100).step(1);
        const facesY = folder.add(config, 'facesY' + index).name('rows').min(1).max(100).step(1);
        const fogFolder = folder.addFolder('fog');
        const vignette = fogFolder.add(config, 'vignette' + index).name('shine').min(0).max(1).step(0.01);
        const iris = fogFolder.add(config, 'iris' + index).name('density').min(0).max(1).step(0.01);
        const renderMode = folder.add(config, 'renderMode' + index, C.RENDER_MODES).name('structure');

        const amplitudeFolder = folder.addFolder('ranges');
        const amplitudeX = amplitudeFolder.add(config, 'amplitudeX' + index).name('horizontal')
          .min(0.0).max(1.0);
        const amplitudeY = amplitudeFolder.add(config, 'amplitudeY' + index).name('vertical')
          .min(0.0).max(1.0);
        const amplitudeZ = amplitudeFolder.add(config, 'amplitudeZ' + index).name('depth')
          .min(0.0).max(1.0);

        const opacity = folder.add(config, 'opacity' + index).name('opacity').min(0).max(1).step(0.01);

        const colorShiftFolder = folder.addFolder('coloring');
        const hue = colorShiftFolder.add(config, 'hue' + index).name('hue')
          .min(-1.0).max(1.0).step(0.01);
        const saturation = colorShiftFolder.add(config, 'saturation' + index).name('saturation')
          .min(-1.0).max(1.0).step(0.01);
        const brightness = colorShiftFolder.add(config, 'brightness' + index).name('brightness')
          .min(-1.0).max(1.0).step(0.01);

        mirrorSwitch.onFinishChange(val => switchMirror(index, val));
        lightSpeed.onFinishChange(funcs.changeLightSpeed(index));
        facesX.onFinishChange(funcs.changeFacesX(index));
        facesY.onFinishChange(funcs.changeFacesY(index));
        vignette.onFinishChange(funcs.changeVignette(index));
        iris.onFinishChange(funcs.changeIris(index));
        renderMode.onFinishChange(funcs.changeRenderMode(index));

        amplitudeX.onFinishChange(value => {
          funcs.changeAmplitude(index)(value, null, null);
        });
        amplitudeY.onFinishChange(value => {
          funcs.changeAmplitude(index)(null, value, null);
        });
        amplitudeZ.onFinishChange(value => {
          funcs.changeAmplitude(index)(null, null, value);
        });

        opacity.onFinishChange(funcs.changeOpacity(index));

        hue.onFinishChange(value => {
          funcs.shiftColor(index)(value, null, null);
        });
        saturation.onFinishChange(value => {
          funcs.shiftColor(index)(null, value, null);
        });
        brightness.onFinishChange(value => {
          funcs.shiftColor(index)(null, null, value);
        });
      }
      if (layer.visible != 'locked') {
        const visibitySwitch = folder.add(config, 'visible' + index).name('visible');
        visibitySwitch.onFinishChange(switchLayer(index));
      }

      if (!is.background(layer) && !is.cover(layer)) {
        const opacity = folder.add(config, 'opacity' + index).name('opacity').min(0.0).max(1).step(0.01);
        opacity.onFinishChange(funcs.changeOpacity(index));
      }

      if (is.cover(layer)) {
        const productVisibilitySwitch =
          folder.add(config, 'productShown' + index).name('title');
        productVisibilitySwitch.onFinishChange(funcs.switchCoverProductVisibility(index));
      }
      if (is.fluid(layer) || is.nativeMetaballs(layer)) {
        folder.add(config, 'bang' + index).name('bang');
        if (is.fluid(layer)) {
          folder.add(config, 'rebuildGradients' + index).name('regenerate gradients');
        }
        const variety = folder.add(config, 'variety' + index).name('variety').min(0.01).max(1).step(0.01);
        const orbit = folder.add(config, 'orbit' + index).name('orbit').min(0).max(1).step(0.05);
        const blur = folder.add(config, 'blur' + index).name('myopia').min(0).max(1).step(0.01);
        const fat = folder.add(config, 'fat' + index).name('fat').min(0).max(1).step(0.01);
        const ring = folder.add(config, 'ring' + index).name('x-ray').min(0).max(1).step(0.01);
        variety.onFinishChange(
          is.fluid(layer)
            ? funcs.changeFluidVariety(index)
            : funcs.changeNativeMetaballsVariety(index));
        orbit.onFinishChange(
          is.fluid(layer)
            ? funcs.changeFluidOrbit(index)
            : funcs.changeNativeMetaballsOrbit(index));
        blur.onFinishChange(
            funcs.changeNativeMetaballsEffects(index, 'blur'));
        fat.onFinishChange(
            funcs.changeNativeMetaballsEffects(index, 'fat'));
        ring.onFinishChange(
            funcs.changeNativeMetaballsEffects(index, 'ring'));
      }
      if (is.background(layer)) {
        const stop1 = folder.add(config, 'stop1' + index).name('heaven');
        const stop2 = folder.add(config, 'stop2' + index).name('dragons');
        const stop3 = folder.add(config, 'stop3' + index).name('earth');
        const switchStop = funcs.switchBackgroundStop;
        stop1.onFinishChange(switchStop(index, 0));
        stop2.onFinishChange(switchStop(index, 1));
        stop3.onFinishChange(switchStop(index, 2));
        const gradientType = folder.add(config, 'isRadial' + index).name('radial');
        gradientType.onFinishChange(funcs.switchBackgroundGradientType(index));
        const darken = folder.add(config, 'darken' + index).name('darken').min(0.0).max(1).step(0.01);
        darken.onFinishChange(funcs.darkenBackground(index));
      }
    }