Coder Social home page Coder Social logo

cjsb / gpu-path-tracing-with-cuda-tutorial-3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from straaljager/gpu-path-tracing-with-cuda-tutorial-3

0.0 0.0 0.0 7.66 MB

The code in this tutorial implements a BVH acceleration structure

C++ 69.95% Cuda 24.93% C 5.12%

gpu-path-tracing-with-cuda-tutorial-3's Introduction

GPU path tracing tutorial 3 Implementing a BVH acceleration structure on the GPU by Sam lapere, 2016

More info and screenshots on

http://raytracey.blogspot.co.nz/2016/01/gpu-path-tracing-tutorial-3-take-your.html

BVH implementation based on real-time CUDA ray tracer by Thanassis Tsiodras (http://users.softlab.ntua.gr/~ttsiod/cudarenderer-BVH.html)

Interactive camera with depth of field and plastic (coat) material based on CUDA path tracer code by Peter Kutz and Yining Karl Li (https://github.com/peterkutz/GPUPathTracer)

Phong metal code based on "Realistic Ray Tracing" by Peter Shirley

Features:

  • Fast interactive GPU path tracer
  • progressive rendering
  • support for diffuse, specular (mirror), refractive, acrylic/coat and metal Phong materials
  • support for spheres and triangle meshes
  • BVH acceleration structure built with SAH (Surface Area Heuristic) and binning
  • interactive camera with mouse and keyboard controls
  • anti-aliasing
  • depth-of-field

Instructions for compiling with Visual Studio 2013/2015:

  • install the CUDA 6.5/7/7.5 toolkit and choose integration with Visual Studio
  • open VS2013/2015 (Express or any other version such as the free Community version)
  • click New Project...
  • select Visual C++, then General, then Empty Project
  • right click on the project, select Build Dependies > Build Customizations
  • select the CUDA 6.5 (or 7 or 7.5) checkbox, click OK
  • in the project explorer window, right click on Source Files, select Add, C++ file, then change the name from "Source.cpp" to "cuda_pathtracer.cu"
  • in the project explorer window, right click on the newly created cuda_pathtracer.cu file, select CUDA C++
  • paste the code from cuda_pathtracer.cu in the file
  • add the other .h (header) and .cpp files to the project
  • right click on the project name, select Properties
  • under Linker > Input > Additional Dependencies, add "cudart.lib" and "glew32.lib" (glew32.lib should be automatically found when the CUDA toolkit is installed, if not, you can manually add the path to Linker > General > Additional Library Directories, the path is something like "%NVSDKCOMPUTE_ROOT%\C\common\lib")
  • disable SAFESEH by selecting NO in Linker > Advanced > Image Has Safe Exception Handlers
  • select Build > Rebuild Solution
  • run the program (at the moment there is no CUDA error checking, but so far everything has worked fine even when running the program for prolonged periods)

Screenshots produced with this code:

Image description

Image description

Image description

Image description

Image description

gpu-path-tracing-with-cuda-tutorial-3's People

Contributors

straaljager avatar

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.