Age | Commit message (Collapse) | Author |
|
This can be useful as a workaround on the boundary with the pinned
vertices in some situations among other things, and completely copies
the existing design of the self collision vertex group setting.
Differential Revision: https://developer.blender.org/D10043
|
|
The `object.collision.use` flag was treated as a redundant marker
of the existence of the modifier, going as far as adding/removing
it when the value was changed, which is not actually very useful.
Removing the modifier loses its position in the stack, and requires
a dependency graph rebuild. It feels it may be a legacy flag?
What would be useful however is the ability to toggle collisions
dynamically without removing the modifier. This patch adjusts the
code to keep the modifier when the flag is disabled, and add it
if it doesn't exist when the flag is enabled. The modifier now
checks the flag at the start and quickly exits after cleaning
up stale data. The redesigned setting is exposed in the UI.
Collisions can't be disabled by simply using the modifier enable
flags because the modifier merely saves a snapshot of the mesh at
a certain point of the modifier stack for other objects to use,
and thus has to be able to clear the stale data.
Differential Revision: https://developer.blender.org/D10064
|
|
Currently such triangles are effectively already excluded, because
the calculated forces are not applied to pinned vertices. However
these forces are still being computed, which is inefficient.
This adds an early check for triangles where all vertices are
pinned during BVH overlap detection, which significantly speeds
up certain use cases with big fully pinned areas that happen to
overlap a collider. In case of self collision both triangles must
be fully pinned to exclude safely, because the computation is
symmetric and handles two triangles at the same time.
Differential Revision: https://developer.blender.org/D10041
|
|
|
|
And rename `cloth_selfcollision_impulse_vert` to `cloth_collision_impulse_vert`
|
|
|
|
|
|
|
|
|
|
|
|
And do the clamp by vertex instead of triangle.
|
|
The problem is caused by a lack of prediction in the `isect_line_segment_tri_v3`
that incorrectly confirms some intersections of coplanar segments to the triangle.
The solution is to use another algorithm to detect intersections.
This also resulted in a slight improvement in the performance:
- 1min 17sec to 1min 6sec in my test file
Differential Revision: https://developer.blender.org/D8500
|
|
Also remove the code in the ghash that is no longer used.
This change simplifies the existing code.
Differential Revision: https://developer.blender.org/D8219
|
|
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
|
|
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.
There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).
For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.
Differential Revision: https://developer.blender.org/D7051
|
|
As explained in T65568 by @LucaRood, the self collision system should exclude triangles that are connected by sewing springs.
Differential Revision: https://developer.blender.org/D6911
|
|
15% to 20% improvement in cloth simulation performance with
self-collision.
The idea is to reduce the number of collisions computed by avoiding
overlapping tris with the same combination (eg. (1,0) and (0,1)).
Reviewed By: zeddb
Differential Revision: https://developer.blender.org/D6474
|
|
This integrates hair collisions with the new cloth collision system,
greatly improving reliability, and reducing the amount of hair-specific
code paths in the cloth code.
The removes all the point constraint based collision stuff, instead
implementing segment impulse based collisions, using the same collision
response code as the normal cloth solver.
The hair system can now also collide with the emitter if it is a
collision object.
Reviewed By: mano-wii, Sebastian Parborg
Differential Revision: https://developer.blender.org/D6545
|
|
An optimisation in the collision system for cloth (static collisions),
broke the particle collisions, as they take motion into account. This
restores the moving BVH required for the particle collisions, while
keeping the optimisation for the cloth collisions.
Reviewed By: mano-wii
Maniphest Tasks: T71620
Differential Revision: https://developer.blender.org/D6560
|
|
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
TLS and Settings can be used by other types of parallel 'for loops', so
removing 'Range' from their names.
No functional changes expected here.
|
|
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
Not only were those often making doublons with already existing
BLI_math's stuff, but they were also used to hide implicit type
conversions...
As usual this adds some more exotic inlined vector functions (one of
the rare cases where I really miss C++ and its templates... ;) ).
|
|
Needed for clang formatting to workaround bug/limit, see: T53211
|
|
No apparent difference in a quick simulation, but was clearly wrong.
|
|
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D3802
|
|
algorith.
In my tests a 4% improvement in performance was achieved by simulating a square cloth over the cube.
|
|
This commit includes several performance, stability, and reliability
improvements to cloth collisions.
Most notably:
* The implementation of a new self-collisions system.
* Multithreading of collision detection.
* Implementation of single sided collisions and normal overrides.
* Replacement of the `plNearestPoints` function from Bullet with a
dedicated solution.
Further, this also includes several bug fixes, and algorithmic
improvements.
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D3712
|
|
This reorganizes the cloth UI, and changes some of the behaviour to be
more reasonable.
Changes included here:
* Reorganized cloth panels
* Improved some tooltips
* Removed `vel_damping` option
* Removed cloth pinning checkbox
* Removed stiffness scaling checkbox
* Separated shrinking from sewing
* Separated self collisions from object collisions
Reviewed By: brecht
Differential Revision: http://developer.blender.org/D3691
|
|
Conflicts:
source/blender/blenkernel/intern/collision.c
|
|
objects to test against.
Followup to rBc6bbe6c5aac29, much more elegant solution to the problem. ;)
|
|
|
|
Not freeing its BVHTree in case there were no collision objects,
could quickly lead to hundreds of MB of memleak!
|
|
|
|
Because looping over the scene is unsafe and slow.
|
|
|
|
Only enabled objects in the view layer should be used, while temporarily
hidden objects should still have an effect.
|
|
|
|
Same reasoning as effector relations in earlier commit.
|
|
|