How would I access the albedo color of a given MeshInstance's mesh's surfaces inside a spatial shader?
As you can see I have 18 unique surfaces on this mesh, each with its own material (I generated this mesh procedurally and saved it, if I can host it somewhere and share the link here please suggest where I should host it).
I would like to apply a shader to the mesh, eventually taking the albedo of each surface and mapping the color value to one out of a collection of textures, and blending the differences between each tile (digression: this lets me use square tiling textures for irregularly/non-square shaped tiles, which is my purpose for writing this shader). I'm just not sure how to first get the surface's original albedo to the shader.
EDIT: also I've been using the material_override to apply the shader, how much does that override? The MeshInstance itself also has 18 empty material slots -- the current albedos are strictly from the mesh resource's surfaces.
EDIT2: The material engine actually has a built-in ability to add shaders on top of each other in succession called "Next Pass;" I didn't realize this. That answers the organizational aspect of the shaders, but I'm still confused about how to get the previous color into the new shader (without using discard, of course, since that just makes the shader transparent).
EDIT3: Doing some debugging on the mesh revealed I'm setting the UV coordinates incorrectly, it seems that the same UV value is being applied to the entire mesh. I've tried fiddling with the generator (which I discussed in my previous question) and I cannot figure out the proper use of the
Mesh.ARRAY_TEX_UV array. I wouldn't expect that to cause problems just passing a color to the next pass of the shader, though.