Skip to content

Commit 3d797a9

Browse files
[ShaderGraph] Simple editor
1 parent 8dc2258 commit 3d797a9

12 files changed

Lines changed: 981 additions & 13 deletions

File tree

Engine/Source/Sandbox/Private/Sandbox/Sandbox.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "Sandbox/Window/DebugToolsPanel.h"
3030
#include "Sandbox/Window/AssetRegistryPanel.h"
3131
#include "Sandbox/Window/Animation/AnimationGraphEditorPanel.h"
32+
#include "Sandbox/Window/ShaderGraph/ShaderGraphEditorPanel.h"
3233

3334
#include "Sandbox/SceneRendererExtensions/GridSceneRendererExtension.h"
3435
#include "Sandbox/SceneRendererExtensions/OutlineSceneRendererExtension.h"
@@ -232,6 +233,7 @@ void Sandbox::RegisterPanels()
232233
EditorLibrary::RegisterWithType<SkeletonEditorPanel>("Animation", AssetTypes::Skeleton);
233234
EditorLibrary::RegisterWithType<AnimationEditorPanel>("Animation", AssetTypes::Animation);
234235
EditorLibrary::RegisterWithType<AnimationGraphEditorPanel>("Animation", AssetTypes::AnimationGraph);
236+
EditorLibrary::RegisterWithType<ShaderGraphEditorPanel>("Animation", AssetTypes::ShaderGraph);
235237

236238
m_assetBrowserPanel = EditorLibrary::Register<AssetBrowserPanel>("Asset Browser", m_runtimeScene, "##Main");
237239

Engine/Source/Sandbox/Private/Sandbox/Window/AssetBrowser/AssetBrowserPanel.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
#include <Volt-Physics/PhysicsMaterialAsset.h>
3333

34+
#include <Volt-ShaderGraph/ShaderGraphAsset.h>
35+
3436
#include <CoreModule/Project/ProjectManager.h>
3537

3638
#include <FileSystemModule/Filesystem.h>
@@ -753,9 +755,9 @@ void AssetBrowserPanel::RenderWindowRightClickPopup()
753755
CreateNewAssetInCurrentDirectory(AssetTypes::Material);
754756
}
755757

756-
if (ImGui::MenuItem("Mosaic Graph"))
758+
if (ImGui::MenuItem("Shader Graph"))
757759
{
758-
CreateNewAssetInCurrentDirectory(AssetTypes::Material);
760+
CreateNewAssetInCurrentDirectory(AssetTypes::ShaderGraph);
759761
}
760762

761763
if (ImGui::MenuItem("Post Processing Stack"))
@@ -1163,6 +1165,7 @@ void AssetBrowserPanel::CreateNewAssetInCurrentDirectory(AssetType type)
11631165
uint32_t i = 0;
11641166

11651167
if (type == AssetTypes::Material) originalName = "M_NewMaterial";
1168+
if (type == AssetTypes::ShaderGraph) originalName = "S_NewShaderGraph";
11661169
if (type == AssetTypes::PhysicsMaterial) originalName = "PM_NewPhysicsMaterial";
11671170
if (type == AssetTypes::Scene) originalName = "SC_NewScene";
11681171
if (type == AssetTypes::BlendSpace) originalName = "BS_NewBlendSpace";
@@ -1195,6 +1198,10 @@ void AssetBrowserPanel::CreateNewAssetInCurrentDirectory(AssetType type)
11951198
{
11961199
g_assetManager->CreateAssetAndFile<Volt::BlendSpace>(g_assetManager->GetRelativeAssetFilepath(myCurrentDirectory->path), tempName);
11971200
}
1201+
else if (type == AssetTypes::ShaderGraph)
1202+
{
1203+
g_assetManager->CreateAssetAndFile<Volt::ShaderGraphAsset>(g_assetManager->GetRelativeAssetFilepath(myCurrentDirectory->path), tempName);
1204+
}
11981205

11991206
Reload();
12001207

0 commit comments

Comments
 (0)