Given the current move to heavier utilization of Instanced Static Mesh Components, I was wondering about the support for Mesh Paint Textures on those components. Currently Mesh Paint Textures work great on standard actors, but when converted to ISMs either manually or through other Unreal methods (UWorldPartitionRuntimeCellTransformerISM or Packed Level Instances) that data is lost. Is there planned support for this feature in future versions of Unreal or should we create our own solution? Also if there is future support, is it planned to also be supported in the Fast Geo Streaming plugin?
Support for mesh paint textures on ISM is something that is in our backlog, but I can’t give any ETA or guarantees around the work being done. It almost certainly won’t be something that is worked on in the 5.7 time frame.
When we discussed this internally, the plan was to implement in two stages:
(i) Don’t support per instance ISM painting, but implement ISM support so that Cell Transformers and/or Packed Level Actors can work.
(ii) Add support for ISM per instance painting.
Note that we are unlikely to ever support overriding mesh painting on an existing Packed Level Actor. We would only support taking any existing mesh painting when creating a Packed Level Actor.
Internally we haven’t discussed whether this work would support Fast Geo. But I think we would consider it when implementing, and i don’t foresee big issues around that.
Thank you for the info. Yeah at this time we would be interested in the first one. We have static mesh actor content that we want to paint on and then gets converted into ISMs either through packed level instances or Cell Transformers.
We likely need this soon. Is this a large amount of work to get this working? We are considering doing the work ourselves. Any guidance you can give in this area would be greatly appreciated.
I think it’s a reasonable amount of work, but could be manageable depending on your appetite.
We currently store a single MeshPaintTexture in a static mesh component and a corresponding MeshPaintTextureDescriptor per static mesh (or nanite) scene proxy.
This is copied to the FPrimitiveSceneData on the GPUScene side for setting up sampling in shaders.
For ISM we would need to store an array of MeshPaintTextures on the component, and I think for CellTransformer/PLA they would need to be asset copies (not refs) from the original sources.
Then these would need to correspond to an array of MeshPaintTextureDescriptors in the ISM scene proxy, and you would need to load these descriptors into some per instance payload on the GPUScene side.
The shader functions in MeshPaintTextureCommon.ush would then resolve the per instance payload rather than the per primitive value.
Maybe that is enough to get you started looking around the code. Let me know if you have further questions.