Update ShaderNode

This commit is contained in:
Jérôme Leclercq
2021-04-14 18:00:06 +02:00
parent 4bca87b1cb
commit a90937eb4f
52 changed files with 439 additions and 441 deletions

View File

@@ -181,8 +181,7 @@ void MainWindow::OnCompile()
{
try
{
auto shader = m_shaderGraph.ToShader();
shader.AddFunction("main", m_shaderGraph.ToAst());
auto shader = m_shaderGraph.ToAst();
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save shader"), QString(), tr("Shader Files (*.shader)"));
if (fileName.isEmpty())
@@ -192,7 +191,7 @@ void MainWindow::OnCompile()
fileName += ".shader";
Nz::File file(fileName.toStdString(), Nz::OpenMode_WriteOnly);
file.Write(Nz::SerializeShader(shader));
file.Write(Nz::ShaderAst::SerializeShader(shader));
}
catch (const std::exception& e)
{