Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/MrScautHD/Bliss
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Aug 12, 2024
2 parents 0baab8f + 8c56d2e commit de2bce2
Showing 1 changed file with 43 additions and 27 deletions.
70 changes: 43 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,74 @@ Coming SoOn!
---

# ⚠️ Importand for the Installation
For this project, you need the [`Vulkan SDK`](https://vulkan.lunarg.com/sdk/home#windows) with the version `[1.3.283.0]`. Please add the following code to your `.csproj` file:
```cs
1. For this project, you need the [`Vulkan SDK`](https://vulkan.lunarg.com/sdk/home#windows) with the version `[1.3.283.0]`. Please add the following code to your `.csproj` file:
```xml
<!-- _____________________________________Vulkan_____________________________________ -->

<!-- Vulkan SDK -->
<PropertyGroup>
<VulkanBinPath>C:\VulkanSDK\1.3.283.0\Bin</VulkanBinPath>
<VulkanBinPath>C:/VulkanSDK/1.3.283.0/Bin</VulkanBinPath>
</PropertyGroup>
```

To **compile shaders**, include the following code in your `.csproj` file:
```cs
2. To **compile shaders**, include the following code in your `.csproj` file:
```xml
<!-- _____________________________________Shader_____________________________________ -->

<!-- Shader Stages (Vertex, Fragment...) -->
<ItemGroup>
<VertexShader Include="**/*.vert" />
<FragmentShader Include="**/*.frag" />
</ItemGroup>
<VertexShader Include="$(contentFolder)/**/*.vert" Pack="true">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</VertexShader>

<!-- Compiled Shader Format -->
<ItemGroup>
<EmbeddedResource Include="**/*.spv" />
</ItemGroup>

<!-- Content -->
<ItemGroup>
<Content Include="content/**/*" Pack="true" Exclude="@(VertexShader);@(FragmentShader);content/**/*.spv">
<FragmentShader Include="$(contentFolder)/**/*.frag" Pack="true">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
</FragmentShader>
</ItemGroup>

<!-- Shader Cleaner -->
<Target Name="CleanVulkanShader" BeforeTargets="Clean">
<Message Text="......................................SHADERS.Clean..........................................................." Importance="high" />
<Message Text="......................................Shaders Cleaning......................................" Importance="high" />
<ItemGroup>
<FilesToDelete Include="**\*.spv" />
<FilesToDelete Include="$(contentFolder)/**/*.spv" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<Message Text="......................................SHADERS.Cleaned........................................................." Importance="high" />
<Message Text=".......................................Shaders Cleaned......................................" Importance="high" />
</Target>

<!-- Shader Compiler -->
<Target Name="BuildVulkanShader" BeforeTargets="BeforeBuild">
<Message Text="......................................SHADERS.Compile........................................................." Importance="high" />
<Message Text="......................................Shaders Compiling....................................." Importance="high" />
<Message Text=" Starting Vulkan Shader Compilation..." Importance="high" />
<Message Text=" VulkanBinPath: $(VulkanBinPath)" Importance="high" />
<Message Text=" VertexShader: @(VertexShader)" Importance="high" />
<Message Text=" FragmentShader: @(FragmentShader)" Importance="high" />
<Exec Command="$(VulkanBinPath)\glslc.exe &quot;%(VertexShader.FullPath)&quot; -o &quot;%(VertexShader.FullPath).spv&quot;" Condition="'@(VertexShader)'!=''" />
<Exec Command="$(VulkanBinPath)\glslc.exe &quot;%(FragmentShader.FullPath)&quot; -o &quot;%(FragmentShader.FullPath).spv&quot;" Condition="'@(FragmentShader)'!=''" />
<Message Text="......................................SHADERS.Compiled........................................................" Importance="high" />
<Message Text=" > VulkanBinPath: $(VulkanBinPath)" Importance="high" />
<Message Text=" > VertexShader: @(VertexShader)" Importance="high" />
<Message Text=" > FragmentShader: @(FragmentShader)" Importance="high" />
<Exec Command="$(VulkanBinPath)/glslc.exe &quot;%(VertexShader.FullPath)&quot; -o &quot;%(VertexShader.FullPath).spv&quot;" Condition="'@(VertexShader)'!=''" />
<Exec Command="$(VulkanBinPath)/glslc.exe &quot;%(FragmentShader.FullPath)&quot; -o &quot;%(FragmentShader.FullPath).spv&quot;" Condition="'@(FragmentShader)'!=''" />
<Message Text="......................................Shaders Compiled......................................" Importance="high" />
</Target>
```

3. To implimenting the `Shaders, Textures...` into the project to load them, add this code:
```xml
<!-- _____________________________________Content_____________________________________ -->

<!-- Content Folder -->
<PropertyGroup>
<contentFolder>content</contentFolder>
</PropertyGroup>

<!-- Content -->
<ItemGroup>
<Content Include="$(contentFolder)/**/*" Pack="true" Exclude="@(VertexShader);@(FragmentShader);">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
</ItemGroup>
```

# 💻 Platforms
[<img src="https://github.com/MrScautHD/Sparkle/assets/65916181/a92bd5fa-517b-44c2-ab58-cc01b5ae5751" alt="windows" width="70" height="70" align="left">](https://www.microsoft.com/de-at/windows)
### Windows
Expand Down

0 comments on commit de2bce2

Please sign in to comment.