vulkan shader
This commit is contained in:
parent
0382508e9e
commit
7ab2e09d48
@ -11,9 +11,17 @@ add_executable(Informatikprojekt_OpenGL openglMain.c ${PROJECT_SOURCES_OPENGL})
|
||||
add_executable(Informatikprojekt_Vulkan vulkanMain.c ${PROJECT_SOURCES_VULKAN})
|
||||
|
||||
# Copy shader file to output directory
|
||||
configure_file(./shaders/opengl/ComputeShader.glsl ComputeShader.glsl COPYONLY)
|
||||
configure_file(./shaders/opengl/VertexShader.glsl VertexShader.glsl COPYONLY)
|
||||
configure_file(./shaders/opengl/FragmentShader.glsl FragmentShader.glsl COPYONLY)
|
||||
## OpenGL
|
||||
configure_file(./shaders/opengl/ComputeShader.glsl ./opengl/ComputeShader.glsl COPYONLY)
|
||||
configure_file(./shaders/opengl/VertexShader.glsl ./opengl/VertexShader.glsl COPYONLY)
|
||||
configure_file(./shaders/opengl/FragmentShader.glsl ./opengl/FragmentShader.glsl COPYONLY)
|
||||
## Vulkan
|
||||
configure_file(./shaders/vulkan/ComputeShader.comp ./vulkan/ComputeShader.comp COPYONLY)
|
||||
configure_file(./shaders/vulkan/VertexShader.vert ./vulkan/VertexShader.vert COPYONLY)
|
||||
configure_file(./shaders/vulkan/FragmentShader.frag ./vulkan/FragmentShader.frag COPYONLY)
|
||||
configure_file(./shaders/vulkan/runCompiler.bat ./vulkan/runCompiler.bat COPYONLY)
|
||||
execute_process(COMMAND runCompiler.bat WORKING_DIRECTORY ./vulkan)
|
||||
|
||||
|
||||
# Vulkan
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <stdlib.h>
|
||||
#include "particlesystem.h"
|
||||
#include "initOpenGL.h"
|
||||
#include "utils.h"
|
||||
@ -29,9 +28,9 @@ int main()
|
||||
initRandomParticles(e1);
|
||||
|
||||
/************* SHADER *************/
|
||||
const GLchar *computeShaderSource = readFile("ComputeShader.glsl");
|
||||
const GLchar *vertexShaderSource = readFile("VertexShader.glsl");
|
||||
const GLchar *fragmentShaderSource = readFile("FragmentShader.glsl");
|
||||
const GLchar *computeShaderSource = readFile("./opengl/ComputeShader.glsl");
|
||||
const GLchar *vertexShaderSource = readFile("./opengl/VertexShader.glsl");
|
||||
const GLchar *fragmentShaderSource = readFile("./opengl/FragmentShader.glsl");
|
||||
|
||||
GLuint computeShader = compileShader(computeShaderSource, GL_COMPUTE_SHADER);
|
||||
GLuint vertexShader = compileShader(vertexShaderSource, GL_VERTEX_SHADER);
|
||||
|
9
shaders/vulkan/FragmentShader.frag
Normal file
9
shaders/vulkan/FragmentShader.frag
Normal file
@ -0,0 +1,9 @@
|
||||
#version 460
|
||||
|
||||
layout(location = 0) in vec3 colV;
|
||||
layout(location = 0) out vec4 colOut;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
colOut = vec4(colV, 1);
|
||||
}
|
Loading…
Reference in New Issue
Block a user