2022-08-19 04:20:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "texture.h"
|
|
|
|
|
2022-09-22 04:11:12 +00:00
|
|
|
#include <assimp/material.h>
|
2022-09-27 03:43:08 +00:00
|
|
|
|
2022-09-22 04:11:12 +00:00
|
|
|
#include <unordered_map>
|
2022-09-27 03:43:08 +00:00
|
|
|
#include <memory>
|
2022-08-19 04:20:53 +00:00
|
|
|
|
|
|
|
namespace simpleengine::gfx {
|
|
|
|
class Material {
|
|
|
|
public:
|
2022-09-27 03:43:08 +00:00
|
|
|
std::unordered_map<aiTextureType, std::vector<std::shared_ptr<Texture>>> textures;
|
2022-08-19 04:20:53 +00:00
|
|
|
|
2022-09-28 12:04:24 +00:00
|
|
|
float ambient_strength;
|
|
|
|
float diffuse_strength;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This strengthens the brightness of a specular highlight.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
float specular_strength;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The shininess value of the highlight. (Radius of specular highlight?)
|
|
|
|
|
|
|
|
* The higher the shininess value of an object, the more it properly reflects the light
|
|
|
|
* instead of scattering it all around and thus the smaller the highlight becomes.
|
|
|
|
*
|
|
|
|
* The shader multiplies this by 32 to get the specular highlight.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
float shine_factor;
|
|
|
|
|
2022-10-02 15:39:07 +00:00
|
|
|
Material(std::unordered_map<aiTextureType, std::vector<std::shared_ptr<Texture>>> textures, float shine = 1.f, float specular_scalar = 1.f, float ambient_scalar = 1.f, float diffuse_scalar = 1.f) :
|
2022-09-28 12:04:24 +00:00
|
|
|
textures(textures), ambient_strength(ambient_scalar), diffuse_strength(diffuse_scalar), specular_strength(specular_scalar),
|
|
|
|
shine_factor(shine) {
|
2022-08-19 04:20:53 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|