Extending Instanced Static Mesh Component for texture atlas support

In summary: I’m trying to figure out how to use the UInstancedStaticMeshComponent in such a way that I could use a texture atlas on the material assigned to the instanced mesh, and I need some input.

I’m building a turn based strategy game (not totally unlike the example project), and I want to procedurally generate the environment. The game world will consist of objects, most of which will have a very simple mesh (e.g. a piece of wall). For these I’d like to re-use the mesh and simply render a different texture based on the type of wall to get the performance I need. To give you a ballpark figure I expect that a single level might include tens or even hundreds of thousands of these objects.

I can’t use different materials for different instances, but I think it should be possible to create a texture atlas and simply sample different parts of that per instance to achieve the same effect. The problem is that I can’t pass any custom information to the instance that I could then reference in the material to determine which part of the atlas to sample.

The Turn Based Strategy example project uses the PerInstanceRandom constant to sample its atlas, but I need more control than that.

I asked this question on the Answer Hub earlier today, and based on the answer I received I spent some time reading through the engine sources. From this I figured out that the reason it is not possible to directly access the vertex buffers of the instanced meshes is (probably) due to the LOD support (i.e. vertices are dynamically created based on the LOD at run time).

I think it should be possible to somehow pass enough info to the instance vertices to be able to sample the correct part of the texture in the material, but I could do with some discussion and pointers as how to approach this. I think reusing the PerInstanceRandom value (i.e. being able to force set the value) or encoding the data in to the vertex colours might do the trick? I tried a naive approach, extending the stock ISMC and overriding the virtual CreateSceneProxy method, but couldn’t get far enough due to many of the related structs being private to the engine.

So, my questions are: Is this feasible? Any glaring errors? Has someone actually done something to this effect already? How would you go about this?

Thanks in advance!