GithubHelp home page GithubHelp logo

carlushuang / cwbvh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alaniwbft/cwbvh

0.0 2.0 0.0 35.9 MB

An implementation of NVIDIA's paper "Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs"

Cuda 18.72% C++ 70.69% C 0.36% CMake 10.23%

cwbvh's Introduction

Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs

This is my personal implementation of NVIDIA's paper "Efficient Incoherent Ray Traversal on GPUs Through Compressed Wide BVHs" (http://research.nvidia.com/publication/2017-07_Efficient-Incoherent-Ray). The program does hemisphere sampling with first hit rays, i.e. gathering, which is a primitive for many global illumination algorithms.

It loads mesh from mesh.dat and a list of surfels, which are defined by position, normal and radius, from samplecache.dat. It then generates AO rays for each surfel. For showcasing, the rays are closest-hit rays rather than shadow rays.

Build

Requires CUDA SDK v10.0 (the CUDA SDK version can be easily downgraded), tbb and embree3.

When compiling with VS2017, install v140 (VS2015) toolset for the CUDA SDK to function properly.

Optionally there is an OptiX Prime path for performance comparison - if you want to use it you need to specify OptiX include and library paths. I didn't find a good FindOptiX cmake package :(

Currently only Windows is tested, as NVCC on Linux seems not to like CUDA in .cpp files.

Performance

After I fixed the stupid mistake in the BVH converter, the implementation in this repository should be on par with the performance reported by the paper. It also yields similar (slightly slower) level of performance compared to OptiX Prime, so I feel OptiX should be using CWBVH as well. Some micro optimizations to the ray-box intersection part (using PRMT, VMIN and VMAX to implement the code at the end of https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection) are not done, but it should be easy for the reader to implement them.

Performance on the included mesh.dat and samplecache.dat, with 32 rays per surfel, on my GTX1080:

60.946MS, 548.42MRays/s (rtTraceBVH2 No Dynamic Fetch)

37.714MS, 886.24MRays/s (rtTraceCWBVH Dynamic Fetch)

35.294MS, 947.00MRays/s (OptiXPrime)

cwbvh's People

Contributors

alaniwbft avatar bftf avatar

Watchers

 avatar  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.