Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
GameWin221 committed Jun 30, 2022
2 parents 41b053d + 7154489 commit 988dc36
Show file tree
Hide file tree
Showing 75 changed files with 2,091 additions and 1,683 deletions.
40 changes: 25 additions & 15 deletions EruptionEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -99,6 +101,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -113,6 +117,8 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down Expand Up @@ -146,7 +152,8 @@
</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>Shaders\compile.bat</Command>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -178,19 +185,20 @@
</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>Shaders\compile.bat</Command>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Source\Renderer\ComputeShader.cpp" />
<ClCompile Include="Source\Renderer\Image.cpp" />
<ClCompile Include="Source\Editor\UIPanels\SettingsPanel.cpp" />
<ClCompile Include="Source\Editor\UIPanels\InspectorPanel.cpp" />
<ClCompile Include="Source\Editor\UIPanels\SceneHierarchyPanel.cpp" />
<ClCompile Include="Source\Editor\UIPanels\AssetManagerPanel.cpp" />
<ClCompile Include="Source\Renderer\Buffers\MemoryBuffer.cpp" />
<ClCompile Include="Source\Renderer\DynamicFramebuffer.cpp" />
<ClCompile Include="Source\Renderer\Lights\Lights.cpp" />
<ClCompile Include="Source\Renderer\PipelineInput.cpp" />
<ClCompile Include="Source\Renderer\DescriptorSet.cpp" />
<ClCompile Include="Source\Renderer\Pipeline.cpp" />
<ClCompile Include="Source\Editor\EditorImageAtlas.cpp" />
<ClCompile Include="Source\Renderer\Camera\CameraMatricesBuffer.cpp" />
Expand Down Expand Up @@ -259,6 +267,7 @@
<ClCompile Include="Source\Renderer\Swapchain.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Source\Renderer\ComputeShader.hpp" />
<ClInclude Include="Source\Renderer\Image.hpp" />
<ClInclude Include="Source\Assets\Asset.hpp" />
<ClInclude Include="Source\Editor\UIPanels\SettingsPanel.hpp" />
Expand All @@ -269,7 +278,7 @@
<ClInclude Include="Source\Editor\UIPanels\AssetManagerPanel.hpp" />
<ClInclude Include="Source\Renderer\Buffers\MemoryBuffer.hpp" />
<ClInclude Include="Source\Renderer\DynamicFramebuffer.hpp" />
<ClInclude Include="Source\Renderer\PipelineInput.hpp" />
<ClInclude Include="Source\Renderer\DescriptorSet.hpp" />
<ClInclude Include="Source\Renderer\Pipeline.hpp" />
<ClInclude Include="Source\Editor\EditorImageAtlas.hpp" />
<ClInclude Include="External\ImGui\imconfig.h" />
Expand All @@ -286,6 +295,7 @@
<ClInclude Include="Include\EnPch.hpp" />
<ClInclude Include="Source\Core\Log.hpp" />
<ClInclude Include="Source\Scene\Scene.hpp" />
<ClInclude Include="Source\Scene\SceneMember.hpp" />
<ClInclude Include="Source\Scene\SceneObject.hpp" />
<ClInclude Include="Source\Assets\Material.hpp" />
<ClInclude Include="Source\Core\EnPch.hpp" />
Expand All @@ -306,34 +316,34 @@
<ClInclude Include="Source\Common\Helpers.hpp" />
<ClInclude Include="Source\Input\InputManager.hpp" />
<ClInclude Include="Source\Editor\EditorLayer.hpp" />
<ClInclude Include="Source\Renderer\Lights\Spotlight.hpp" />
<ClInclude Include="Source\Renderer\Lights\SpotLight.hpp" />
<ClInclude Include="Source\Renderer\Swapchain.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="EruptionEngine.ini" />
<None Include="Shaders\DepthFragment.frag" />
<None Include="Shaders\DepthVertex.vert" />
<None Include="Shaders\AMD\AMDFXAA.comp" />
<None Include="Shaders\AMD\AMDTonemapping.comp" />
<None Include="Shaders\Depth.frag" />
<None Include="Shaders\Depth.vert" />
<None Include="Shaders\FXAA.frag" />
<None Include="Shaders\GeometryFragment.frag">
<FileType>Document</FileType>
</None>
<CopyFileToFolders Include="Shaders\GeometryFragment.spv">
<FileType>Document</FileType>
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)Build\$(Platform)\$(Configuration)\Shaders\</DestinationFolders>
<DestinationFolders Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)Build\$(Platform)\$(Configuration)\Shaders\</DestinationFolders>
</CopyFileToFolders>
<None Include="Shaders\GeometryVertex.vert">
<FileType>Document</FileType>
</None>
<None Include="Shaders\LightingFrag.frag">
<None Include="Shaders\Lighting.frag">
<FileType>Document</FileType>
</None>
<None Include="Shaders\FullscreenTriVert.vert">
<FileType>Document</FileType>
</None>
<None Include="Shaders\Move.frag" />
<None Include="Shaders\NVIDIA\NVFXAA.comp" />
<None Include="Shaders\NVIDIA\NVTonemapping.comp" />
<None Include="Shaders\SMAA.frag" />
<None Include="Shaders\TonemapFrag.frag" />
<None Include="Shaders\TonemapComp.comp" />
<None Include="Shaders\Tonemapping.frag" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
36 changes: 22 additions & 14 deletions EruptionEngine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<ClCompile Include="Source\Renderer\Pipeline.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\PipelineInput.cpp">
<ClCompile Include="Source\Renderer\DescriptorSet.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\Buffers\MemoryBuffer.cpp">
Expand All @@ -132,9 +132,6 @@
<ClCompile Include="Source\Editor\UIPanels\InspectorPanel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\Lights\Lights.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Editor\UIPanels\SettingsPanel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -144,6 +141,9 @@
<ClCompile Include="Source\Renderer\Swapchain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\ComputeShader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Include\EnPch.hpp">
Expand Down Expand Up @@ -254,7 +254,7 @@
<ClInclude Include="Source\Renderer\Pipeline.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\PipelineInput.hpp">
<ClInclude Include="Source\Renderer\DescriptorSet.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\Buffers\MemoryBuffer.hpp">
Expand All @@ -278,7 +278,7 @@
<ClInclude Include="Source\Renderer\Lights\DirectionalLight.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\Lights\Spotlight.hpp">
<ClInclude Include="Source\Renderer\Lights\SpotLight.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Editor\UIPanels\SettingsPanel.hpp">
Expand All @@ -293,21 +293,29 @@
<ClInclude Include="Source\Renderer\Swapchain.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\ComputeShader.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Scene\SceneMember.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="EruptionEngine.ini" />
<None Include="Shaders\GeometryFragment.frag" />
<None Include="Shaders\GeometryVertex.vert" />
<None Include="Shaders\LightingFrag.frag" />
<None Include="Shaders\Lighting.frag" />
<None Include="Shaders\FullscreenTriVert.vert" />
<None Include="Shaders\TonemapFrag.frag" />
<None Include="Shaders\DepthFragment.frag" />
<None Include="Shaders\DepthVertex.vert" />
<None Include="Shaders\FXAA.frag" />
<None Include="Shaders\TonemapComp.comp" />
<None Include="Shaders\Depth.frag" />
<None Include="Shaders\SMAA.frag" />
<None Include="Shaders\Move.frag" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="Shaders\GeometryFragment.spv" />
<None Include="Shaders\AMD\AMDFXAA.comp" />
<None Include="Shaders\AMD\AMDTonemapping.comp" />
<None Include="Shaders\NVIDIA\NVFXAA.comp" />
<None Include="Shaders\NVIDIA\NVTonemapping.comp" />
<None Include="Shaders\Depth.vert" />
<None Include="Shaders\Tonemapping.frag" />
<None Include="Shaders\FXAA.frag" />
</ItemGroup>
</Project>
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions Shaders/DepthFragment.frag

