/*
 * Adapted from Dice So Nice! 6.4.5 by Simone Ricciardi, JDW and contributors.
 * Upstream commit b365efc7433eb2db2ccbd91da2029ac6c8b78ed5.
 * Modified for the standalone Beranth’ahl lab on 2026-11-06.
 * GNU AGPL version 3.0; see LICENSE.md and UPSTREAM.md. No warranty.
 */
// Verbatim upstream shader method, preserved as a source reference.
	static iridescenceShaderFragment(shader) {
		// We only need to change the color channel used by the ThreeJS shader for the iridescenceMap from red to blue.
		// This is because we want to use the metallic channel for the iridescenceMap.
		shader.fragmentShader = shader.fragmentShader.replace(/* glsl */`#include <lights_physical_fragment>`,
			/* glsl */`#include <lights_physical_fragment>
				#ifdef USE_IRIDESCENCE
					material.iridescence = iridescence;
					#ifdef USE_IRIDESCENCEMAP
						material.iridescence *= texture2D( iridescenceMap, vUv ).b;
					#endif
				#endif`);
	}
