Перейти к содержимому

Upgrading My GPU Softbody Physics Engine to 3D

Biped Potato

0:00 / 0:00

Upgrading My GPU Softbody Physics Engine to 3D

1 332 просмотра · 1 г. назад
Biped Potato
5,38 тыс. подписчиков
1 332 просмотра · 1 г. назад
#physics #shaders #opengl In this video I decided to push the boundaries of my graphics programming knowledge to see if I could transform my 2D SoftBody simulation and make it run in 3D. In the end, I was able to land a workable 3D SoftBody simulation which can simulate multiple softbodies that can be a variety of shapes because we are able to import 3D models with assimp into the scene. The project is made with C++ and OpenGL and functions using the spring mass softbody simulation model. 2D and 3D SoftBody Simulations are vastly different in that 3D softbody simulation must employ more advanced collision detection algorithms to determine whether a collision is present. For example, where a 2D SoftBody simulation can extend a very simple 2D ray and count even odd intersections to see if a point is inside of a shape, 3D SoftBody simulations must employ ray triangle intersection algorithms which involve linear algebra and barycentric coordinate conversions to accomplish the same point in shape algorithm leading to more edge cases and much more complicated algorithms. This, along with the complications of 3D rotations which require the use of Quaternions as opposed to the 2D system of single value angles makes it so that 3D SoftBody Simulation definitely warrant a separate video. These problems and more will all be covered in this video with whiteboard solutions and sometimes even visualizations written with motion canvas. Hope you all enjoy the video! Upgrading My GPU Softbody Physics Engine to 3D Timestamps 0:00 - Intro 0:34 - 2D Point in Polygon Problem 0:57 - 3D Point in Mesh Problem Context 1:38 - Barycentric Coordinates Visualization 4:39 - Ray Plane Intersections 6:28 - Collision Resolution(Position) 8:25 - Collision Resolution(Velocity) 9:20 - Spring Constraints 10:15 - Shape Matching Constraints with Quaternions 11:42 - Outro Links: Source Code: https://github.com/Biped-Potato/GPUPh... Rhino 3D Model: https://sketchfab.com/3d-models/lowpo... Quaternions: https://www.3dgep.com/understanding-q... 2D SoftBody Simulation: https://github.com/Biped-Potato/GPU-S... Music Used Marshmellow - Lukrembo Link :    • lukrembo - marshmallow   Biscuit - Lukrembo Link :    • lukrembo - biscuit   Better Days - Lakey Inspired Link :    • LAKEY INSPIRED - Better Days   Toby Fox - Sandy Board Link:    • 05. Sandy Board (DELTARUNE Chapter 3+4 Sou...