Hello experts, I'm trying to implement a material with custom shader code, but I saw that visionOS doesn't allow you to inject custom Metal functions or use CustomMaterial like iOS/macOS, nor can you directly write Metal Shading Language (.metal) and use it through ShaderGraphMaterial. So my question is, if i want to implement your own shader code, how should i do it?
How to customize shader code for visionos ?
Hi @jacob111
Composing your own shader code with ShaderGraph is the way to go for creating custom materials in visionOS. If you're running into specific issues expressing your shader code with ShaderGraph, please let me know and I'd be happy to help!
That being said, I did notice your other posts mentioning 3D Gaussian splatting, and if that's what you're working toward here I'd also like to point you in the direction of LowLevelMesh. This is a RealityKit API which allows you to create custom meshes and update them on the GPU using Metal compute shaders, which would enable you to write some custom Metal shader code to update the vertex positions, normals, colors, etc. of your mesh.
I'd also suggest taking a look at the new MeshInstancesComponent as another option!