I am getting a sense of the realism that can be created with PBR shading. To explore it properly, I want to properly follow the approach in the Maps and Materials chapter of the book - the Model object containing an array of Submesh objects which in turn contain material information.
There are times when it would be helpful to try a set of assets on a simple parametric mesh - A sphere or a plane perhaps. I have tried to adapt the initializer of the Model object with something like:
let allocator = MTKMeshBufferAllocator(device: device)
let mdlMesh = MDLMesh(sphereWithExtent: [0.5, 0.5, 0.5],
segments: [40, 40],
let mesh = try MTKMesh(mesh: mdlMesh, device: device)
This will not execute properly and it seems that the single Submesh I was hoping for doesn’t get properly initialized later in the function.
Could there be a way to successfully load a parametric mesh into a Model object and still keep the Renderer happy?
Thanks very much!,
I continue to enjoy all of the concepts presented in the book,