engine/include/resources/material.h
2024-03-31 11:11:22 +01:00

37 lines
1022 B
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 {
public:
Material(Renderer* renderer, std::shared_ptr<engine::Shader> shader);
~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 material_set_; }
Shader* GetShader() { return shader_.get(); }
private:
const std::shared_ptr<Shader> shader_;
std::shared_ptr<Texture> texture_albedo_;
std::shared_ptr<Texture> texture_normal_;
std::shared_ptr<Texture> texture_occlusion_roughness_metallic_;
const gfx::DescriptorSet* material_set_ = nullptr;
Renderer* const renderer_;
};
} // namespace engine