Back to projects

lwjgl_physics_engine_2.0

3D game engine with OpenGL, GLSL shaders, and Bullet Physics in Kotlin. Built in January 2022.

Updated Jan 25, 2026

LWJGL Physics Engine 2.0

A 3D game engine with OpenGL rendering, GLSL shaders, and Bullet Physics integration, built in Kotlin.

Note: This was an early project, created in January 2022 when I was 14. The code remains unchanged from the original - this README was added later for archival purposes.

Features

  • OpenGL rendering via LWJGL
  • GLSL shaders with Phong lighting model
  • Bullet Physics integration for rigid body dynamics
  • OBJ model loading
  • Material system (ambient, diffuse, specular, reflectance)
  • Lighting (directional + point lights with attenuation)
  • Texture support
  • First-person camera

Project Structure

game_engine/
├── graphics/
│   ├── Shader.kt          # Shader compilation & uniform management
│   ├── Mesh.kt            # VAO/VBO handling
│   ├── Model.kt           # Model with material & texture
│   ├── GameWindow.kt      # LWJGL window & render loop
│   ├── lighting/
│   │   ├── DirectionalLight.kt
│   │   ├── PointLight.kt
│   │   └── Material.kt
│   └── objects/
│       ├── GameObject.kt
│       └── OBJ.kt         # Wavefront OBJ loader
├── maths/
│   ├── Camera.kt
│   └── Transform.kt
└── input/
    └── Input.kt

physics_engine/
├── PhysicsWorld.kt        # Bullet dynamics world wrapper
└── RigidBody.kt

Shaders

The engine includes two shader sets:

  • basic - Unlit rendering
  • lit - Full Phong lighting with:
    • Ambient light
    • Directional light
    • Point lights with distance attenuation
    • Specular highlights

Dependencies

  • LWJGL 3 (OpenGL, GLFW)
  • JOML (math library)
  • JBullet (Bullet Physics Java port)

Author

Oliver Seifert (@ImGajeed76) - January 2022