This file was deleted.

Binary file removed Shaders/DepthFragment.spv
Binary file not shown.
10 changes: 5 additions & 5 deletions Shaders/LightingFrag.frag → Shaders/Lighting.frag
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct PointLight
vec4 positionRadius;
vec3 color;
};
struct Spotlight
struct SpotLight
{
vec3 position;
float innerCutoff;
Expand All @@ -35,11 +35,11 @@ struct DirLight
layout(binding = 3) uniform UBO
{
PointLight pLights[MAX_POINT_LIGHTS];
Spotlight sLights[MAX_SPOT_LIGHTS];
SpotLight sLights[MAX_SPOT_LIGHTS];
DirLight dLights[MAX_DIR_LIGHTS];

uint activePointLights;
uint activeSpotlights;
uint activeSpotLights;
uint activeDirLights;

vec3 ambient;
Expand Down Expand Up @@ -142,7 +142,7 @@ vec3 CalculateDirLight(DirLight light, vec3 albedo, float roughness, float metal

return (kD * albedo / PI + specular) * radiance * NdotL;
}
vec3 CalculateSpotLight(Spotlight light, vec3 albedo, float roughness, float metalness, vec3 F0, vec3 viewDir, vec3 position, vec3 normal, float theta)
vec3 CalculateSpotLight(SpotLight light, vec3 albedo, float roughness, float metalness, vec3 F0, vec3 viewDir, vec3 position, vec3 normal, float theta)
{
float dist = length(position - light.position);

Expand Down Expand Up @@ -202,7 +202,7 @@ void main()
if(dist < lightsBuffer.pLights[i].positionRadius.w)
lighting += CalculatePointLight(lightsBuffer.pLights[i], albedo, roughness, metalness, F0, viewDir, position, normal, dist);
}
for(int i = 0; i < lightsBuffer.activeSpotlights; i++)
for(int i = 0; i < lightsBuffer.activeSpotLights; i++)
{
vec3 lightToSurfaceDir = normalize(position - lightsBuffer.sLights[i].position);

Expand Down
Binary file renamed Shaders/LightingFrag.spv → Shaders/Lighting.spv
Binary file not shown.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions Shaders/compile.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
%VULKAN_SDK%/Bin/glslc.exe %~dp0\GeometryVertex.vert -o %~dp0\GeometryVertex.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\GeometryFragment.frag -o %~dp0\GeometryFragment.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\FullscreenTriVert.vert -o %~dp0\FullscreenTriVert.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\LightingFrag.frag -o %~dp0\LightingFrag.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\TonemapFrag.frag -o %~dp0\TonemapFrag.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\DepthFragment.frag -o %~dp0\DepthFragment.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\DepthVertex.vert -o %~dp0\DepthVertex.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\Lighting.frag -o %~dp0\Lighting.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\Tonemapping.frag -o %~dp0\Tonemapping.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\Depth.vert -o %~dp0\Depth.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\FXAA.frag -o %~dp0\FXAA.spv

pause
13 changes: 12 additions & 1 deletion Source/Assets/Asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ namespace en
None
};

struct Asset;

template<class T>
concept IsAssetChild = std::derived_from<T, Asset> || std::same_as<T, Asset>;

struct Asset
{
AssetType m_Type = AssetType::None;
const AssetType m_Type = AssetType::None;

template<IsAssetChild T>
T* CastTo()
{
return reinterpret_cast<T*>(this);
}
};
}

Expand Down
Loading

0 comments on commit 988dc36

Please sign in to comment.