mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 13:01:19 +00:00
36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "resources/shader.h"
|
|
#include "resources/texture.h"
|
|
|
|
// a material is just a shader with assigned textures/parameters
|
|
|
|
namespace engine {
|
|
|
|
// copyable
|
|
class Material {
|
|
const std::shared_ptr<Shader> m_shader;
|
|
std::shared_ptr<Texture> m_texture_albedo;
|
|
std::shared_ptr<Texture> m_texture_normal;
|
|
std::shared_ptr<Texture> m_texture_occlusion_roughness_metallic;
|
|
const gfx::DescriptorSet* m_material_set = nullptr;
|
|
Renderer* const m_renderer;
|
|
|
|
public:
|
|
Material(Renderer* renderer, std::shared_ptr<engine::Shader> shader);
|
|
Material(const Material&) = delete;
|
|
|
|
~Material();
|
|
|
|
Material& operator=(const Material&) = delete;
|
|
|
|
void setAlbedoTexture(std::shared_ptr<Texture> texture);
|
|
void setNormalTexture(std::shared_ptr<Texture> texture);
|
|
void setOcclusionRoughnessMetallicTexture(std::shared_ptr<Texture> texture);
|
|
const gfx::DescriptorSet* getDescriptorSet() { return m_material_set; }
|
|
Shader* getShader() { return m_shader.get(); }
|
|
};
|
|
|
|
} // namespace engine
|