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

Simplified calculations

parent f228253f
No related branches found
No related tags found
1 merge request!103Added project wobble_bobble and refactored some parts of the framework
......@@ -77,15 +77,13 @@ void main() {
float J = determinant(F);
if (J > 0.0f) {
float volume = sphere_volume(size) * J;
float volume = sphere_volume(size);
mat3 F_T = transpose(F);
mat3 F_T_inv = inverse(F_T);
mat3 delta = lame2 * (F - F_T_inv) + lame1 * log(J) * F_T_inv;
mat3 stress = (1.0f / J) * delta * F_T;
mat3 stress = lame2 * (F * F_T - mat3(1.0f)) + lame1 * log(J);
mls_Q -= dts * volume * D_inv * stress;
mls_Q -= dts * volume * stress * D_inv;
}
affine_C = affine_B * D_inv;
......
......@@ -555,7 +555,7 @@ int main(int argc, const char **argv) {
auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
const uint32_t dispatchSizeGrid [3] = { 16, 16, 16 };
const uint32_t dispatchSizeGrid [3] = { grid.getWidth() / 4, grid.getHeight() / 4, grid.getDepth() / 4 };
const uint32_t dispatchSizeParticles [3] = { static_cast<uint32_t>(particles.getCount() + 63) / 64, 1, 1 };
core.recordBeginDebugLabel(cmdStream, "INIT PARTICLE WEIGHTS", { 0.78f, 0.89f, 0.94f, 1.0f });
......
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