| 80 | } |
| 81 | |
| 82 | void StandardMaterial::Apply(Shaders::Shader* const shader) { |
| 83 | ShaderMaterial::Apply(shader); |
| 84 | |
| 85 | shader->SetUniform("material.tiling_factor", m_tile_factor); |
| 86 | shader->SetUniform("material.tint_color", m_tint_color); |
| 87 | |
| 88 | shader->SetUniform("material.diffuse", 0); |
| 89 | shader->SetUniform("material.specular", 1); |
| 90 | shader->SetUniform("material.shininess", m_shininess); |
| 91 | |
| 92 | shader->SetUniform("view_position", m_view_position); |
| 93 | |
| 94 | if (!m_light.expired()) { |
| 95 | const auto light = m_light.lock(); |
| 96 | |
| 97 | shader->SetUniform("light.position", light->GetPosition()); |
| 98 | shader->SetUniform("light.ambient", light->GetAmbientColor()); |
| 99 | shader->SetUniform("light.diffuse", light->GetDiffuseColor()); |
| 100 | shader->SetUniform("light.specular", light->GetSpecularColor()); |
| 101 | } |
| 102 | |
| 103 | m_texture->Bind(); |
| 104 | m_specular_map->Bind(1); |
| 105 | } |
| 106 | } // namespace ZEngine::Rendering::Materials |
nothing calls this directly
no test coverage detected