Okay, I have found a solution to the problem, and it doesn’t create sharp transitions, but it does allow for multiple materials on the same mesh (with limitations, of course).
So how I went about this is using the “masking” method explained by @roc4u1000 (thanks for all your help btw, you’re a legend!), and kind of forcing the chunks to have a maximum of 4 textures each, and blending between them using the RGBA channels of each vertex, where a value of 255 (or 1 in the case of floats) for a certain channel corresponds to a certain material being active on that vertex. Each vertex can only have one of the 4 materials at a time, so the possible range of values is (0, 0, 0, 0) for air, (255, 0, 0, 0) for material 1, (0, 255, 0, 0) for material 2, (0, 0, 255, 0) for material 3 and (0, 0, 0, 255) for material 4. What this allows is the blending of each material without going through multiple other textures, which was causing the transitioning issue earlier, and has the side-benefit of creating a smooth transition.
To go more in-depth on how it works, when the “material” of a vertex within a chunk is changed, it adds it to an array the code can index later on, and sets one of the textures within the shader to that “material” (which is, just to re-iterate, a Texture2D). If all material slots are taken up and another one wants to be added, it will just be thrown away and won’t make any changes. (note that this could be changed with another custom Vector4 parameter, which could allow up to 8 or even 16, but I feel it’s a bit overkill and unneeded)
The “master” material that each chunk gets is duplicated, since you can’t have instance-based Texture2D parameters, which may cause performance issues if you have too much on screen (maybe?) but i’m not sure. I haven’t had any issues with it yet.
So, here’s the shader code if anyone is looking for it:
And sorta just re-iterate the principle behind the multi-material thing
Also thanks for reading, and thank you to everyone above who helped!
The final product with 2 materials:
and with 3 materials: