Finished for Abgabe
This commit is contained in:
parent
0ac020d531
commit
33329c10d0
@ -48,12 +48,12 @@ int main()
|
|||||||
emitter *e;
|
emitter *e;
|
||||||
particle *p;
|
particle *p;
|
||||||
vector3f *pos;
|
vector3f *pos;
|
||||||
for (int j = 0; j < ps->eamount; j++)
|
for (int y = 0; y < ps->eamount; y++)
|
||||||
{
|
{
|
||||||
e = (ps->emitters)[j];
|
e = (ps->emitters)[y];
|
||||||
for (int i = 0; i < e->pamount; i++)
|
for (int x = 0; x < e->pamount; x++)
|
||||||
{
|
{
|
||||||
p = (e->particles)[i];
|
p = (e->particles)[x];
|
||||||
pos = p->position;
|
pos = p->position;
|
||||||
|
|
||||||
glColor3f(p->color->x, p->color->y, p->color->z);
|
glColor3f(p->color->x, p->color->y, p->color->z);
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
|
|
||||||
#include "glad/glad.h"
|
#include "glad/glad.h"
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#ifndef INFORMATIKPROJEKT_INITOPENGL_H
|
|
||||||
#define INFORMATIKPROJEKT_INITOPENGL_H
|
|
||||||
|
|
||||||
void initGlad();
|
void initGlad();
|
||||||
|
|
||||||
void initGLFW();
|
void initGLFW();
|
||||||
@ -21,5 +17,3 @@ void framebufferSizeCallback(GLFWwindow *window, int width, int height);
|
|||||||
GLuint compileShader(const GLchar *shaderSource, GLenum shaderType);
|
GLuint compileShader(const GLchar *shaderSource, GLenum shaderType);
|
||||||
GLuint linkShaders(GLuint *shaders, GLsizei count);
|
GLuint linkShaders(GLuint *shaders, GLsizei count);
|
||||||
void deleteShaders(GLuint *shaders, GLsizei count);
|
void deleteShaders(GLuint *shaders, GLsizei count);
|
||||||
|
|
||||||
#endif //INFORMATIKPROJEKT_INITOPENGL_H
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#define ENGINE_NAME "rwu_particles"
|
#define ENGINE_NAME "rwu_particles"
|
||||||
#define ENGINE_VERSION VK_MAKE_VERSION(0, 0, 0)
|
#define ENGINE_VERSION VK_MAKE_VERSION(0, 0, 0)
|
||||||
|
|
||||||
#define PARTICLE_AMOUNT 10000000
|
#define PARTICLE_AMOUNT 1000000
|
||||||
#define PARTICLE_SIZE (3 * sizeof(vector3f) + sizeof(float))
|
#define PARTICLE_SIZE (3 * sizeof(vector3f) + sizeof(float))
|
||||||
#define WORKGROUP_SIZE_Y 1
|
#define WORKGROUP_SIZE_Y 1
|
||||||
#define WORKGROUP_SIZE_Z 1
|
#define WORKGROUP_SIZE_Z 1
|
||||||
@ -144,5 +144,3 @@ void createGraphicsCommandBuffers(Graphics *graphics);
|
|||||||
// Else
|
// Else
|
||||||
void mapBufferMemory(Compute *compute, VkDeviceMemory memory, void *inputData, uint32_t dataSize);
|
void mapBufferMemory(Compute *compute, VkDeviceMemory memory, void *inputData, uint32_t dataSize);
|
||||||
void createSemaphore(VkDevice device, VkSemaphore *semaphore);
|
void createSemaphore(VkDevice device, VkSemaphore *semaphore);
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ int main()
|
|||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//END
|
//END
|
||||||
deleteShaders(renderShaders, 2);
|
deleteShaders(renderShaders, 2);
|
||||||
glDeleteProgram(renderShaderProgram);
|
glDeleteProgram(renderShaderProgram);
|
||||||
|
@ -42,7 +42,7 @@ particle_system *initParticleSystem(int eamount)
|
|||||||
/*
|
/*
|
||||||
* Updates particles
|
* Updates particles
|
||||||
*/
|
*/
|
||||||
int updateParticles(float dt, particle_system *ps, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor)
|
void updateParticles(float dt, particle_system *ps, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor)
|
||||||
{
|
{
|
||||||
emitter *e;
|
emitter *e;
|
||||||
particle *p;
|
particle *p;
|
||||||
|
@ -69,7 +69,7 @@ particle_system *initParticleSystem(int eamount);
|
|||||||
/*
|
/*
|
||||||
* Updates particle
|
* Updates particle
|
||||||
*/
|
*/
|
||||||
int updateParticles(float dt, particle_system *particleSystem, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor);
|
void updateParticles(float dt, particle_system *particleSystem, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resets a particle to seed at emitter's position
|
* Resets a particle to seed at emitter's position
|
||||||
|
@ -7,6 +7,3 @@ void main(void)
|
|||||||
{
|
{
|
||||||
colOut = vec4(colV, 1);
|
colOut = vec4(colV, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,5 +10,3 @@ void main(void)
|
|||||||
colV = colIn;
|
colV = colIn;
|
||||||
gl_Position = vec4(pos, 1);
|
gl_Position = vec4(pos, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,4 +143,3 @@ int main()
|
|||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user