Customise UVs per instance with Instanced Static Meshes
All instances of an Instanced Static Mesh Component must share the same material and mesh. Is it possible, however, to customise the rendering of the material on the instance in any way other than using the
To be more specific, I have a texture map that contains a number of different textures. I'd like to access the UV attributes applied to the instanced mesh so that I could render different textures on different instances through the same material. Is this possible at all?
For reference, and to clarify what I'm after, it seems that Unity supports something called MaterialPropertyBlocks, which allows you to pass custom data to the instances and access that data in the shader.
Thanks in advance for any information!
asked Oct 07 '16 at 08:54 AM in Rendering
I don't think you can add your own data to Per Instance parameters without modifying the engine, however, it should be relatively trivial to do, You should take a look at
However, if you do not want to dive into the code, you could describe the effect, you are trying to achieve. There might be a simple workaround for that.
answered Oct 07 '16 at 10:15 AM
For making unique instances I admit it's very interesting way. I also want to make many instances to move or change slightly but in current implementation of ISM I cannot.
Even if for unique shapes it's great idea I would rather stay with custom static mesh when generating voxels. It is possible to pass custom vertex value for each triangle which makes material setup very easy and flexible. I can read unique RGBA values for all faces I create.
So yeah in the end I am not even using all values but only A: FColor color = FColor(255, 255, 255, i); and only values 0-6 from it so 249 values are unused :D
answered Mar 03 '19 at 09:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here