Specular maps
While normal maps provide us with the possibility of faking how bumpy a surface is, specular maps allow us to do the same with the shininess of a surface. This is what the same segment of the tile sheet we used as an example for a normal map looks like in a specular map:
It's not as complex as a normal map, since it only needs to store one value: the shininess factor. We can leave it up to each light to decide how much shine it will cast upon the scenery by letting it have its own values:
struct LightBase { ... float m_specularExponent = 10.f; float m_specularStrength = 1.f; };
Adding support for specularity
Similar to normal maps, we need to use the material pass shader to render to a specularity buffer texture:
void Map::Redraw(sf::Vector3i l_from, sf::Vector3i l_to) { ... if (renderer->UseShader("MaterialPass")) { // Material pass. ... auto specMaterial = m_textureManager->GetResource( textureName + "_specular"); for (auto x...