Renamed particle fire sample

This commit is contained in:
Sascha Willems 2023-07-16 16:03:29 +02:00
parent 384b2031a2
commit 9dcc8110cf
25 changed files with 15 additions and 15 deletions

View file

@ -152,7 +152,7 @@ Advanced example that uses sub passes and input attachments to write and read ba
Basic offscreen rendering in two passes. First pass renders the mirrored scene to a separate framebuffer with color and depth attachments, second pass samples from that color attachment for rendering a mirror surface. Basic offscreen rendering in two passes. First pass renders the mirrored scene to a separate framebuffer with color and depth attachments, second pass samples from that color attachment for rendering a mirror surface.
#### [CPU particle system](examples/particlefire/) #### [CPU particle system](examples/particlesystem/)
Implements a simple CPU based particle system. Particle data is stored in host memory, updated on the CPU per-frame and synchronized with the device before it's rendered using pre-multiplied alpha. Implements a simple CPU based particle system. Particle data is stored in host memory, updated on the CPU per-frame and synchronized with the device before it's rendered using pre-multiplied alpha.

View file

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR) cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR)
set(NAME particlefire) set(NAME particlesystem)
set(SRC_DIR ../../../examples/${NAME}) set(SRC_DIR ../../../examples/${NAME})
set(BASE_DIR ../../../base) set(BASE_DIR ../../../base)

View file

@ -4,7 +4,7 @@ apply from: '../gradle/outputfilename.gradle'
android { android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig { defaultConfig {
applicationId "de.saschawillems.vulkanParticlefire" applicationId "de.saschawillems.vulkanParticlesystem"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode 1
@ -49,8 +49,8 @@ task copyTask {
} }
copy { copy {
from rootProject.ext.shaderPath + 'glsl/particlefire' from rootProject.ext.shaderPath + 'glsl/particlesystem'
into 'assets/shaders/glsl/particlefire' into 'assets/shaders/glsl/particlesystem'
include '*.*' include '*.*'
} }

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.saschawillems.vulkanParticlefire"> package="de.saschawillems.vulkanParticlesystem">
<application <application
android:label="Vulkan CPU particles" android:label="Vulkan CPU particles"

View file

@ -121,7 +121,7 @@ set(EXAMPLES
offscreen offscreen
oit oit
parallaxmapping parallaxmapping
particlefire particlesystem
pbrbasic pbrbasic
pbribl pbribl
pbrtexture pbrtexture

View file

@ -1,5 +1,5 @@
/* /*
* Vulkan Example - CPU based fire particle system * Vulkan Example - CPU based particle system
* *
* Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de * Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
* *
@ -478,8 +478,8 @@ public:
blendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD; blendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD;
blendAttachmentState.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT; blendAttachmentState.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
shaderStages[0] = loadShader(getShadersPath() + "particlefire/particle.vert.spv", VK_SHADER_STAGE_VERTEX_BIT); shaderStages[0] = loadShader(getShadersPath() + "particlesystem/particle.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "particlefire/particle.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT); shaderStages[1] = loadShader(getShadersPath() + "particlesystem/particle.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.particles)); VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.particles));
} }
@ -492,8 +492,8 @@ public:
depthStencilState.depthWriteEnable = VK_TRUE; depthStencilState.depthWriteEnable = VK_TRUE;
inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
shaderStages[0] = loadShader(getShadersPath() + "particlefire/normalmap.vert.spv", VK_SHADER_STAGE_VERTEX_BIT); shaderStages[0] = loadShader(getShadersPath() + "particlesystem/normalmap.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getShadersPath() + "particlefire/normalmap.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT); shaderStages[1] = loadShader(getShadersPath() + "particlesystem/normalmap.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.environment)); VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.environment));
} }
} }

View file

@ -6,7 +6,7 @@ These can be compiled with [DXC](https://github.com/microsoft/DirectXShaderCompi
### Known issues ### Known issues
- specialization constants can't be used to specify array size. - specialization constants can't be used to specify array size.
- `gl_PointCoord` not supported. HLSL has no equivalent. We changed the shaders to calulate the PointCoord manually in the shader. (`computenbody`, `computeparticles`, `particlefire` examples). - `gl_PointCoord` not supported. HLSL has no equivalent. We changed the shaders to calulate the PointCoord manually in the shader. (`computenbody`, `computeparticles`, `particlesystem` examples).
- HLSL doesn't have inverse operation (`deferred`, `hdr`, `instancing`, `skeletalanimation` & `texturecubemap` examples). - HLSL doesn't have inverse operation (`deferred`, `hdr`, `instancing`, `skeletalanimation` & `texturecubemap` examples).
- `modf` causes compilation to fail without errors or warnings. (`modf` not used by any examples, easily confused with fmod) - `modf` causes compilation to fail without errors or warnings. (`modf` not used by any examples, easily confused with fmod)
- In `specializationconstants` example, shader compilation fails with error: - In `specializationconstants` example, shader compilation fails with error:

View file

@ -110,8 +110,8 @@
# include "../examples/textoverlay/textoverlay.cpp" # include "../examples/textoverlay/textoverlay.cpp"
#endif #endif
#ifdef MVK_particlefire #ifdef MVK_particlesystem
# include "../examples/particlefire/particlefire.cpp" # include "../examples/particlesystem/particlesystem.cpp"
#endif #endif
// No headless target when using xcode examples project, builds/runs fine using vulkanExamples project. // No headless target when using xcode examples project, builds/runs fine using vulkanExamples project.