             };

                material.onBeforeCompile = shader => {
                    shader.uniforms = Object.assign(shader.uniforms, uniforms);

                    shader.fragmentShader = shader.fragmentShader.replace(
                        'void main() {',
                        /* glsl */ `
                        uniform sampler2D thicknessMap;
                        uniform float thicknessDistortion;
                        uniform float thicknessAmbient;
                        uniform flo