hankotanks / engine_demo

Primitive engine to render basic 3D geometry with blinn-phong lighting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

engine_demo

A basic rendering engine with an adjustable 3D camera, a grid-based environment system, and sliding entities with (janky) collision physics.

demo

Features

  • World tiles that inherit from a single trait
    • Responsible for their own geometry
    • Extensible (although only cubes are implemented at this time)
    • Emissive lighting, projects from the surfaces of the tile
  • Entities
    • Built on the same Drawable trait used for tile geometry
      • Can emit light as a result
    • Position is FP, unlike tiles
    • Position can be set frame-by-frame, unlike tiles
    • Subject to engine physics
  • Physics
    • Adjustable gravity
    • 3D collision detection/resolution (along Tile edges)
    • Entities move through the application of force vectors
  • Controller
    • Lateral movement via arrow keys
    • Emissive entities can be thrown by dragging and releasing the left mouse button
  • Camera
    • Orbits around a central point
    • Can be assigned to an entity
    • Individual axis can be locked or restricted
  • Lighting
    • Uses the Blinn-Phong model for simplicity
    • Color of emission and its intensity can be adjusted

Limitations

  • Primitive physics
  • Geometry cannot be loaded from files
  • Light data is passed to the GPU as a fixed-size array, which caps the number of lights in the scene
  • Tile meshes are non-optimal. Adjacent tiles with continuous surfaces do not combine triangles

Although I initially had greater ambitions, this project was largely an excuse to play around with the matrix math that I was learning about in Linear Algebra at the time, and many things are (and will forever be) unfinished.

Graphics programming was brand new to me when I started this project. In hindsight, the interface between the CPU & GPU is inefficient and generally terrible, as is the rendering process itself.

About

Primitive engine to render basic 3D geometry with blinn-phong lighting


Languages

Language:Rust 95.9%Language:WGSL 4.1%