All Projects → HardCoreCodin → SlimTracin

HardCoreCodin / SlimTracin

Licence: MIT license
Software ray tracer written from scratch in C that can run on CPU or GPU with emphasis on ease of use and trivial setup

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to SlimTracin

Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+23932.65%)
Mutual labels:  software-rendering, engine, 3d-graphics
CLUSEK-RT
Vulkan based C++ ray-tracing game engine.
Stars: ✭ 24 (-51.02%)
Mutual labels:  engine, raytracing
3D-Engine-OpenGL-4
3D Graphics Engine For Games | C++ OpenGL 4.1
Stars: ✭ 19 (-61.22%)
Mutual labels:  engine, 3d-graphics
Enduro2d
Yet another 2d game engine of dreams (work in progress)
Stars: ✭ 82 (+67.35%)
Mutual labels:  engine, game-framework
Mezzanine
A game engine that supports high performance 3d graphics physics and sound
Stars: ✭ 18 (-63.27%)
Mutual labels:  engine, 3d-graphics
osre
An open source render engine
Stars: ✭ 95 (+93.88%)
Mutual labels:  engine, 3d-graphics
Gears Vk
Powerful low-level C++20 rendering framework for Vulkan 1.2, including Real-Time Ray Tracing (RTX) support, built atop Auto-Vk.
Stars: ✭ 71 (+44.9%)
Mutual labels:  engine, raytracing
FWK
💎 3D game framework in C, with Luajit bindings now.
Stars: ✭ 423 (+763.27%)
Mutual labels:  game-framework, 3d-graphics
Yave
Yet Another Vulkan Engine
Stars: ✭ 211 (+330.61%)
Mutual labels:  engine, 3d-graphics
SlimApp
A minimalist andf platform-agnostic application layer for writing graphical applications, with a strong emphasis on simplicity and ease of use.
Stars: ✭ 33 (-32.65%)
Mutual labels:  software-rendering, minimalist
currender
Currender: A CPU renderer for computer vision
Stars: ✭ 26 (-46.94%)
Mutual labels:  software-rendering, raytracing
rabbit-hole
An experimental voxel engine.
Stars: ✭ 39 (-20.41%)
Mutual labels:  engine, 3d-graphics
DuEngine
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)
Stars: ✭ 62 (+26.53%)
Mutual labels:  engine, raytracing
D3D12Renderer
Custom renderer and physics engine written from scratch in C++/Direct3D 12.
Stars: ✭ 17 (-65.31%)
Mutual labels:  engine, 3d-graphics
delphi3d-engine
A 3D-graphic and game engine for Delphi and Windows.
Stars: ✭ 52 (+6.12%)
Mutual labels:  engine, 3d-graphics
Renderhelp
⚡️ 可编程渲染管线实现,帮助初学者学习渲染
Stars: ✭ 494 (+908.16%)
Mutual labels:  engine, 3d-graphics
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (+414.29%)
Mutual labels:  raytracing, 3d-graphics
GroundEngine
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++
Stars: ✭ 61 (+24.49%)
Mutual labels:  game-framework, 3d-graphics
Tinyraycaster
486 lines of C++: old-school FPS in a weekend
Stars: ✭ 1,383 (+2722.45%)
Mutual labels:  engine, 3d-graphics
raytracing-go
A simple Go library for 3D ray-tracing rendering, implementing the book Ray Tracing in One Weekend. 📸
Stars: ✭ 53 (+8.16%)
Mutual labels:  raytracing, 3d-graphics

SlimTracin_logo

GPU

A minimalist and platform-agnostic interactive/real-time raytracer.
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.

Optional GPU support is provided via CUDA.
The same C code is cross-compiled (no CUDA libraries used).
Compiling using CUDA allows for dynamic toggling between rendering on the CPU or the GPU.
XPU XPU

Architecture:

The platform layer only uses operating-system headers (no standard library used).
The application layer itself (non-CUDA) 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.

Features:

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

  • Acceleration Structure (BVH) construction and traversal
  • Intersection shaders for triangular meshes and implicit geometry
  • Debug render modes (Depth, Normal, UV and BVH-preview)
  • Physically based materials (Micro-facet Cook-Torrance BRDF)
  • Raytracing specific shaders (Glass, Mirror, Area lights)
  • Textures (Bi-Linear filtered) with adaptive mip-selection (using ray cones) RayCones

The following example apps demonstrate how to use SlimTracin's features:
Note: Each example comes with CMake targets for CPU-only (no CUDA required) or GPU-enabled (requiring CUDA)

  • Implicit Geometry: Quad, Box, Sphere and Tetrahedra, all with UV-based transparency
    02_Geometry
    02_Geometry_setup 02_Geometry_transparency
  • Point lights: Can be moved around and scaled (changing their light intensity)
    01_Lights
    01_Lights_setup
  • Area Lights: Emissive quads can be used as rectangular area lights
    06_AreaLights

    06_AreaLights_setup 06_AreaLights_selection

  • Classic Materials: Lambert, Blinn, Phong
    03_BlinnPhong

    03_BlinnPhong_setup 03_BlinnPhong_selection

  • PBR Materials: Cook-Torrance BRDF (Schlick/Smith GGX)
    05_PBR
    05_PBR
  • Reflective/Refractive Materials: For glasses and mirrors (bounce count is controlled globally)
    04_GlassMirror

    04_GlassMirror_setup 04_GlassMirror_selection

  • Meshes: Transformable and can have smooth shading using vertex normal interpolation
    07_Meshes

    07_Meshes_setup 07_Meshes_init

    Mesh files are in a format native to the renderer which is optimized for ray/triangle intersection.
  • Textures: Albedo, Normal
    09_Textures
    09_Textures
    Textures can be loaded from files for use as albedo or normal maps.
    Texture files are in a format native to the renderer and optimized for filtered sampling.
  • Render Modes: Beauty, Depth, Normals, UVs and BVHs
    08_Modes

    08_Modes_update 08_Modes_setup

    BVHs can be shown as a wireframe overlay in any render mode.
    08_Modes_BVH
    The BVH of the scene updates dynamically as primitives are transformed.
    The BVH of meshes are only built once when a mesh file is first created.
    Mesh primitives can be transformed dynamically because tracing is done in the local space of each primitive.

Converting .bmp files to the native .texture files can be done with a provided CLI tool:
./bmp2texture src.bmp trg.texture [-m] [-w]
-m : Generate mip-maps
-w : Wrap-around

Converting .obj files to the native .mesh files can be done with a provided CLI tool:
./obj2mesh src.obj trg.mesh [-i]
-i : Invert triangle winding order (CW to CCW)
Note: SlimTracin's .mesh files are not the same as SlimEngine's ones.

SlimTracin 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 SlimTracing'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)

In some examples, further interaction is enabled while holding ctrl or shift
using the mouse wheel as a virtual "slider":
Holding shift and scrolling the mouse wheel cycles the assigned material for the selected object.
Holding ctrl and scrolling the mouse wheel increases or decreases the trace-height*
(how many times rays are allowed to bounce around between reflective or refractive objects)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].