Three.js ShaderMaterial exporting workaround?

Hello I’m still pretty new to Three.js, so forgive me if this is an obvious question. I’ve been lurking the boards for a while and can’t seem to find a defined answer for what I want.

So, I’ve currently been making a 3d mesh generator using threejs - in which I want to generate a plane and press a button to export the mesh, which will be used in another piece of software. I get a plane and move the Y vertices to generate a mesh. This has been pretty simple so far. However, I want to colour my mesh based on the Y values (kinda like a contour map), so I’ve managed to do this through THREE.ShaderMaterial using fragment and vertex shaders.

However, my problem lies with exporting this. So from previous threads, I’ve learnt that you can’t just export a 3D model with THREE.GLTFExporter with its materials. Is there any way around this? Is there a way to turn the material into a texture I can export alongside the 3D mesh with the GLTFExporter?

I’ve tried a workaround generating the Material using THREE.MeshStandardMaterial but I havent had a lot of luck with that either.