Renamed compute shader ray tracing example
This commit is contained in:
parent
4326ce390d
commit
b2add91d2c
15 changed files with 11 additions and 11 deletions
|
|
@ -229,7 +229,7 @@ Attraction based 2D GPU particle system using compute shaders. Particle data is
|
||||||
|
|
||||||
N-body simulation based particle system with multiple attractors and particle-to-particle interaction using two passes separating particle movement calculation and final integration. Shared compute shader memory is used to speed up compute calculations.
|
N-body simulation based particle system with multiple attractors and particle-to-particle interaction using two passes separating particle movement calculation and final integration. Shared compute shader memory is used to speed up compute calculations.
|
||||||
|
|
||||||
#### [04 - Ray tracing](examples/raytracing/)
|
#### [04 - Ray tracing](examples/computeraytracing/)
|
||||||
|
|
||||||
Simple GPU ray tracer with shadows and reflections using a compute shader. No scene geometry is rendered in the graphics pass.
|
Simple GPU ray tracer with shadows and reflections using a compute shader. No scene geometry is rendered in the graphics pass.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.4.1 FATAL_ERROR)
|
||||||
|
|
||||||
set(NAME raytracing)
|
set(NAME computeraytracing)
|
||||||
|
|
||||||
set(SRC_DIR ../../../examples/${NAME})
|
set(SRC_DIR ../../../examples/${NAME})
|
||||||
set(BASE_DIR ../../../base)
|
set(BASE_DIR ../../../base)
|
||||||
|
|
@ -4,7 +4,7 @@ apply from: '../gradle/outputfilename.gradle'
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 26
|
compileSdkVersion 26
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "de.saschawillems.vulkanRaytracing"
|
applicationId "de.saschawillems.vulkanComputeRaytracing"
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
|
@ -49,8 +49,8 @@ task copyTask << {
|
||||||
}
|
}
|
||||||
|
|
||||||
copy {
|
copy {
|
||||||
from '../../../data/shaders/raytracing'
|
from '../../../data/shaders/computeraytracing'
|
||||||
into 'assets/shaders/raytracing'
|
into 'assets/shaders/computeraytracing'
|
||||||
include '*.*'
|
include '*.*'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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.vulkanRaytracing">
|
package="de.saschawillems.vulkanComputeRaytracing">
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="Vulkan compute raytracing"
|
android:label="Vulkan compute raytracing"
|
||||||
|
|
@ -4,6 +4,7 @@ include 'examples/:computecullandlod'
|
||||||
include 'examples/:computeheadless'
|
include 'examples/:computeheadless'
|
||||||
include 'examples/:computenbody'
|
include 'examples/:computenbody'
|
||||||
include 'examples/:computeparticles'
|
include 'examples/:computeparticles'
|
||||||
|
include 'examples/:computeraytracing'
|
||||||
include 'examples/:computeshader'
|
include 'examples/:computeshader'
|
||||||
include 'examples/:conservativeraster'
|
include 'examples/:conservativeraster'
|
||||||
include 'examples/:debugmarker'
|
include 'examples/:debugmarker'
|
||||||
|
|
@ -39,7 +40,6 @@ include 'examples/:pipelinestatistics'
|
||||||
include 'examples/:pushconstants'
|
include 'examples/:pushconstants'
|
||||||
include 'examples/:pushdescriptors'
|
include 'examples/:pushdescriptors'
|
||||||
include 'examples/:radialblur'
|
include 'examples/:radialblur'
|
||||||
include 'examples/:raytracing'
|
|
||||||
include 'examples/:renderheadless'
|
include 'examples/:renderheadless'
|
||||||
include 'examples/:scenerendering'
|
include 'examples/:scenerendering'
|
||||||
include 'examples/:screenshot'
|
include 'examples/:screenshot'
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ set(EXAMPLES
|
||||||
computeheadless
|
computeheadless
|
||||||
computenbody
|
computenbody
|
||||||
computeparticles
|
computeparticles
|
||||||
|
computeraytracing
|
||||||
computeshader
|
computeshader
|
||||||
conditionalrender
|
conditionalrender
|
||||||
conservativeraster
|
conservativeraster
|
||||||
|
|
@ -89,7 +90,6 @@ set(EXAMPLES
|
||||||
pushconstants
|
pushconstants
|
||||||
pushdescriptors
|
pushdescriptors
|
||||||
radialblur
|
radialblur
|
||||||
raytracing
|
|
||||||
renderheadless
|
renderheadless
|
||||||
scenerendering
|
scenerendering
|
||||||
screenshot
|
screenshot
|
||||||
|
|
|
||||||
|
|
@ -507,8 +507,8 @@ public:
|
||||||
// Display pipeline
|
// Display pipeline
|
||||||
std::array<VkPipelineShaderStageCreateInfo,2> shaderStages;
|
std::array<VkPipelineShaderStageCreateInfo,2> shaderStages;
|
||||||
|
|
||||||
shaderStages[0] = loadShader(getAssetPath() + "shaders/raytracing/texture.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
shaderStages[0] = loadShader(getAssetPath() + "shaders/computeraytracing/texture.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
|
||||||
shaderStages[1] = loadShader(getAssetPath() + "shaders/raytracing/texture.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
shaderStages[1] = loadShader(getAssetPath() + "shaders/computeraytracing/texture.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
|
||||||
|
|
||||||
VkGraphicsPipelineCreateInfo pipelineCreateInfo =
|
VkGraphicsPipelineCreateInfo pipelineCreateInfo =
|
||||||
vks::initializers::pipelineCreateInfo(
|
vks::initializers::pipelineCreateInfo(
|
||||||
|
|
@ -633,7 +633,7 @@ public:
|
||||||
compute.pipelineLayout,
|
compute.pipelineLayout,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
computePipelineCreateInfo.stage = loadShader(getAssetPath() + "shaders/raytracing/raytracing.comp.spv", VK_SHADER_STAGE_COMPUTE_BIT);
|
computePipelineCreateInfo.stage = loadShader(getAssetPath() + "shaders/computeraytracing/raytracing.comp.spv", VK_SHADER_STAGE_COMPUTE_BIT);
|
||||||
VK_CHECK_RESULT(vkCreateComputePipelines(device, pipelineCache, 1, &computePipelineCreateInfo, nullptr, &compute.pipeline));
|
VK_CHECK_RESULT(vkCreateComputePipelines(device, pipelineCache, 1, &computePipelineCreateInfo, nullptr, &compute.pipeline));
|
||||||
|
|
||||||
// Separate command pool as queue family for compute may be different than graphics
|
// Separate command pool as queue family for compute may be different than graphics
|
||||||
Loading…
Add table
Add a link
Reference in a new issue