Skip to content

Rafapp/jellyengine

Repository files navigation

A 3D Game Engine specialized for Soft Body Physics

Motivation

Most (if not all) modern game engines are capable of only simulating rigid body dynamics (left). However their counterpart, soft bodies (right) are not a feature available to developers out of the box or without the need to tinker and create custom solutions to solve for them in real-time rendering applications such as games and interactive media.

It is for this reason that we decided to build Jelly Engine.


Soft bodies are all around us in the physical world. Ubiquitous materials such as human skin, rubber balls or even jelly behave in complex ways, which are typically hard to simulate and even more so at runtime while maintaining good performance in current hardware. Applications of this technology could be, but are not limited to:

  • Medicine: Training environments for surgery practicioners with high fidelity models of human organs and anatomy.
  • Engineering: Simulation and analysis of deformable materials like polymers and lattice structures.
  • Interactive applications: New game design mechanics involving deformable 3D objects.

Features

Rendering
  • OpenGL rasterized graphics.
  • Support for 26+ 3D file formats.
  • Shaders (fragment, vertex, compute).
  • Blinn-phong shading with rgb color.
  • Multi-model scenes.
  • "Gummy Shader:" A jelly-like shader based on the Oren-Nayar reflectance model (simulate SSS).

Stanford Dragon: 566,098 vertices, 1,132,830 triangles

Rendering realtime at 200+ FPS using "Gummy Shader"

Soft Body Physics
  • Dampened spring-mass model.
  • Euler integration.
  • Realtime soft body simulation.
  • Softbody-plane collision.
  • "Toybox" demo with 5 different soft bodies to play with, made with Jelly Engine.

"Toybox" demo made with Jelly Engine.

Instructions

Running the toybox demo:

  1. Install CMake.
  2. Add CMake to PATH.
  3. Run build.bat to build the engine with the toybox demo game.
  4. If the demo builds successfully, an out folder in the root folder will be generated. Go to out/Game/game.exe and run the demo!

Creating your own game

  1. Install CMake.
  2. Add CMake to PATH.
  3. Write your own game code in Game/src/game.cpp and Game/src/game.h.
    • Use the toybox demo provided as a template, delete the contents of its functions.
    • You can write your code using the Start(), Update(), and Exit() functions.
    • We recommend using the toybox demo provided to see how to work with a light, the scene vector, the 3D Model class, and the SoftBody class.
  4. Run build.bat to build the engine with your specific game.
  5. If your C++ code compiles and links, an out folder in the root folder will be generated. Go to out/Game/game.exe and run your game!

Building the engine as a static library JellyEngine.lib

  1. Install CMake.
  2. Add CMake to PATH.
  3. Modify the engine as needed.
  4. Run the engine's build.bat file to build the engine as a static library.
  5. If your C++ code compiles and links, an out folder in the root folder will be generated. Go to out/Engine and you should see the file JellyEngine.lib. You can now link this library with any C++ application.

Credits

  • Rafael Padilla Perez: C++ Code, game engine architecture, design and implementation.
  • Joshua Ebreo: Spring mass model research and testing repository.

Acknowledgements

This project could not have been accomplished without the support and guidance of our project advisor, Professor Kevin Smith, the counsel from Spartak Gevorgyan, and the encouragement and support from our family, friends, and peers in the Software Engineering Program at San Jose State University.

Research poster

U24 Poster pptx

About

Jelly Engine - a 3D Game Engine focused on realtime soft body physics simulation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •