Commit 2b7dfecf authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

Merge remote-tracking branch 'refs/remotes/origin/master'

Conflicts:
	ba_gaida/src/shaders/ba_gaida/arbitraryPositionShader.glsl
	ba_gaida/src/shaders/ba_gaida/normalShader.glsl
	doku/2014_EG_SPH_STAR.pdf
	doku/Quellen/2014_EG_SPH_STAR.pdf
	doku/cgBA_Latex/BA.aux
	doku/cgBA_Latex/BA.bbl
	doku/cgBA_Latex/BA.lof
	doku/cgBA_Latex/BA.log
	doku/cgBA_Latex/BA.out
	doku/cgBA_Latex/BA.pdf
	doku/cgBA_Latex/BA.synctex.gz
	doku/cgBA_Latex/BA.tex
	doku/cgBA_Latex/BA.toc
	doku/cgBA_Latex/Bilder/StoringLable.JPG
	doku/cgBA_Latex/lib.bib
parents 1af9419e 1bdbe2f7
......@@ -27,3 +27,5 @@ doku/cgBA_Latex/main.synctex.gz
doku/cgBA_Latex/main.tex
doku/cgBA_Latex/main.toc
doku/Präsentation
doku
......@@ -308,17 +308,17 @@ if(m_imguiUi == true){
"CS Swapping: \t%.8f ms\n"
"CS Collision: \t%.8f ms\n"
"Renderer: \t%.8f ms\n",
m_fps->getTimestamp(0) * 1000, m_fps->getTimestamp(1) * 1000, m_fps->getTimestamp(2) * 1000,
m_fps->getTimestamp(3) * 1000, m_fps->getTimestamp(4) * 1000, m_fps->getTimestamp(5) * 1000,
m_fps->getTimestamp(6) * 1000, m_fps->getTimestamp(7) * 1000, m_fps->getTimestamp(8) * 1000,
m_fps->getTimestamp(9) * 1000);
m_fps->getTimestamp(0) * 100, m_fps->getTimestamp(1) * 100, m_fps->getTimestamp(2) * 100,
m_fps->getTimestamp(3) * 100, m_fps->getTimestamp(4) * 100, m_fps->getTimestamp(5) * 100,
m_fps->getTimestamp(6) * 100, m_fps->getTimestamp(7) * 100, m_fps->getTimestamp(8) * 100,
m_fps->getTimestamp(9) * 100);
ImGui::Text("-----------------------------------------------");
}
ImGui::SetWindowSize(ImVec2(350, 150 * m_imgui_applications), 0);
if (m_running == true)
{
ImGui::Text("Application average %.4f ms/frame (%.i FPS)", 1000.f / m_fps->getFPS(),
ImGui::Text("Application average %.4f ms/frame (%.i FPS)", 100.f / m_fps->getFPS(),
m_fps->getFPS());
}
ImGui::End();
......
......@@ -136,7 +136,7 @@ int main()
glViewport(0, 0, WIDTH, HEIGTH);
if ((glError = glGetError()) != GL_NO_ERROR)
{
std::cout << "2.OpenGL-Error: " << glError << std::endl;
std::cout << "OpenGL-Error: " << glError << std::endl;
}
double time = glfwGetTime();
double deltaTime;
......
#version 450
/*
* 1.5 ComputeShader
* swaping Particle SSBO's
*/
layout(local_size_x = 100, local_size_y = 1, local_size_z = 1) in;
struct Particle{
vec4 position;
vec4 velocity;
vec4 startPosition;
vec4 normal;
vec4 vorticity;
float temperature;
uint memoryPosition;
float density;
float pressure;
};
struct Grid{
int gridID;
int particlesInGrid;
int previousSortOutPut;
int currentSortOutPut;
};
layout(std430, binding = 0) writeonly buffer buffer_outParticle
{
Particle outParticle[];
};
layout(std430, binding = 1) readonly buffer buffer_inParticle
{
Particle inParticle[];
};
layout(std430, binding = 2) coherent buffer buffer_grid
{
Grid grid[];
};
uniform uint particleCount;
uniform float deltaTime;
uniform ivec4 gridSize;
uniform vec4 externalForce;
uniform vec4 particleSettings;
uniform float temperature;
//float mass;
//float restingDensity;
//float stiffness;
//float radius;
const float PI = 3.14159265f;
const float beta = 5; // 0-1
vec3 gradientWeight(vec3 relativePosition)
{
float c = -45.0 / PI / pow(particleSettings.w, 6);
float l = max(length(relativePosition), 0.0001);
return c * relativePosition / l * pow(abs(particleSettings.w - l), 2.0)*float(l <= particleSettings.w);
}
uint cubeID(vec4 position){
return int(floor(position.x) * gridSize.x * gridSize.x + floor(position.y) * gridSize.y + floor(position.z));
}
void main(void) {
uint id = gl_GlobalInvocationID.x;
uint neighborGrid;
vec3 normal = vec3(0.f);
vec3 k = vec3(0.f);
if (id >= particleCount)
{
return;
} else
{
outParticle[id] = inParticle[id];
for (int x = -1; x <= 1; x++){
for (int y = -1; y <= 1; y++){
for (int z = -1; z <= 1; z++){
neighborGrid = cubeID(inParticle[id].position + vec4(x, y, z, 0));
int count = 0;
for (int j = grid[neighborGrid].currentSortOutPut; j < grid[neighborGrid].currentSortOutPut
+ grid[neighborGrid].particlesInGrid && count <= 16; j++){
if(j == id){
continue;
}
normal += (particleSettings.x / inParticle[j].density)
* gradientWeight(inParticle[id].position.xyz - inParticle[j].position.xyz);
count++;
}
}
}
}
outParticle[id].normal = vec4(normal, 0.f);
k = inParticle[id].vorticity.xyz * gradientWeight(inParticle[id].velocity.xyz);
outParticle[id].vorticity = vec4((k + beta * cross(normal, externalForce.xyz)),0.f) * deltaTime;
}
}
\ No newline at end of file
1. Recherche
2. Framework erstellen und Techniken erlernen
3. Implementation des Partikelsystems
4. Peformanceverbesserungen
5. Abwägen des Erreichten und Vergleich mit anderen Partikelsystemen
6. Ausarbeitung schreiben
https://online.officetimeline.com/app/#/file/d1e8f431-ef49-456b-afd2-0084f1f94cd5/gantt-view
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment