Reducing Reduntant Render State Changes from DirectX 11.0

I’ve been experiencing frame rate drops when rendering different meshes using my DirectX 11.0 based framework to debug physics and create testbeds. My GPU is a (very-old but still working) NVIDIA 8400 GS 512 MiB of VRAM, so I’ve noted that the problem was brute-force setting a bunch of render states before issuing a draw call.

Continue reading

Mouse Constraint Derivation

You can read here how to compute the mouse constraint Jacobian, which I think is the simplest constraint along with a distance constraint. It can be helpfull when you’re selecting geometries in the scene using the mouse world space position (as a joint anchor point), since there is lack of controlability by directly applying forces at a particular point of a rigid body shape.

Errata: There is a minus sign before the stabilization term. It should be:

Lambda = (J * M * J^T)-1 * (-J * V – Beta / TimeStep * C)

Note: You can bound excessive impulses to avoid excessive velocity changes.

Thanks to Dirk Gregorius of Valve for pointing those things out via e-mail.

Continue reading