Skip to content

mpolaczyk/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

229 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RayTracer

CPU and GPU Ray Tracer

Features:

  • Sphere and static mesh
  • Specular, emissive and emissive materials
  • Gloss, reflection and refraction
  • Focal length and aperture
  • Blend between perspective and orthographic projection

ui1

Integration with Godot 4.6 for real time scene edition

ui2

Gallery

Cornell box

x1 x2

Monument

monument

Rainbow

rainbow

Man sitting

man_sitting

Releases

2.5

  • Integration with Godot 4.6

2.4

  • GPU-based implementation (compute shader)

2.3

  • Cornell box scene finalized
  • Static mesh rendering
    • Backface detection for transparency
    • No acceleration structude ofr triangles yet
    • No static mesh assets yet
  • ISPC integrated with the project and used for basic
  • Better compile times
  • CppCheck and BuildInsights pass
  • Huge code refactor
  • Better logging with spdlog

2.2

  • Full scene editor
    • Flying camera
    • Object selection and movement
    • Material editor

User interface

2.1

  • The same set of materials and primitives
  • Renderer interface, with example and reference CPU renderer, easy to hot-swap with another version
  • Simpler algorithm, no PDF in use
  • Refraction with smoothness
  • Coloured refraction
  • Gloss with smoothness

Example output

1.0

Based on books: [Ray Tracing in One Weekend] by Peter Shirley

User interface

  • Editor UI
    • Scene setup: spawn/delete/move/edit object properties
    • Render parameters
    • Settings
    • Real time output update
    • Save output to BMP file
  • Renderer
    • Monte Carlo based method, mix of light and surface cosine based probability density functions (PDF)
    • Multiple renderer implementations:
      • Reference CPU: Full path tracing on CPU with PPL parallelization
      • GPU Reference: GPU-accelerated path tracing using compute shaders
      • Preview: Fast preview renderer for editing
      • ISPC: Intel SPMD Program Compiler version (example only)
    • Multithreading: thread poll, PLL, none
    • Support for SIMD
    • DirectX 11 based display
    • Anti aliasing
    • No denoising
    • Starting code for the review: frame_renderer::render() and frame_renderer::ray_color()
  • Renderer variables
    • Resolution
    • Work distribution: stripes, chunks
    • Rays per pixel, ray bounces
  • Camera setup
    • Projections: Perspective/orthografic/blend
    • Focus distance
    • Aperture
    • Aspect ratio
  • Specular, diffuse, emissive materials:
    • Metal: copper, gold, silver, steel
    • Dialectric: glass, sapphire, moissanite, diamond, water
    • Texture: solid, checker
    • Lambertian: basic colors
    • Diffuse light: a few strength types
  • Primitives:
    • Sphere
    • XY rectangle
    • XZ rectangle
    • ZY rectangle

Example output

Third party dependencies

DirectX 11

ocornut/imgui v1.87

nlohmann/json v3.10.5

PIX for Windows v1.0.220124001

STB Image v2.27

Tiny obj v1.0.6

spdlog v1.x

ispc v1.19.0

About

CPU path tracer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •