Skip to content

Commit

Permalink
Merge pull request #20 from varunthomas/TurboGE_dev
Browse files Browse the repository at this point in the history
TurboGE v2.0
  • Loading branch information
varunthomas authored Jun 26, 2023
2 parents b6fcdf5 + 4080999 commit 2d7e2e0
Show file tree
Hide file tree
Showing 66 changed files with 2,075 additions and 292 deletions.
20 changes: 12 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
[submodule "TurboGE/vendor/spdlog"]
path = TurboGE/vendor/spdlog
url = https://github.com/gabime/spdlog
[submodule "TurboGE/vendor/imgui"]
path = TurboGE/vendor/imgui
url = https://github.com/TheCherno/imgui
url = https://github.com/varunthomas/spdlog
[submodule "TurboGE/vendor/glm"]
path = TurboGE/vendor/glm
url = https://github.com/g-truc/glm
url = https://github.com/varunthomas/glm
[submodule "TurboGE/vendor/yaml-cpp"]
path = TurboGE/vendor/yaml-cpp
url = https://github.com/jbeder/yaml-cpp
url = https://github.com/varunthomas/yaml-cpp
[submodule "TurboGE/vendor/ImGuizmo"]
path = TurboGE/vendor/ImGuizmo
url = https://github.com/CedricGuillemet/ImGuizmo
url = https://github.com/varunthomas/ImGuizmo
[submodule "TurboGE/vendor/GLFW"]
path = TurboGE/vendor/GLFW
url = https://github.com/glfw/glfw
url = https://github.com/varunthomas/glfw
[submodule "TurboGE/vendor/imgui"]
path = TurboGE/vendor/imgui
url = https://github.com/varunthomas/imgui
branch = docking
[submodule "TurboGE/vendor/box2d"]
path = TurboGE/vendor/box2d
url = https://github.com/varunthomas/box2d
7 changes: 7 additions & 0 deletions Deps.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
VULKAN_SDK = os.getenv("VULKAN_SDK")
PYTHON_PATH = os.getenv("Python")

IncludeDir = {}
IncludeDir["GLFW"] = "TurboGE/vendor/GLFW/include"
Expand All @@ -10,15 +11,21 @@ IncludeDir["entt"] = "TurboGE/vendor/entt/include"
IncludeDir["yamlcpp"] = "TurboGE/vendor/yaml-cpp/include"
IncludeDir["ImGuizmo"] = "TurboGE/vendor/ImGuizmo"
IncludeDir["VulkanSDK"] = "%{VULKAN_SDK}/Include"
IncludeDir["Box2D"] = "TurboGE/vendor/box2d/include"
IncludeDir["Python"] = "%{PYTHON_PATH}/include"

LibDir = {}

LibDir["VulkanSDK"] = "%{VULKAN_SDK}/Lib"
LibDir["Python"] = "%{PYTHON_PATH}/libs"

Lib = {}
Lib["Vulkan"] = "%{LibDir.VulkanSDK}/vulkan-1.lib"
Lib["VulkanUtils"] = "%{LibDir.VulkanSDK}/VkLayer_utils.lib"

Lib["Python_Debug"] = "%{LibDir.Python}/python311_d.lib"
Lib["Python_Release"] = "%{LibDir.Python}/python311.lib"

Lib["ShaderC_Debug"] = "%{LibDir.VulkanSDK}/shaderc_sharedd.lib"
Lib["SPIRV_Cross_Debug"] = "%{LibDir.VulkanSDK}/spirv-cross-cored.lib"
Lib["SPIRV_Cross_GLSL_Debug"] = "%{LibDir.VulkanSDK}/spirv-cross-glsld.lib"
Expand Down
Binary file added Editor/assets/icons/fileIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Editor/assets/icons/folderIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Editor/assets/icons/playIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Editor/assets/icons/stopIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions Editor/assets/shaders/Circle.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#text vertex
#version 450 core

