Skip to content

HardCoreCodin/SlimRaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlimRaster_logo

SlimRaster

A minimalist, platform agnostic interactive real time rasterizer.
Strong emphasis on simplicity, ease of use and almost no setup to get started with
Written in plain C and can be complied in either C or C++

This project extends SlimEngine.

Features:

All features of SlimEngine are available here as well.
Additional features include rasterization facilities:

  • Pixel Shaders that feed interpolated vertex attributes
  • Mesh shaders for object culling using axis-aligned bounding boxes
  • Perspective corrected barycentric coordinates
  • Tangent space derivatives for adaptive texture mip-level selection
  • Bi-linear filtered texture sampling with auto-selected mip levels
  • Anti aliasing (optional SSAA)
  • Frustum and back face triangle culling
  • Frustum triangle clipping with interpolates vertex attributes SlimRaster
  • Normal maps with controllable strength SlimRaster
  • obj2mesh: Also privided is a separate CLI tool for converting .obj files to .mesh files.
    It is also written in plain C (so is compatible with C++)
    Usage: ./obj2mesh src.obj trg.mesh

    • invert_winding_order : Reverses the vertex ordering (for objs exported with clockwise order)
  • bmp2texture: Also provided is a separate CLI tool for converting .bmp files to .texture files.
    It is also written in plain C (so is compatible with C++)
    Usage: ./bmp2texture src.bmp trg.texture

    • m : Generate mip-maps
    • w : Wrap-around
    • f : Filter

Architecture:

The platform layer only uses operating-system headers (no standard library used).
The application layer itself has no dependencies, apart from the standard math header.
It is just a library that the platform layer uses - it has no knowledge of the platform.

More details on this architecture here.

Usage:

The single header file variant includes everything.
Otherwise, specific headers can be included from the directory of headers.
The main entry point for the app needs to be defined explicitly (see SlimApp).

SlimRaster comes with pre-configured CMake targets for all examples.
For manual builds on Windows, the typical system libraries need to be linked
(winmm.lib, gdi32.lib, shell32.lib, user32.lib) and the SUBSYSTEM needs to be set to WINDOWS

SlimRaster does not come with any GUI functionality at this point.
Some example apps have an optional HUD (heads up display) that shows additional information.
It can be toggled on or off using thetab key.

All examples are interactive using SlimRaster's facilities having 2 interaction modes:

  1. FPS navigation (WASD + mouse look + zooming)
  2. DCC application (default)

Double clicking the left mouse button anywhere within the window toggles between these 2 modes.

Entering FPS mode captures the mouse movement for the window and hides the cursor.
Navigation is then as in a typical first-person game (plus lateral movement and zooming):

Move the mouse to freely look around (even if the cursor would leave the window border)
Scroll the mouse wheel to zoom in and out (changes the field of view of the perspective)
Hold W to move forward
Hold S to move backward
Hold A to move left
Hold D to move right
Hold R to move up
Hold F to move down

Exit this mode by double clicking the left mouse button.

The default interaction mode is similar to a typical DCC application (i.e: Maya):
The mouse is not captured to the window and the cursor is visible.
Holding the right mouse button and dragging the mouse orbits the camera around a target.
Holding the middle mouse button and dragging the mouse pans the camera (left, right, up and down).
Scrolling the mouse wheel dollys the camera forward and backward.

Clicking the left mouse button selects an object in the scene that is under the cursor.
Holding the left mouse button while hovering an object and then dragging the mouse,
moves the object parallel to the screen.

Holding alt highlights the currently selecte object by drawing a bounding box around it.
While alt is still held, if the cursor hovers the selected object's bounding box,
mouse interaction transforms the object along the plane of the bounding box that the cursor hovers on:
Holding the left mouse button and dragging the mouse moves the object.
Holding the right mouse button and dragging the mouse rotates the object.
Holding the middle mouse button and dragging the mouse scales the object.
(mouse wheel interaction is disabled while alt is held)

About

Minimalist software rasterizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published