I've done a bit of work on the surfaces and materials. I've now added the ability for the engine to do metallic reflections. Here's a render:
Looks pretty good! It's only 100 passes and rendered in under four minutes (3:46 I think). But I thought it came up well. There were however, a couple of issues to deal with.
The two main issues here were the reflection and the normals (again!). Let's deal with the reflections first. In short, I searched around and found the ideal reflection algorithm - turns out it wasn't too difficult. But the mixing of the colours threw me out. I tried all sorts of things and kept getting black, until I realised I was doing the reflection at the wrong time and applying the values in the wrong way.
The second issue was a bit more complicated, though the fix was thankfully simple. I was using a rusted metal sphere texture set, obtained from an online free PBR texture repository. They provide textures for PBR engines (for example, to test with - like me here!). Link to the textures here.
But as I found out, the textures use a gamma curved normals map. It took me some hours to figure it out. But the fix was quite simple in the end. With the help of the new image library it was only a few lines of code to correct it. Working with colour data can be complicated. So glad this new image library can do what it can - it's been a really big help already.
Here's a comparison of the normals map with the gamma-affected normals on the left, and the corrected gamma curved normals on the right:
And here's how it looks in the beauty pass - the mirrored part of the sphere is where you'll see the difference - it's like the the reflection is twisted:
And, here's a reflective surface with blurriness:
While there's still a lot that can be done, for now, the only two things really left to do are to add in specular highlighting and refraction. And maybe height mapping. Once these two/three are implemented, I think there's enough in the engine to start thinking about making something with.
This project has really moved forward in the last month. Really happy with its progress.