Improving Material shader code generation

This commit is contained in:
Dynamitos
2020-09-19 14:36:50 +02:00
parent 6814587b54
commit facbfed79c
72 changed files with 1049 additions and 329 deletions
+5 -1
View File
@@ -5,9 +5,11 @@
using namespace Seele;
MaterialLoader::MaterialLoader(Gfx::PGraphics graphics)
: graphics(graphics)
{
placeholderMaterial = new Material("shaders/Placeholder.semat");
placeholderMaterial = new Material(std::filesystem::absolute("./shaders/Placeholder.asset"));
placeholderMaterial->compile();
graphics->getShaderCompiler()->registerMaterial(placeholderMaterial);
}
MaterialLoader::~MaterialLoader()
@@ -17,6 +19,8 @@ MaterialLoader::~MaterialLoader()
PMaterial MaterialLoader::queueAsset(const std::filesystem::path& filePath)
{
PMaterial result = new Material(filePath);
result->compile();
graphics->getShaderCompiler()->registerMaterial(result);
// TODO: There is actually no real reason to import a standalone material,
// maybe in the future there could be a substance loader or something
return result;