Acceleration Based Physbones (Toggle)
Wunder Wulfe
I have been having a constant issue with physbones that has plagued so many of my avatars in the past and it has all been due to the way that Physbones operates.
Physbones move based on the movement of their root bone, which in practice, is good,
however
, not all physbone chains should operate in this fashion. Hair, tails, and cloth makes sense this way, but not things such as ears, chest, and necklaces.This is
partially
solved currently by enabling the Inertia (World)
setting and moving it all the way to 1.0
, however this completely prevents the adjustment of local
intertia, and also will disable avatar movement in the world from affecting the Physbones at all.The feature I am requesting is to have a toggle or slider to control the behavior of the Physbone, from relying on velocity to instead rely on acceleration. This will transfer the acceleration of the root across the physbone, as opposed to transferring the velocity.
As a result, the physbone will remain in its resting state regardless of if the avatar is in motion or not, preventing things such as the chest constantly clipping into the body of the avatar or floating when moving, but also allowing it to move when jumping or when changing the movement input.
This will be due to how the acceleration is 0 when moving at the same velocity.
The application of such a feature is suggested by modifying the Velocity and Position values of Physbones to allow for acceleration to propagate into the Physbone chain and remove the impact that velocity has based on a Drag factor.
Example pseudo-implementation:
// Keep track of global movement of Physbone by computing the displacement from one timestep to the next
CurrentPositionDifference = CurrentRootPosition - LastRootPosition;
Displacement = CurrentPositionDifference - LastPositionDifference;
// If there is no Drag, then the Physbone does not react to the Air
// This means that the Physbone's displacement is no longer free-floating
// As a result, the free-floating position must be cancelled (non-destructively), and the immediate displacement added
PhysbonePosition += (PositionDifference - Displacement) * (1.0f - Drag);
// Calculate spring physics like normal, incorporating the change in velocity
PhysboneVelocity += SpringPhysics(Physbone) * deltaTime;
This will allow most Physbones to continue to flow freely through the air as normal, but specific physbones that are more rigidly 'Attached' to their parents will behave much more realistically as opposed to constantly having movement forces applied to them.
This could also be named via a
Wind
or Air Drag
factor, as it is presumed that flowing items react to air in a way that would cause it to experience those forces, whereas something like the chest would not.Attached is an example video showing the difference
Log In
Wunder Wulfe
More accurate names for this suggestion could be “Velocity Compensation for Physbones”, “Physbones: Air Drag Parameter”, “Rigidity for Physbones”, and “Physbone Flow Physics Parameter”, but the title can no longer be changed so I will just leave this as a comment.
It is also important to update the velocity in the pseudo-code example I provided.
I believe this would be done via
velocity -= Displacement * (1.0f - Drag) / deltaTime;
as this would affect positional displacement later on and spring physics calculations.If using variable timesteps as opposed to fixed timesteps when computing these values, it may be important to normalize them in terms of deltaTime, such that position differences become velocities, and velocity differences become accelerations, otherwise you may encounter jitter from ‘displacement’ being wrongfully calculated.
It may be useful to scale deltaTime to a larger value in order to enhance precision at the smaller fractionals, i.e.
deltaTime*100f
or SIM_FPS*deltaTime
if there is a specific simulation frequency that is desired. This will be more apparent when working with lower precision floats or accurately calculating accelerations.淫神 Nafryti
The current Physics calculations on your CPU is rather low, you want to add the recursive decay of simulated physics to the CPU now? on EVERY avatar? This is not only heavy depending on the implementation, but users who have a 50 series GPU cannot use PhysX accelleration on their GPU as Nvidia removed that, and VRChat would have to find a reasonable licensing for the physics calculations engine based on what you want, the best being the Havoc Engine. Omitting the monetary requirements for any of these options, this will add a load to everyone with it enabled, with a significant jump in CPU usage.
Some users cannot afford that performance tax, and some who think they can, will be humbled by the sheer number of avatars using PhysBones after a simulation update like that. Even with an optimized physics engine, the number of avatars using PhysBones is enough to make any CPU cry, maybe not with a GPU, but again, nvidia dropped that support on the 50 series.
Not sure how many PhysBones your avatar has but when you consider that the average hair has over a dozen, and some Furry avatars have dozens all over like it's a fashion statement, and then add the additional processing overhead of simulation... good night.
Wunder Wulfe
淫神 Nafryti
I’m not entirely sure what you mean regarding the physics calculations and GPU stuff; you can compute the displacement from one frame to the next, as well as the “difference in velocity”, which will allow you to estimate the acceleration across that frame and adjust the physbone accordingly such that its reference point is the same regardless of the velocity, the only difference in behavior occurring when velocity changes.
Additional load should only be marginal memory usage for each physbone chain, similarly for calculation load. I don’t see how this differs from whatever other methods of monitoring transforms and velocities that Physbones already use in their implementation
This post revolves around a unique method for calculating movement for Physbones, not hardware acceleration. More accurately, it is to implement a new property such that the Physbones only react to acceleration as opposed to
all
form of movement, preventing them from “Flowing” through the air when it would be unnatural.Wunder Wulfe
Wunder Wulfe
Diagram demonstrating the proposed implementation