Improving Material shader code generation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user