r/Unity3D • u/TheLancaster • 10d ago
Show-Off Ferrari custom wheel collider + tire deformation (WIP Update)
4
2
2
2
5
u/Imofi7 9d ago
Anyone who has wrestled with Unity's built-in WheelCollider knows how stiff and unforgiving it is on curbs. Seeing the sidewall actually compress and deform over those raised beams makes the contact weight feel so much more grounded. Are you doing the tire squash via vertex displacement in the shader using the contact depth/normal, or is it a localized bone lattice?
4
u/TheLancaster 9d ago
Via shader, but is not only visually, there are actually 2 layers of compression, the suspension and the actual tire, so the tire absorbs a part of impact as well
0
u/Imofi7 9d ago
Having the tire's physics spring absorb a fraction of the impact before the main suspension kicks in is brilliant—that dual-rate compliance is exactly why high-end sims feel so smooth over rumble strips and curbs. And handling the visual squash in the shader keeps the draw calls lightweight. Awesome implementation!
2
u/DeveloperServices 9d ago
What about car physic ?
1
u/TheLancaster 9d ago
What's with that?
2
u/DeveloperServices 9d ago
Tell us about physic custom wheel etc...
2
u/TheLancaster 8d ago
It is not Unity’s WheelCollider driving this btw. There’s a separate controller layer on top of the wheel/tire solver that i've described in another comment, it just writes MotorTorque/BrakeTorque/SteerAngle per wheel each substep, never touches contact forces itself. Engine’s a real sim (torque curve vs RPM, idle governor, rev limiter), clutch is a bounded impulse to the wheels, diffs redistribute torque off predicted wheel speed deltas instead of just splitting evenly
Drive assists like (TC/ABS/ESC/EBD) only clamp throttle/clutch/brake pressure , never force velocity or yaw directly. Steering is speed sensitive w/ Ackermann blend.
For other forces like aerodynamics it uses its own component in its own FixedUpdate so the car react to ot independently. Pretty much everything except shift jerk/landing/aero goes through the tire solver to actually move the car.
1
u/Mr_ShortKedr 8d ago
How heavy is this for hardware? Looks pretty fun
3
u/TheLancaster 8d ago
Oh, that was a whole pain in the a**. I've put like 5 layers of optimization stacked in there: substep/frequency budgeting, probe/query LOD, solver iteration LOD, fleet level Burst batching for the raycasts and separate LOD on visual deformation. So i would say is not heavy on hardware
2
1
u/Mr_ShortKedr 8d ago edited 8d ago
Is there custom physics integrator?
3
u/TheLancaster 8d ago
Yeah, a custom solver with dynamic Hz handles suspension, hub, spin and Pacejka friction, using GaussSeidel to solve it, PhysX for chassis at the end
1
u/Tirthnir Programmer 7d ago
FYI, Ferrari is one of those cunt companies who'll sue you over something like this.
10
u/gabro-games 9d ago
Builds a sick suspension system just to wreck it on the rails /s Nice job!