Giter Site home page Giter Site logo

cuda-sdf's Introduction

cuda-sdf performs naive path tracing of a signed distance field (SDF) using ray marching, accelerated with CUDA. The below one-megapixel image displays the Menger sponge, with a thousand samples and up to 80 bounces, generated in about 150 seconds on an RTX 2070. Note that the RTX ray shooting capabilities cannot be not used, as the geometry is implicitly defined.

Performance

A naive implementation (generate_pixel_naive), where each thread is assigned a pixel and computes all samples for that pixel, computes the above image in about 150 seconds. An alternative implementation (generate_pixel_regeneration) spawns a pool of persistent threads that regenerate paths when they terminate, reducing the number of idle threads in a warp. This gives an 4.5% decrease in runtime and a 2% increase in occupancy, as reported by Nsight Compute.

System requirements and dependencies

Building requires MSVC 2019. The following third-party dependencies are included:

  • stb for writing PNG files.
  • sutil from the OptiX SDK samples for random number generation and vector- and matrix math.

Resources

  • Menger Fractal
    Quillez, I. [link]
    This article explains how the Menger fractal can be represented by an SDF.
  • Ray Tracing Gems II: Chapter 14, The Reference Path Tracer
    Boksansky, J. and Marrs, A. [link]
    This chapter explains how to create a simple path tracer.
  • Path Regeneration for Interactive Path Tracing
    Novák J. et al. [link]
    Explains the concept of path regeneration.

cuda-sdf's People

Contributors

nolmoonen avatar

Stargazers

 avatar

Watchers

 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.