layout(location = 0) in vec3 a_WorldPosition;
layout(location = 1) in vec3 a_LocalPosition;
layout(location = 2) in vec4 a_Color;
layout(location = 3) in float a_Thickness;
layout(location = 4) in float a_Fade;
layout(location = 5) in int a_EntityID;

layout(std140, binding = 0) uniform Camera
{
mat4 u_ViewProjection;
};

struct VertexOutput
{
vec3 LocalPosition;
vec4 Color;
float Thickness;
float Fade;
};

layout (location = 0) out VertexOutput Output;
layout (location = 4) out flat int v_EntityID;

void main()
{
Output.LocalPosition = a_LocalPosition;
Output.Color = a_Color;
Output.Thickness = a_Thickness;
Output.Fade = a_Fade;

v_EntityID = a_EntityID;

gl_Position = u_ViewProjection * vec4(a_WorldPosition, 1.0);
}

#text fragment
#version 450 core

layout(location = 0) out vec4 o_Color;
layout(location = 1) out int o_EntityID;

struct VertexOutput
{
vec3 LocalPosition;
vec4 Color;
float Thickness;
float Fade;
};

layout (location = 0) in VertexOutput Input;
layout (location = 4) in flat int v_EntityID;

void main()
{
// Calculate distance and fill circle with white
float distance = 1.0 - length(Input.LocalPosition);
float circle = smoothstep(0.0, Input.Fade, distance);
circle *= smoothstep(Input.Thickness + Input.Fade, Input.Thickness, distance);

if (circle == 0.0)
discard;

// Set output color
o_Color = Input.Color;
o_Color.a *= circle;

o_EntityID = v_EntityID;
}
47 changes: 47 additions & 0 deletions Editor/assets/shaders/Line.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#text vertex
#version 450 core

layout(location = 0) in vec3 a_Position;
layout(location = 1) in vec4 a_Color;
layout(location = 2) in int a_entityID;

layout(std140, binding = 0) uniform Camera
{
mat4 u_ViewProjection;
};

struct VertexOutput
{
vec4 Color;
};

layout (location = 0) out VertexOutput Output;
layout (location = 1) out flat int v_entityID;

void main()
{
Output.Color = a_Color;
v_entityID = a_entityID;
gl_Position = u_ViewProjection * vec4(a_Position, 1.0);
}

#text fragment
#version 450 core

layout(location = 0) out vec4 color;
layout(location = 1) out int entityId;

struct VertexOutput
{
vec4 Color;
};

layout (location = 0) in VertexOutput Input;
layout (location = 1) in flat int v_entityID;


void main()
{
color = Input.Color;
entityId = v_entityID;
}
12 changes: 6 additions & 6 deletions Editor/assets/shaders/Texture.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ struct VertexOutput
{
vec4 Color;
vec2 TextCoord;
float TextIndex;
float TilingFactor;
};

layout (location = 0) out VertexOutput Output;
layout (location = 3) out flat float v_TextIndex;
layout (location = 4) out flat int v_entityID;

void main()
{
Output.Color = a_Color;
Output.TextCoord = a_TextCoord;
Output.TextIndex = a_TextIndex;
Output.TilingFactor = a_TilingFactor;
v_TextIndex = a_TextIndex;
v_entityID = a_entityID;
gl_Position = u_ViewProjection * vec4(a_Position, 1.0);
}
Expand All @@ -38,25 +38,25 @@ void main()
#version 450 core

layout(location = 0) out vec4 color;
layout(location = 1) out int color2;
layout(location = 1) out int entityID;

struct VertexInput
{
vec4 Color;
vec2 TextCoord;
float TextIndex;
float TilingFactor;
};

layout (location = 0) in VertexInput Input;
layout (location = 3) in flat float v_TextIndex;
layout (location = 4) in flat int v_entityID;


layout (binding = 0) uniform sampler2D u_Textures[32];

