Skip to content
Snippets Groups Projects
Verified Commit 0939ded5 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Removed grid collision handling

parent f74c7a39
No related branches found
No related tags found
1 merge request!103Added project wobble_bobble and refactored some parts of the framework
......@@ -27,7 +27,6 @@ shared Particle shared_particles [SHARED_PARTICLES_BATCH_SIZE];
void main() {
barrier();
memoryBarrierBuffer();
memoryBarrierShared();
memoryBarrierImage();
......@@ -49,23 +48,7 @@ void main() {
velocity += vec3(0.0f, -9.81f * dt, 0.0f);
}
bvec3 lowerID = lessThanEqual(gl_GlobalInvocationID, ivec3(0));
bvec3 negativeVelocity = lessThan(velocity, vec3(0.0f));
bvec3 greaterID = greaterThanEqual(gl_GlobalInvocationID + ivec3(1), imageSize(gridForceImage));
bvec3 positiveVelocity = greaterThan(velocity, vec3(0.0f));
bvec3 invert = bvec3(
(lowerID.x && negativeVelocity.x) || (greaterID.x && positiveVelocity.x),
(lowerID.y && negativeVelocity.y) || (greaterID.y && positiveVelocity.y),
(lowerID.z && negativeVelocity.z) || (greaterID.z && positiveVelocity.z)
);
velocity = mix(velocity, -velocity, invert);
barrier();
memoryBarrierBuffer();
memoryBarrierShared();
memoryBarrierImage();
imageStore(
......
......@@ -84,7 +84,7 @@ void main() {
mat3 delta = lame2 * (F * F_T - mat3(1.0f)) + lame1 * log(J);
mls_Q -= beta * dt * volume * delta * D_inv;
mls_Q += beta * dt * volume * delta * D_inv;
}
affine_C = affine_B * D_inv;
......
......@@ -534,8 +534,8 @@ int main(int argc, const char **argv) {
float compression_modulus = material.m_compression / 1E9;
float elasticity_modulus = material.m_elasticity / 1E9;
float alpha = 1.0f;
float beta = 0.0f;
float alpha = 0.0f;
float beta = 1.0f;
auto start = std::chrono::system_clock::now();
auto current = start;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment