diff --git a/GigiEdit/MakeUI.h b/GigiEdit/MakeUI.h
index 03a493df..ad69e2c0 100644
--- a/GigiEdit/MakeUI.h
+++ b/GigiEdit/MakeUI.h
@@ -1598,8 +1598,15 @@ inline UIOverrideResult ShowUIOverride(RenderGraph& renderGraph, uint64_t _FLAGS
inline UIOverrideResult ShowUIOverride(RenderGraph& renderGraph, uint64_t _FLAGS, bool& dirtyFlag, const char* label, const char* tooltip, std::string& value, TypePathEntry path, ShowUIOverrideContext showUIOverrideContext)
{
+ // Show "Dflt" as "Default" in the editor, instead.
+ // default is a reserved word so we couldn't use it, but we can show it as a friendlier label!
+ if (!_stricmp(label, "Dflt"))
+ {
+ dirtyFlag |= ShowUI(renderGraph, "Default", tooltip, value, path);
+ return UIOverrideResult::Finished;
+ }
// Show a variable drop down for SubGraphVariableSettings.ReplaceWithStr, and call it "Replace With" instead.
- if (!_stricmp(label, "Replace With Str"))
+ else if (!_stricmp(label, "Replace With Str"))
{
VariableReference dummyRef;
dummyRef.name = value;
diff --git a/GigiEdit/main.cpp b/GigiEdit/main.cpp
index 5962bd25..a48df82f 100644
--- a/GigiEdit/main.cpp
+++ b/GigiEdit/main.cpp
@@ -80,6 +80,8 @@ bool g_openPreviewWindowPaused = false;
ed::NodeId g_contextMenuNodeId;
ed::LinkId g_contextMenuLinkId;
+int g_createdNodeIndex = -1;
+
struct DataWindowState
{
bool show = true;
@@ -732,10 +734,11 @@ struct Example :
// very useful during development (e.g. find examples, find style name or tweak theme),
// could be compiled out in Release
+ #ifdef _DEBUG
ImGui::MenuItem("ImGui Demo", nullptr, &imguiDemoOpen);
ImGui::MenuItem("Struct Parser Test", nullptr, &structParserTest);
-
ImGui::Separator();
+ #endif
if (ImGui::MenuItem("Exit"))
{
@@ -2090,6 +2093,12 @@ struct Example :
ShowNodePropertiesWindow();
ShowNodesWindow();
+ if (g_createdNodeIndex != -1 && ed::NodeExists(g_createdNodeIndex))
+ {
+ ed::SelectNode(g_createdNodeIndex);
+ g_createdNodeIndex = -1;
+ }
+
ImGui::Begin("Graph");
ed::Begin("Graph", ImVec2(0.0, 0.0f));
@@ -2511,6 +2520,7 @@ struct Example :
ImGui::EndPopup();
}
+
if (ImGui::BeginPopup("Create New Node"))
{
auto newNodePostion = openPopupPosition;
@@ -2519,20 +2529,14 @@ struct Example :
ImGui::Separator();
- ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 0, 255));
-
- // to put separator between resources and actions
- // -1:action, 0:unknown, 1:resource
- int newType = 0, lastType = 0;
-
#include "external/df_serialize/_common.h"
#define VARIANT_SEP()
#define VARIANT_TYPE(_TYPE, _NAME, _DEFAULT, _DESCRIPTION) \
- newType = _TYPE::c_isResourceNode ? 1 : -1;\
- if(lastType && lastType != newType)\
- ImGui::Separator();\
- lastType = newType;\
- if (_TYPE::c_showInEditor && ImGui::MenuItem(#_NAME)) \
+ if (_TYPE::c_isResourceNode) \
+ ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(128, 128, 255, 255)); \
+ else \
+ ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 128, 64, 255)); \
+ if (_TYPE::c_showInEditor && ImGui::MenuItem(_TYPE::c_editorName.c_str())) \
{ \
char newNodeName[64]; \
int nextNodeIndex = 0; \
@@ -2558,14 +2562,14 @@ struct Example :
g_renderGraph.nodes.push_back(newNode); \
m_newNodePositions[(int)g_renderGraph.nodes.size()] = newNodePostion; \
g_renderGraphDirty = true; \
- }
+ g_createdNodeIndex = (int)g_renderGraph.nodes.size(); \
+ } \
+ ImGui::PopStyleColor();
// clang-format off
#include "external/df_serialize/_fillunsetdefines.h"
#include "Schemas/RenderGraphNodesVariant.h"
// clang-format on
- ImGui::PopStyleColor();
-
ImGui::EndPopup();
}
ed::Resume();
diff --git a/GigiViewerDX12/main.cpp b/GigiViewerDX12/main.cpp
index 6f56f817..def0afbb 100644
--- a/GigiViewerDX12/main.cpp
+++ b/GigiViewerDX12/main.cpp
@@ -340,6 +340,8 @@ struct ResourceViewState
{
void Texture(int _nodeIndex, int _resourceIndex, RuntimeTypes::ViewableResource::Type textureType)
{
+ StoreLast();
+
type = textureType;
nodeIndex = _nodeIndex;
resourceIndex = _resourceIndex;
@@ -347,6 +349,8 @@ struct ResourceViewState
void ConstantBuffer(int _nodeIndex, int _resourceIndex)
{
+ StoreLast();
+
type = RuntimeTypes::ViewableResource::Type::ConstantBuffer;
nodeIndex = _nodeIndex;
resourceIndex = _resourceIndex;
@@ -354,15 +358,31 @@ struct ResourceViewState
void Buffer(int _nodeIndex, int _resourceIndex)
{
+ StoreLast();
+
type = RuntimeTypes::ViewableResource::Type::Buffer;
nodeIndex = _nodeIndex;
resourceIndex = _resourceIndex;
}
+ void ViewLast()
+ {
+ if (nodeIndex == -1 || lastNodeIndex == -1 || resourceIndex == -1 || lastResourceIndex == -1)
+ return;
+
+ std::swap(type, lastType);
+ std::swap(nodeIndex, lastNodeIndex);
+ std::swap(resourceIndex, lastResourceIndex);
+ }
+
RuntimeTypes::ViewableResource::Type type = RuntimeTypes::ViewableResource::Type::Texture2D;
int nodeIndex = -1;
int resourceIndex = -1;
+ RuntimeTypes::ViewableResource::Type lastType = RuntimeTypes::ViewableResource::Type::Texture2D;
+ int lastNodeIndex = -1;
+ int lastResourceIndex = -1;
+
int mousePosX = 0;
int mousePosY = 0;
int mouseClickX = 0;
@@ -372,6 +392,14 @@ struct ResourceViewState
float systemVarMouse[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
float systemVarMouseState[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
float systemVarMouseStateLastFrame[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+
+private:
+ void StoreLast()
+ {
+ lastType = type;
+ lastNodeIndex = nodeIndex;
+ lastResourceIndex = resourceIndex;
+ }
};
static ResourceViewState g_resourceView;
@@ -409,7 +437,6 @@ std::string g_commandLineLoadGGFileName;
std::string g_runPyFileName;
int g_syncInterval = 1;
-bool g_vsync = true;
bool g_debugLayerOn = DX12_VALIDATION_ON_BY_DEFAULT();
bool g_debugLayerShown = DX12_VALIDATION_LOG_ON_BY_DEFAULT();
bool g_GPUValidation = DX12_GPUVALIDATION_ON_BY_DEFAULT();
@@ -671,7 +698,6 @@ void SaveGGUserFile()
ggUserData.resourceViewType = (int)g_resourceView.type;
ggUserData.resourceViewNodeIndex = g_resourceView.nodeIndex;
ggUserData.resourceViewResourceIndex = g_resourceView.resourceIndex;
- ggUserData.vsync = g_vsync;
ggUserData.syncInterval = g_syncInterval;
for (const auto& it : g_interpreter.m_importedResources)
ggUserData.importedResources.push_back(ImportedResourceDesc_To_GGUserFile_ImportedResource(it.first, it.second, renderGraphDir));
@@ -767,7 +793,6 @@ GGUserFile LoadGGUserFile()
g_resourceView.type = (RuntimeTypes::ViewableResource::Type)ggUserData.resourceViewType;
g_resourceView.nodeIndex = ggUserData.resourceViewNodeIndex;
g_resourceView.resourceIndex = ggUserData.resourceViewResourceIndex;
- g_vsync = ggUserData.vsync;
g_syncInterval = ggUserData.syncInterval;
g_interpreter.m_importedResources.clear();
for (const GGUserFile_ImportedResource& inDesc : ggUserData.importedResources)
@@ -1061,23 +1086,26 @@ void HandleMainMenu()
ImGui::MenuItem("DX12 Capabilities", "", &g_showCapsWindow);
+ #ifdef _DEBUG
ImGui::Separator();
-
ImGui::MenuItem("ImGui Demo Window", "", &show_demo_window);
//ImGui::MenuItem("ImGui Simple Window", "", &show_simple_window);
//ImGui::MenuItem("ImGui Other Window", "", &show_another_window);
+ #endif
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Settings"))
{
- ImGui::MenuItem("VSync", "", &g_vsync);
-
if (ImGui::BeginMenu("Sync Interval"))
{
bool selected = false;
+ selected = (g_syncInterval == 0);
+ if (ImGui::MenuItem("0 (VSync Off)", "", &selected))
+ g_syncInterval = 0;
+
selected = (g_syncInterval == 1);
if (ImGui::MenuItem("1 (Full FPS)", "", &selected))
g_syncInterval = 1;
@@ -5257,6 +5285,13 @@ void ShowResourceView()
}
}
+ if (!g_hideUI)
+ {
+ ImGui::SameLine();
+ if (ImGui::Button("A/B"))
+ g_resourceView.ViewLast();
+ }
+
if (!g_hideUI)
{
const char* typeLabel = "";
@@ -5272,7 +5307,7 @@ void ShowResourceView()
ImGui::Text("%s: %s", typeLabel, res.m_displayName.empty() ? nodeName.c_str() : res.m_displayName.c_str());
// ImGui::SameLine();
- if (ImGui::Button("Copy Name To ClipBoard"))
+ if (ImGui::Button("Copy Name"))
SetClipboardDataEx(CF_TEXT, (void*)res.m_displayName.c_str(), (DWORD)res.m_displayName.length() + 1);
}
@@ -5301,7 +5336,7 @@ void ShowResourceView()
static bool saveAllVertically = false;
ImGui::SameLine();
- if (ImGui::Button("Copy Image To ClipBoard"))
+ if (ImGui::Button("Copy Image"))
{
CopyImageToClipBoard(res.m_resourceReadback, formatInfo, res.m_size[0], res.m_size[1], res.m_size[2], imageZ);
}
@@ -5566,6 +5601,14 @@ void ShowResourceView()
ImGui::SetNextItemWidth(50.0f);
ImGui::InputFloat("Zoom", &g_imageZoom);
+ ImGui::SameLine();
+ if (ImGui::Button("Fit"))
+ {
+ float scaleX = g_contentRegionSize.x / (float)res.m_size[0];
+ float scaleY = g_contentRegionSize.y / (float)res.m_size[1];
+ g_imageZoom = std::min(scaleX, scaleY);
+ }
+
ImGui::SameLine();
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
ImGui::SameLine();
@@ -6114,7 +6157,7 @@ class Python : public PythonInterface
void SetVSync(bool set) override final
{
- g_vsync = set;
+ g_syncInterval = set ? 1 : 0;
}
void SetSyncInterval(int syncInterval) override final
@@ -7021,7 +7064,7 @@ void RenderFrame(bool forceExecute)
ImGui::RenderPlatformWindowsDefault(NULL, (void*)g_pd3dCommandList);
}
- g_pSwapChain->Present((g_vsync && !g_profileMode) ? g_syncInterval : 0, 0);
+ g_pSwapChain->Present((!g_profileMode) ? g_syncInterval : 0, 0);
UINT64 fenceValue = g_fenceLastSignaledValue + 1;
g_pd3dCommandQueue->Signal(g_fence, fenceValue);
diff --git a/Install.nsi b/Install.nsi
index 3f2fd8ef..09aae540 100644
--- a/Install.nsi
+++ b/Install.nsi
@@ -3,6 +3,7 @@
!include "MUI2.nsh"
!include "logiclib.nsh"
+ !include "x64.nsh"
;--------------------------------
; Custom defines
@@ -10,7 +11,7 @@
!define DESCRIPTION "Rapid Graphics Development Platform"
!define VERSIONMAJOR 0
!define VERSIONMINOR 99
- !define VERSIONBUILD 0
+ !define VERSIONBUILD 1
!define SLUG "${APPNAME} v${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
@@ -24,7 +25,7 @@
Name "${APPNAME}"
OutFile "Gigi-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.x64.windows.installer.exe"
- InstallDir "$PROGRAMFILES\${APPNAME}"
+ InstallDir "$PROGRAMFILES64\${APPNAME}"
InstallDirRegKey HKCU "Software\${APPNAME}" ""
RequestExecutionLevel admin
diff --git a/Schemas/PreviewWindow/PreviewWindowSchemas.h b/Schemas/PreviewWindow/PreviewWindowSchemas.h
index 499880c8..d8594feb 100644
--- a/Schemas/PreviewWindow/PreviewWindowSchemas.h
+++ b/Schemas/PreviewWindow/PreviewWindowSchemas.h
@@ -179,7 +179,6 @@ STRUCT_BEGIN(GGUserFile, "The contents of a .gguser file")
STRUCT_FIELD(int, resourceViewType, 0, "The type of resource being viewed", 0)
STRUCT_FIELD(int, resourceViewNodeIndex, -1, "The index of the node bieng viewed", 0)
STRUCT_FIELD(int, resourceViewResourceIndex, -1, "The index of that resource within that node being used", 0)
- STRUCT_FIELD(bool, vsync, true, "Whether or not vsync is on", 0)
STRUCT_FIELD(int, syncInterval, true, "IDXGISwapChain::Present() parameter: Synchronize presentation after the nth vertical blank.", 0)
STRUCT_DYNAMIC_ARRAY(GGUserFile_ImportedResource, importedResources, "", 0)
STRUCT_DYNAMIC_ARRAY(GGUserFile_SavedVariable, savedVariables, "", 0)
diff --git a/Schemas/RenderGraphNodes.h b/Schemas/RenderGraphNodes.h
index 6e285a16..23ccc0b3 100644
--- a/Schemas/RenderGraphNodes.h
+++ b/Schemas/RenderGraphNodes.h
@@ -286,6 +286,7 @@ STRUCT_END()
//========================================================
STRUCT_INHERIT_BEGIN(RenderGraphNode_Resource_Buffer, RenderGraphNode_ResourceBase, "Declares a buffer")
+ STRUCT_CONST(std::string, c_editorName, "Buffer", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Buffer", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Buff", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -296,6 +297,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Resource_Buffer, RenderGraphNode_ResourceBa
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Resource_ShaderConstants, RenderGraphNode_ResourceBase, "Declares a shader constant buffer")
+ STRUCT_CONST(std::string, c_editorName, "Constants", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Constants", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Const", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, false, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -306,6 +308,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Resource_ShaderConstants, RenderGraphNode_R
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Resource_Texture, RenderGraphNode_ResourceBase, "Declares a texture")
+ STRUCT_CONST(std::string, c_editorName, "Texture", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Texture", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Tex", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -325,6 +328,7 @@ STRUCT_END()
//========================================================
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_ComputeShader, RenderGraphNode_ActionBase, "Executes a compute shader")
+ STRUCT_CONST(std::string, c_editorName, "Compute Shader", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Compute", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "CS", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -337,6 +341,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_ComputeShader, RenderGraphNode_Actio
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_RayShader, RenderGraphNode_ActionBase, "Executes a dispatch rays shader")
+ STRUCT_CONST(std::string, c_editorName, "Ray Gen Shader", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "RayGen", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "RGS", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -352,6 +357,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_RayShader, RenderGraphNode_ActionBas
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_CopyResource, RenderGraphNode_ActionBase, "Copies a resource to another resource")
+ STRUCT_CONST(std::string, c_editorName, "Copy Resource", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Copy", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Copy", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -361,6 +367,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_CopyResource, RenderGraphNode_Action
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_DrawCall, RenderGraphNode_ActionBase, "Rasterization")
+ STRUCT_CONST(std::string, c_editorName, "Draw Call", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Draw", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Draw", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -428,6 +435,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_DrawCall, RenderGraphNode_ActionBase
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_SubGraph, RenderGraphNode_ActionBase, "Runs another Gigi technique")
+ STRUCT_CONST(std::string, c_editorName, "Subgraph", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Subgraph", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Sub", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
@@ -443,6 +451,7 @@ STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_SubGraph, RenderGraphNode_ActionBase
STRUCT_END()
STRUCT_INHERIT_BEGIN(RenderGraphNode_Action_Barrier, RenderGraphNode_ActionBase, "Causes all input operations to be executed before anything plugged into the output")
+ STRUCT_CONST(std::string, c_editorName, "Barrier", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shortTypeName, "Barrier", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(std::string, c_shorterTypeName, "Bar", "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
STRUCT_CONST(bool, c_showInEditor, true, "Used by the editor.", SCHEMA_FLAG_NO_SERIALIZE)
diff --git a/UserDocumentation/GigiEditor.docx b/UserDocumentation/GigiEditor.docx
index 1bb781aa..2f094174 100644
Binary files a/UserDocumentation/GigiEditor.docx and b/UserDocumentation/GigiEditor.docx differ
diff --git a/UserDocumentation/GigiEditor.pdf b/UserDocumentation/GigiEditor.pdf
new file mode 100644
index 00000000..2ab1eae4
Binary files /dev/null and b/UserDocumentation/GigiEditor.pdf differ
diff --git a/UserDocumentation/GigiShaders_Documentation.docx b/UserDocumentation/GigiShaders_Documentation.docx
index 5dcd0943..9fc037b7 100644
Binary files a/UserDocumentation/GigiShaders_Documentation.docx and b/UserDocumentation/GigiShaders_Documentation.docx differ
diff --git a/UserDocumentation/GigiShaders_Documentation.pdf b/UserDocumentation/GigiShaders_Documentation.pdf
new file mode 100644
index 00000000..544e431f
Binary files /dev/null and b/UserDocumentation/GigiShaders_Documentation.pdf differ
diff --git a/UserDocumentation/GigiViewerDX12_Documentation.pdf b/UserDocumentation/GigiViewerDX12_Documentation.pdf
new file mode 100644
index 00000000..7c9d5dc7
Binary files /dev/null and b/UserDocumentation/GigiViewerDX12_Documentation.pdf differ
diff --git a/UserDocumentation/UnrealTips.pdf b/UserDocumentation/UnrealTips.pdf
new file mode 100644
index 00000000..ad7485cf
Binary files /dev/null and b/UserDocumentation/UnrealTips.pdf differ
diff --git a/external/imgui-node-editor/imgui_node_editor.h b/external/imgui-node-editor/imgui_node_editor.h
index 3b586462..798f6b34 100644
--- a/external/imgui-node-editor/imgui_node_editor.h
+++ b/external/imgui-node-editor/imgui_node_editor.h
@@ -369,6 +369,8 @@ IMGUI_NODE_EDITOR_API void SelectLink(LinkId linkId, bool append = false);
IMGUI_NODE_EDITOR_API void DeselectNode(NodeId nodeId);
IMGUI_NODE_EDITOR_API void DeselectLink(LinkId linkId);
+IMGUI_NODE_EDITOR_API bool NodeExists(NodeId nodeId);
+
IMGUI_NODE_EDITOR_API bool DeleteNode(NodeId nodeId);
IMGUI_NODE_EDITOR_API bool DeleteLink(LinkId linkId);
diff --git a/external/imgui-node-editor/imgui_node_editor_api.cpp b/external/imgui-node-editor/imgui_node_editor_api.cpp
index c8c7c3ff..e69fe039 100644
--- a/external/imgui-node-editor/imgui_node_editor_api.cpp
+++ b/external/imgui-node-editor/imgui_node_editor_api.cpp
@@ -530,6 +530,11 @@ void ax::NodeEditor::DeselectLink(LinkId linkId)
s_Editor->DeselectObject(link);
}
+bool ax::NodeEditor::NodeExists(NodeId nodeId)
+{
+ return s_Editor->FindNode(nodeId) != nullptr;
+}
+
bool ax::NodeEditor::DeleteNode(NodeId nodeId)
{
if (auto node = s_Editor->FindNode(nodeId))
diff --git a/gigihelp.html b/gigihelp.html
index 8d77c34e..3952862e 100644
--- a/gigihelp.html
+++ b/gigihelp.html
@@ -1044,6 +1044,7 @@
Structs
RenderGraphNode_Resource_Buffer : Declares a buffer
RenderGraphNode_Resource_Buffer - Inherits from RenderGraphNode_ResourceBase |
+inline static const std::string c_editorName | "Buffer" | Used by the editor. |
inline static const std::string c_shortTypeName | "Buffer" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Buff" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1056,6 +1057,7 @@ Structs
RenderGraphNode_Resource_ShaderConstants : Declares a shader constant buffer
RenderGraphNode_Resource_ShaderConstants - Inherits from RenderGraphNode_ResourceBase |
+inline static const std::string c_editorName | "Constants" | Used by the editor. |
inline static const std::string c_shortTypeName | "Constants" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Const" | Used by the editor. |
inline static const bool c_showInEditor | false | Used by the editor. |
@@ -1067,6 +1069,7 @@ Structs
RenderGraphNode_Resource_Texture : Declares a texture
RenderGraphNode_Resource_Texture - Inherits from RenderGraphNode_ResourceBase |
+inline static const std::string c_editorName | "Texture" | Used by the editor. |
inline static const std::string c_shortTypeName | "Texture" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Tex" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1083,6 +1086,7 @@ Structs
RenderGraphNode_Action_ComputeShader : Executes a compute shader
RenderGraphNode_Action_ComputeShader - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Compute Shader" | Used by the editor. |
inline static const std::string c_shortTypeName | "Compute" | Used by the editor. |
inline static const std::string c_shorterTypeName | "CS" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1096,6 +1100,7 @@ Structs
RenderGraphNode_Action_RayShader : Executes a dispatch rays shader
RenderGraphNode_Action_RayShader - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Ray Gen Shader" | Used by the editor. |
inline static const std::string c_shortTypeName | "RayGen" | Used by the editor. |
inline static const std::string c_shorterTypeName | "RGS" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1111,6 +1116,7 @@ Structs
RenderGraphNode_Action_CopyResource : Copies a resource to another resource
RenderGraphNode_Action_CopyResource - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Copy Resource" | Used by the editor. |
inline static const std::string c_shortTypeName | "Copy" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Copy" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1122,6 +1128,7 @@ Structs
RenderGraphNode_Action_DrawCall : Rasterization
RenderGraphNode_Action_DrawCall - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Draw Call" | Used by the editor. |
inline static const std::string c_shortTypeName | "Draw" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Draw" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1174,6 +1181,7 @@ Structs
RenderGraphNode_Action_SubGraph : Runs another Gigi technique
RenderGraphNode_Action_SubGraph - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Subgraph" | Used by the editor. |
inline static const std::string c_shortTypeName | "Subgraph" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Sub" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1188,6 +1196,7 @@ Structs
RenderGraphNode_Action_Barrier : Causes all input operations to be executed before anything plugged into the output
RenderGraphNode_Action_Barrier - Inherits from RenderGraphNode_ActionBase |
+inline static const std::string c_editorName | "Barrier" | Used by the editor. |
inline static const std::string c_shortTypeName | "Barrier" | Used by the editor. |
inline static const std::string c_shorterTypeName | "Bar" | Used by the editor. |
inline static const bool c_showInEditor | true | Used by the editor. |
@@ -1357,7 +1366,6 @@ Structs
int resourceViewType | 0 | The type of resource being viewed |
int resourceViewNodeIndex | -1 | The index of the node bieng viewed |
int resourceViewResourceIndex | -1 | The index of that resource within that node being used |
-bool vsync | true | Whether or not vsync is on |
int syncInterval | true | IDXGISwapChain::Present() parameter: Synchronize presentation after the nth vertical blank. |
GGUserFile_ImportedResource importedResources[] | | |
GGUserFile_SavedVariable savedVariables[] | | |
diff --git a/readme/tutorial/tutorial.md b/readme/tutorial/tutorial.md
index a2130593..7f98ded6 100644
--- a/readme/tutorial/tutorial.md
+++ b/readme/tutorial/tutorial.md
@@ -10,7 +10,7 @@ Note: Gigi is currently windows only. The editor and compiler would port to oth
The source code and binaries for Gigi are available at https://github.com/electronicarts/gigi.
-To build from source, clone the repo and build gigi.sln in visual studio. I use vs2022, but vs2019 worked as well, last I tried.
+To build from source, clone the repo and build gigi.sln in visual studio. Make sure and build the whole solution (all projects). I use vs2022, but vs2019 worked as well, last I tried.
To use prebuilt binaries, go to the releases tab https://github.com/electronicarts/gigi/releases/. You can either download the .zip file, and extract that to the location of your choice, or you can download and run the installer exe.
@@ -25,7 +25,7 @@ After downloading or building Gigi there are three executables in the root direc
-Gigi comes with several built in techniques inside of the **Techniques/** folder that you can load from the viewer. Within the **Techniques/UnitTests/** folder are Gigi techniques meant to exercise every piece of functionality Gigi has to offer. They are a nice place to find examples of how to do things.
+Gigi comes with several built-in techniques inside of the **Techniques/** folder that you can load from the viewer. Within the **Techniques/UnitTests/** folder are Gigi techniques meant to exercise every piece of functionality Gigi has to offer. They are a nice place to find examples of how to do things.
The **Techniques/ShaderToy/** folder contains a few shadertoys I made in years past and ported to Gigi. They include a stylized path tracer you can fly around in, a playable mine sweeper game, and a playable 2d verlet physics car game. These were made using Gigi, so there is no C++ or scripting languages involved - just nodes in a node graph, and hlsl shader files.
@@ -43,9 +43,9 @@ There is also a machine learning demo (real time inference) at **Techniques/mach
Run GigiEditor.exe to launch the editor and save the technique in the **Techniques/** folder as **BoxBlur.gg**.
-The editor controls in the central grid render graph area are:
+The editor controls in the central grid render graph area are:
* Drag right mouse button to pan camera.
-* Mouse wheeel to zoom in and out
+* Mouse wheel to zoom in and out
* Press "F" to focus on the selection, or the entire graph if nothing selected.
We are going to make a technique which takes in an input texture, blurs it, and gives the result as an output texture. First we'll make the textures.
@@ -90,9 +90,9 @@ Click the edit button to open the shader file in your default shader editor. For
In the skeleton shader file that Gigi made for you, you'll notice a couple strange looking tokens. Before sending your shader to the shader compiler, Gigi processes the shader file for string replacement.
-* **/\*$(ShaderResources)\*/** - This is where Gigi will put the declarations of accessed resources (SRVs, UAVs, CBVs) that you declared in the resources section of the shader. The reason Gigi inserts these instead of getting them from the shader by reflection is because different target APIs or engines want resources declared in different ways. When Gigi inserts them, it's able to generate shader files that work on those platforms.
+* `/*$(ShaderResources)*/` - This is where Gigi will put the declarations of accessed resources (SRVs, UAVs, CBVs) that you declared in the resources section of the shader. The reason Gigi inserts these instead of getting them from the shader by reflection is because different target APIs or engines want resources declared in different ways. When Gigi inserts them, it's able to generate shader files that work on those platforms.
-* **/\*$(_compute:csmain)\*/** - This declares a compute shader entry point named "csmain". Gigi will write out the numthreads declaration and such when doing the string replacement processing.
+* `/*$(_compute:csmain)*/` - This declares a compute shader entry point named "csmain". Gigi will write out the numthreads declaration and such when doing the string replacement processing.
Next we write the shader, which loops through a 3x3 area for each input pixel, sums up the color, and the count (as weight), divides the color by the weight to make it the average color, and finally writes that averaged color to the output. Enter the code below, save, and go back to the editor.
@@ -131,6 +131,8 @@ Now that we have our shader written, we need to create a compute shader action n
3. Under the "Dispatch Size" section, set the "Node" drop down to "Input" which means the dispatch will be the size of the "Input" texture. That will be divided by the "Num Threads" setting on the shader, and rounded up, like you'd expect.
4. Connect the textures to the compute shader.
+Save the project.
+
![](CreatedCSNode.png)
## Viewing & Iterating on Our Technique
@@ -214,7 +216,7 @@ To add a blur radius parameter to our technique, we are going to go back to the
The visibility setting of a variable defines who or what can read and write the value. "Internal" means only the technique can read or write the variable. "Host" means that the host application running the technique can also modify the variable. "User" means that the variable should show up in the UI, script interface, console variables, or similar, as available on the target platform.
-To read this variable from the shader, we use the token **/\*$(Variable:BlurRadius)\*/**. So, double click the compute shader node, and change the for loops from looping between +/-1, to +/- BlurRadius like this:
+To read this variable from the shader, we use the token `/*$(Variable:BlurRadius)*/`. So, double click the compute shader node, and change the for loops from looping between +/-1, to +/- BlurRadius like this:
```c++
// Unnamed technique, shader DoBlurCS
@@ -343,7 +345,7 @@ Make sure and set it back to non const and save before continuing with the rest
Being able to set a variable as constant like this is good for when you want to be able to tweak a value during development time, but at runtime, you want the cost of a dynamic choice to go away. Also useful for masking out debug operations.
-Similarly to reading variables in shaders, you can also specify the file name of an image to read in a shader, and Gigi will load it, and pass it to your shader, like this: **/\*$(Image2D:../Textures/splitsum.png:RGBA8_UNorm:float4:false)\*/**. This feature is useful with noise textures, VFX textures, and similar. Please see **UserDocumentation/GigiShaders_Documentation.docx** for more information about tokens available in shaders.
+Similarly to reading variables in shaders, you can also specify the file name of an image to read in a shader, and Gigi will load it, and pass it to your shader, like this: `/*$(Image2D:../Textures/splitsum.png:RGBA8_UNorm:float4:false)*/`. This feature is useful with noise textures, VFX textures, and similar. Please see **UserDocumentation/GigiShaders_Documentation.docx** for more information about tokens available in shaders.
## Using Our Technique In Another Technique