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

Nearly no explosions at all

parent cdd6a5fa
No related branches found
No related tags found
1 merge request!103Added project wobble_bobble and refactored some parts of the framework
...@@ -71,7 +71,7 @@ void main() { ...@@ -71,7 +71,7 @@ void main() {
memoryBarrierShared(); memoryBarrierShared();
} }
gridValue.xyz += vec3(0.0f, -9.81f * dts * gridValue.w, 0.0f); gridValue.xyz += vec3(0.0f, -9.81f * dts * gridValue.w * 0.0f, 0.0f);
gridValue.xyz /= gridValue.w; gridValue.xyz /= gridValue.w;
if (any(isnan(gridValue.xyz)) || any(isinf(gridValue.xyz))) { if (any(isnan(gridValue.xyz)) || any(isinf(gridValue.xyz))) {
...@@ -90,7 +90,7 @@ void main() { ...@@ -90,7 +90,7 @@ void main() {
(lowerID.z && negativeVelocity.z) || (greaterID.z && positiveVelocity.z) (lowerID.z && negativeVelocity.z) || (greaterID.z && positiveVelocity.z)
); );
gridValue.xyz = mix(gridValue.xyz, vec3(0.0f), collision); gridValue.xyz = mix(gridValue.xyz, -gridValue.xyz, collision);
barrier(); barrier();
memoryBarrierShared(); memoryBarrierShared();
......
...@@ -85,7 +85,7 @@ void main() { ...@@ -85,7 +85,7 @@ void main() {
mat3 delta = lame2 * (F - F_T_inv) + lame1 * log(J) * F_T_inv; mat3 delta = lame2 * (F - F_T_inv) + lame1 * log(J) * F_T_inv;
mat3 stress = (1.0f / J) * delta * F_T; mat3 stress = (1.0f / J) * delta * F_T;
mls_Q -= dts * volume * stress * D_inv; mls_Q -= dts * volume * D_inv * stress;
} }
affine_C = affine_B * D_inv; affine_C = affine_B * D_inv;
......
...@@ -171,13 +171,13 @@ int main(int argc, const char **argv) { ...@@ -171,13 +171,13 @@ int main(int argc, const char **argv) {
swapchainExtent.height swapchainExtent.height
).getHandle(); ).getHandle();
glm::vec3 initialVelocity (0.0f, 1.0f, 0.0f); glm::vec3 initialVelocity (0.0f, 0.1f, 0.0f);
float density = 2500.0f; float density = 2500.0f;
float radius = 0.1f; float radius = 0.1f;
vkcv::Buffer<Particle> particles = core.createBuffer<Particle>( vkcv::Buffer<Particle> particles = core.createBuffer<Particle>(
vkcv::BufferType::STORAGE, vkcv::BufferType::STORAGE,
64 256
); );
resetParticles(particles, initialVelocity, density, radius); resetParticles(particles, initialVelocity, density, radius);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment