Update ShaderNode

This commit is contained in:
Lynix
2020-05-19 20:06:32 +02:00
parent e23eb74802
commit effaa9b88f
17 changed files with 646 additions and 84 deletions

View File

@@ -0,0 +1,45 @@
#pragma once
#ifndef NAZARA_SHADERNODES_SHADERGRAPH_HPP
#define NAZARA_SHADERNODES_SHADERGRAPH_HPP
#include <Nazara/Core/Signal.hpp>
#include <Nazara/Renderer/ShaderAst.hpp>
#include <nodes/FlowScene>
#include <nodes/FlowView>
#include <string>
#include <vector>
class ShaderGraph
{
public:
struct TextureEntry;
ShaderGraph();
~ShaderGraph() = default;
void AddTexture(std::string name, Nz::ShaderAst::ExpressionType type);
Nz::ShaderAst::StatementPtr Generate();
inline QtNodes::FlowScene& GetScene();
inline const std::vector<TextureEntry>& GetTextures();
NazaraSignal(OnTextureListUpdate, ShaderGraph*);
struct TextureEntry
{
std::string name;
Nz::ShaderAst::ExpressionType type;
};
private:
std::shared_ptr<QtNodes::DataModelRegistry> BuildRegistry();
QtNodes::FlowScene m_flowScene;
std::vector<TextureEntry> m_textures;
};
#include <ShaderGraph.inl>
#endif