I am new to metal, and am trying to move a material normal texture by an offset while also taking advantage of metal's geometry modifier. When I was using a PhysicallyBasedMaterial I was using this function in the session function in the ViewController:
waterMaterial.textureCoordinateTransform.offset.x += 0.0001
The normal is a png. This would move the texture every frame. Now that I'm using a CustomMaterial to take advantage of a geometryModifier this is no longer working. I can see the texture and am using the shader successfully but the texture itself is not moving. I assume I need to do this in my metal shader file. Possibly starting in this direction:
[[visible]]
void moveTexture(realitykit::geometry_parameters params)
{
auto normal = params.textures().normal();
}
Any help replicating the above functionality in metal would be much appreciated.