setTransferFuncVec3()

in src/engine/VolumeRenderer3d.js [566:647]


  setTransferFuncVec3(values, colorFlag) {
    if (this.matRenderToTexture !== null) {
      if (colorFlag === 0) {
        this.matRenderToTexture.uniforms.t_function1min.value = new THREE.Vector4(
          VOLUME_COLOR1_MIN_R,
          VOLUME_COLOR1_MIN_G,
          VOLUME_COLOR1_MIN_B,
          values[0]
        );
      } else {
        this.matRenderToTexture.uniforms.t_function1min.value = new THREE.Vector4(
          VOLUME_COLOR3_MIN_R,
          VOLUME_COLOR3_MIN_G,
          VOLUME_COLOR3_MIN_B,
          values[0]
        );
      }
      this.matRenderToTexture.uniforms.t_function1min.needsUpdate = true;
      this.matRenderToTexture.uniforms.t_function1max.value = new THREE.Vector4(
        VOLUME_COLOR1_MAX_R,
        VOLUME_COLOR1_MAX_G,
        VOLUME_COLOR1_MAX_B,
        values[1]
      );
      this.matRenderToTexture.uniforms.t_function1max.needsUpdate = true;
      this.matRenderToTexture.uniforms.t_function2min.value = new THREE.Vector4(
        VOLUME_COLOR2_MIN_R,
        VOLUME_COLOR2_MIN_G,
        VOLUME_COLOR2_MIN_B,
        values[2]
      );
      this.matRenderToTexture.uniforms.t_function2min.needsUpdate = true;
      this.matRenderToTexture.uniforms.t_function2max.value = new THREE.Vector4(
        VOLUME_COLOR2_MAX_R,
        VOLUME_COLOR2_MAX_G,
        VOLUME_COLOR2_MAX_B,
        values[2]
      );
      this.matRenderToTexture.uniforms.t_function2max.needsUpdate = true;
      this.matRenderToTexture.uniforms.stepSize.value = new THREE.Vector4(STEP_SIZE1, STEP_SIZE2, STEP_SIZE3, STEP_SIZE4);
      this.matRenderToTexture.uniforms.stepSize.needsUpdate = true;
      if (colorFlag === 0) {
        this.matVolumeRender.uniforms.t_function1min.value = new THREE.Vector4(
          VOLUME_COLOR1_MIN_R,
          VOLUME_COLOR1_MIN_G,
          VOLUME_COLOR1_MIN_B,
          values[0]
        );
      } else {
        this.matVolumeRender.uniforms.t_function1min.value = new THREE.Vector4(
          VOLUME_COLOR3_MIN_R,
          VOLUME_COLOR3_MIN_G,
          VOLUME_COLOR3_MIN_B,
          values[0]
        );
      }
      this.matVolumeRender.uniforms.t_function1min.needsUpdate = true;
      this.matVolumeRender.uniforms.t_function1max.value = new THREE.Vector4(
        VOLUME_COLOR1_MAX_R,
        VOLUME_COLOR1_MAX_G,
        VOLUME_COLOR1_MAX_B,
        values[1]
      );
      this.matVolumeRender.uniforms.t_function1max.needsUpdate = true;
      this.matVolumeRender.uniforms.t_function2min.value = new THREE.Vector4(
        VOLUME_COLOR2_MIN_R,
        VOLUME_COLOR2_MIN_G,
        VOLUME_COLOR2_MIN_B,
        values[2]
      );
      this.matVolumeRender.uniforms.t_function2min.needsUpdate = true;
      this.matVolumeRender.uniforms.t_function2max.value = new THREE.Vector4(
        VOLUME_COLOR2_MAX_R,
        VOLUME_COLOR2_MAX_G,
        VOLUME_COLOR2_MAX_B,
        values[2]
      );
      this.matVolumeRender.uniforms.t_function2max.needsUpdate = true;
      this.matVolumeRender.uniforms.stepSize.value = new THREE.Vector4(STEP_SIZE1, STEP_SIZE2, STEP_SIZE3, STEP_SIZE4);
      this.matVolumeRender.uniforms.stepSize.needsUpdate = true;
    }
  }