Code Monkey home page Code Monkey logo

lkray's Introduction

lkRay

lkRay is an experimental path tracer application.

This project is done mostly for fun and to explore world of some cool graphics rendering. It's a hobby after-hours project, so new features will come at their own time.

Released under WTFPL license.

Features

  • Multithreaded rendering of scenes using path tracing
  • Scenes and meshes accelerated using Bounding Volume Hierarchy
    • BVH split using SAH heuristic
  • Support for primitives:
    • Sphere
    • Plane
    • Mesh
    • OBJ Mesh
  • Support for light sources:
    • Point
    • Spot
    • Directional
  • Brief support for PBR materials:
    • Matte material
    • Mirror material
  • Scene loading using JSON files
  • Post processing with gamma correction & exposure adjustments

Scenes

Following scenes are available in Data/Scenes folder:

  1. balls.json - Basic empty scene with 8 spheres.
  2. emptyplane.json - Scene itself contains only a plane and a directional light. However, in Main.cpp code, scene is filled with 1000 random spheres used for Scene BVH testing.
  3. bunny.json - Scene loading a bunny.obj file, used for testing Mesh BVH and OBJ loading.
  4. room.json - Closed room with some spheres and a spot light.
  5. plane.json - Open space with walls, spheres and a directional light.
  6. mirrors.json - "Hall of mirrors" effect scene.

Controls

Control list is as follows:

  • Hold LMB to activate FPP camera movement:
    • W/S/A/D/R/F to move forward/backward/left/right/up/down
    • Mouse move to rotate
  • Z/X - Decrease/increase camera exposure
  • C/V - Decrease/increase ray bounce limit
  • P - Print current camera info on console
  • 1-6 - Change current scene

Camera in lkRay works in two modes.

When LMB is pressed, camera is free to move around. Then, results of rendering are discarded each pass and ray depth is limited to no bounces to allow somewhat-close-to-realtime control over camera.

When LMB is not pressed, app is in rendering mode. Then, each pass is accumulated to achieve a better quality image.

Dependencies

Buildable dependencies of lkRay is only my commons library for most of the code (partially lkRay is also my test field for most of the functionalities in lkCommon, so that dependency can be updated quite often). Other libraries include rapidjson and tinyobjloader. All are acquirable through git submodules.

Both rapidjson and tinyobjloader are header-only, so they do not require rebuilding. lkCommon is included in builds both inside Visual Studio solution and through CMake build, so all dependencies should build together with main project.

Building for Windows

Fetch submodules and use provided lkCommon.sln solution file, compatible with Visual Studio 2017. CMake-generated build files were never tested if they work properly under Windows.

Building for Linux

Fetch submodules and use cmake/make to build. Minimum requirement is CMake 2.6, GCC supporting C++14 and dependencies of lkCommon (see its README for more info).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.