function paintFaces( geometry, radius, angles, colors, topDown ) {

			// compute threshold values

			const thresholds = [];
			const startAngle = ( topDown === true ) ? 0 : Math.PI;

			for ( let i = 0, l = colors.length; i < l; i ++ ) {

				let angle = ( i === 0 ) ? 0 : angles[ i - 1 ];
				angle = ( topDown === true ) ? angle : ( startAngle - angle );

				const point = new Vector3();
				point.setFromSphericalCoords( radius, angle, 0 );

				thresholds.push( point );

			}

			// generate vertex colors

			const indices = geometry.index;
			const positionAttribute = geometry.attributes.position;
			const colorAttribute = new BufferAttribute( new Float32Array( geometry.attributes.position.count * 3 ), 3 );

			const position = new Vector3();
			const color = new Color();

			for ( let i = 0; i < indices.count; i ++ ) {

				const index = indices.getX( i );
				position.fromBufferAttribute( positionAttribute, index );

				let thresholdIndexA, thresholdIndexB;
				let t = 1;

				for ( let j = 1; j < thresholds.length; j ++ ) {

					thresholdIndexA = j - 1;
					thresholdIndexB = j;

					const thresholdA = thresholds[ thresholdIndexA ];
					const thresholdB = thresholds[ thresholdIndexB ];

					if ( topDown === true ) {

						// interpolation for sky color

						if ( position.y <= thresholdA.y && position.y > thresholdB.y ) {

							t = Math.abs( thresholdA.y - position.y ) / Math.abs( thresholdA.y - thresholdB.y );

							break;

						}

					} else {

						// interpolation for ground color

						if ( position.y >= thresholdA.y && position.y < thresholdB.y ) {

							t = Math.abs( thresholdA.y - position.y ) / Math.abs( thresholdA.y - thresholdB.y );

							break;

						}

					}

				}

				const colorA = colors[ thresholdIndexA ];
				const colorB = colors[ thresholdIndexB ];

				color.copy( colorA ).lerp( colorB, t );

				ColorManagement.colorSpaceToWorking( color, SRGBColorSpace );

				colorAttribute.setXYZ( index, color.r, color.g, color.b );

			}

			geometry.setAttribute( 'color', colorAttribute );

		}
Vertically paints the faces interpolating between the
specified colors at the specified angels. This is used for the Background
node, but could be applied to other nodes with multiple faces as well.

When used with the Background node, default is directionIsDown is true if
interpolating the skyColor down from the Zenith. When interpolating up from
the Nadir i.e. interpolating the groundColor, the directionIsDown is false.

The first angle is never specified, it is the Zenith (0 rad). Angles are specified
in radians. The geometry is thought a sphere, but could be anything. The color interpolation
is linear along the Y axis in any case.

You must specify one more color than you have angles at the beginning of the colors array.
This is the color of the Zenith (the top of the shape).

@param {BufferGeometry} geometry
@param {number} radius
@param {array} angles
@param {array} colors
@param {boolean} topDown - Whether to work top down or bottom up.