项目作者: LE10EENFAIT

项目描述 :
LiSA is a path tracing rendering engine developped in C++ using CUDA 11
高级语言: C++
项目地址: git://github.com/LE10EENFAIT/LiSA-Path-Tracing-Renderer.git
创建时间: 2020-11-10T16:53:10Z
项目社区:https://github.com/LE10EENFAIT/LiSA-Path-Tracing-Renderer

开源协议:GNU General Public License v3.0

下载


LiSA

LiSA is a path tracing render engine developped in C++ using NVidia Optix.

LiSA runs in multiple CUDA cores and uses the Monte-Carlo rendering technique associated with a simple Lambertian BSDF.

LiSA aims to use an unique rendering algorithm but with easely interchangable BSDF.

You can see some examples of rendered images here.

Build and usage

Linux

You need CUDA, OpenGL, GLFW, Xinerama and Xcursor to compile this project.

For Debian distribution run:

  1. sudo apt install nvidia-cuda-toolkit freeglut3-dev libglfw3-dev libxinerama-dev libxcursor-dev

Then:

  1. mkdir build
  2. cd build
  3. cmake ../src
  4. make
  5. cd bin
  6. ./LiSA -s scene_file.rto -d (optional, display the rendering in real-time)

Scene file

You need to provide all the necessary information here such as:

  • materials
  • meshes
  • camera
  • parameters of the rendering: the number of samples,
    the maximum number of times a ray can bounce, the size of the image,
    and the path of the image (in ppm format)

The syntax is quite free:

  • material names have the same constraints as C/C++ variables
  • you can skip lines or add as many spaces as you want
  • any text between /* and */ is treated as a comment

Scene file example

  1. material white {
  2. color = (1, 1, 1, 1)
  3. roughness = 1
  4. }
  5. material transparent {
  6. color = (1, 1, 1, 0)
  7. n = 1.5
  8. }
  9. material red {
  10. color = (1, 0, 0, 1)
  11. roughness = 1
  12. }
  13. material green {
  14. color = (0, 1, 0, 1)
  15. roughness = 1
  16. }
  17. material light {
  18. emit = true
  19. color = (1, 1, 1, 1)
  20. }
  21. mesh {
  22. obj_file = assets/objs/cornell_box/bot.obj
  23. material = white
  24. }
  25. mesh {
  26. obj_file = assets/objs/cornell_box/top.obj
  27. material = white
  28. }
  29. mesh {
  30. obj_file = assets/objs/cornell_box/back.obj
  31. material = white
  32. }
  33. mesh {
  34. obj_file = assets/objs/cornell_box/right.obj
  35. material = green
  36. }
  37. mesh {
  38. obj_file = assets/objs/cornell_box/left.obj
  39. material = red
  40. }
  41. mesh {
  42. obj_file = assets/objs/cornell_box/large_box.obj
  43. material = white
  44. }
  45. mesh {
  46. obj_file = assets/objs/cornell_box/small_box.obj
  47. material = transparent
  48. }
  49. mesh {
  50. obj_file = assets/objs/cornell_box/sphere.obj
  51. material = white
  52. }
  53. mesh {
  54. obj_file = assets/objs/cornell_box/light.obj
  55. material = light
  56. }
  57. camera {
  58. position = (-0.01, 0.015, 0.6)
  59. look_at = (-0.01, 0.015, 0)
  60. fov = 40
  61. }
  62. num_samples = 2000
  63. num_bounces = 7
  64. width = 2000
  65. height = 2000
  66. output_image = ../../images/cornel_box.ppm

How it works

The main function creates an instance of a SceneParser which retrieves
all the information contained in the scene file. Then, it passes
the necessary parameters (such as the vertices, the materials, the rendering algorithm parameters)
to the GPU using Optix. The image is then rendered using the algorithm in shader.cu and the
lambertain BSDF (bsdfs/lambertian.cu).

Features

  • lambertian BSDF
  • FOV can be chosen
  • anti aliasing
  • focal plane
  • only your GPU memory limits the number of triangles per scene
  • transparency/Refraction
  • thanks to Optix, LiSA is fast

Limitations

There are some limitations to LiSA:

  • the obj file MUST be composed of triangles
  • if you have too much triangles for your GPU, LiSA wont work

Some images

model from https://benedikt-bitterli.me/resources/

model from https://benedikt-bitterli.me/resources/

model from https://benedikt-bitterli.me/resources/

model from https://github.com/knightcrawler25/GLSL-PathTracer

TODO list

Acknowledgments

  • GLSL Path tracer. An amazing renderer. I took a lot of .obj for testing LiSA from here.
  • Scratchpixel 2.0 for their lessons about ray tracing, monte carlo, etc..
  • Tyro for the excellent tutorial and explanations

    License

    GNU v3