Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

Tag: rust

#

#gamedev progress:

  • Implemented a loader for OpenRaster files. This allows me to bundle all textures needed by an object in one project file. (inspiration by tsoding)
  • Reworked rendering to use a tint texture instead of a global tint intensity. This allow to have parts of objects untinted.

Game screenshot showing 3 flasks tinted in different colors. The label is not tinted

#rust #wgpu




#

I've implemented a simple rectangle packing algorithm, which I want to use for the font texture.

The algorithm is only 40 lines long. It keeps track how far each row is already filled and greedily inserts rectangle at the place where they are "most to the left", starting with the tallest rectangles.

Debug rendering showing 1600 random rectangles packed into a canvas

#rust #gamedev




#

#gamedev progress:

  • reworked book model to fix issues with normals when book was opened
  • refactored input handling from event based to having a big struct of the input state passed to the update function
  • implemented the first interaction with the world. Books can now be picked up and placed back into shelves

Gameplay footage showing books being taken from on shelf and placed in another

#rust #dev


#

#gamedev progress:

  • Static geometry (walls, floor ceiling) is split up into smaller chunks to allow culling
    • Implementation: generated geometry is loaded into a BVH with a larger leaf size (256). The geometry of each leaf is converted to an entity.
    • Culling via distance to the player.
  • Added player physics. No longer clipping through walls and shelves. Not stable enough yet.
  • Reworked ray casting system to handle animated objects correctly.
  • Player can now click on books to open them.

#rust


#

#gamedev progress:

  • small refactoring of OcTree to simply change the intersection test function during construction. This allows to choose between accurate or fast functions.
  • OcTree is working now. Only included the static geometry at the moment. Can now ray cast into the scene.

GIF showing correct ray cast collision

#octree #rust