void main()
{
color = texture(u_Textures[int(Input.TextIndex)], Input.TextCoord * Input.TilingFactor) * Input.Color;
color = texture(u_Textures[int(v_TextIndex)], Input.TextCoord * Input.TilingFactor) * Input.Color;
//color = v_Color;
color2 = v_entityID;
entityID = v_entityID;
}
69 changes: 43 additions & 26 deletions Editor/imgui.ini
Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
[Window][DockSpace Demo]
Pos=0,0
Size=1280,720
Size=1920,1080
Collapsed=0

[Window][Debug##Default]
ViewportPos=496,733
ViewportId=0x9F5F46A1
Pos=60,60
Size=400,400
Collapsed=0

[Window][Color settings]
Pos=910,24
Size=370,696
[Window][Entity Panel]
Pos=0,67
Size=370,292
Collapsed=0
DockId=0x00000006,0
DockId=0x00000009,0

[Window][Dockspace]
Pos=372,24
Size=536,696
[Window][Properties]
Pos=0,361
Size=370,719
Collapsed=0
DockId=0x0000000A,0

[Window][Browser Panel]
Pos=372,838
Size=1166,242
Collapsed=0
DockId=0x00000002,0

[Window][Entity Panel]
[Window][##toolbar]
Pos=0,24
Size=370,348
Size=1920,41
Collapsed=0
DockId=0x00000002,0
DockId=0x0000000B,0

[Window][Properties]
Pos=0,374
Size=370,346
[Window][Color settings]
Pos=1540,67
Size=380,709
Collapsed=0
DockId=0x00000005,0

[Window][Settings]
Pos=1540,778
Size=380,302
Collapsed=0
DockId=0x00000006,0

[Window][Editor View]
Pos=372,24
Size=536,696
Pos=372,67
Size=1166,769
Collapsed=0
DockId=0x00000004,0
DockId=0x00000001,0

[Docking][Data]
DockSpace ID=0x3BC79352 Window=0x4647B76E Pos=73,126 Size=1280,696 Split=X
DockNode ID=0x00000001 Parent=0x3BC79352 SizeRef=908,696 Split=X
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=370,701 Split=Y Selected=0x99E90EE0
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=370,348 Selected=0x99E90EE0
DockNode ID=0x00000005 Parent=0x00000003 SizeRef=370,346 Selected=0x199AB496
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=536,701 CentralNode=1 Selected=0x90BB90E3
DockNode ID=0x00000006 Parent=0x3BC79352 SizeRef=370,696 Selected=0x854BCD6C
DockSpace ID=0x3BC79352 Window=0x4647B76E Pos=0,24 Size=1920,1056 Split=Y
DockNode ID=0x0000000B Parent=0x3BC79352 SizeRef=1920,41 HiddenTabBar=1 Selected=0xF0F70764
DockNode ID=0x0000000C Parent=0x3BC79352 SizeRef=1920,1013 Split=X
DockNode ID=0x00000007 Parent=0x0000000C SizeRef=370,1056 Split=Y Selected=0x199AB496
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=302,292 Selected=0x99E90EE0
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=302,719 Selected=0x199AB496
DockNode ID=0x00000008 Parent=0x0000000C SizeRef=1548,1056 Split=X
DockNode ID=0x00000003 Parent=0x00000008 SizeRef=1166,1056 Split=Y
DockNode ID=0x00000001 Parent=0x00000003 SizeRef=1920,769 CentralNode=1 Selected=0x90BB90E3
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=1920,242 Selected=0xC678E4B5
DockNode ID=0x00000004 Parent=0x00000008 SizeRef=380,1056 Split=Y Selected=0x54723243
DockNode ID=0x00000005 Parent=0x00000004 SizeRef=380,709 Selected=0x854BCD6C
DockNode ID=0x00000006 Parent=0x00000004 SizeRef=380,302 Selected=0x54723243

Loading

0 comments on commit 2d7e2e0

Please sign in to comment.