Skip to content

xyloid/a_dive_into_ray_tracing

Repository files navigation

A Dive into Ray Tracing

This project is inspired by Peter Shirley's Ray Tracing series.

Contents

  • Basics
    • Computer Graphics
    • C in Practice
  • Hopefully
    • CUDA Acceleration
    • Perfromance Engineering

Ray Tracing in One Weekend

1200 16:9 500 samples per pixel 50 max depth 
16 partitions

./inOneWeek > image_parallel.ppm  49831.04s user 333.87s system 1242% cpu 1:07:16.10 total

Accelerated Ray Tracing with CUDA

prime-select nvidia

# restart the computer to make sure correct driver is loaded

time ./obj > final.ppm
Rendering a 1200x800 image with 500 samples per pixel in 8x8 blocks.
took 146.189 seconds.
./obj > final.ppm  146.42s user 0.14s system 99% cpu 2:26.65 total

Rendering a 1200x800 image with 500 samples per pixel in 8x8 blocks.
took 129.241 seconds.
./obj > final.ppm  129.46s user 0.15s system 99% cpu 2:09.67 total

Rendering a 1200x800 image with 500 samples per pixel in 8x8 blocks.
took 130.967 seconds.
./obj > final.ppm  131.20s user 0.14s system 99% cpu 2:11.39 total

References

Background Knowledge

Camera and Lens

Coding

Memory Leak When Using CUDA

Use valfrind and cuda-memcheck together. reference

A Note on Nsight Eclipse Plugin for CUDA 11

com.spotify.docker.client is no longer maintained, I have to download 2 jars manually and copy them to $ECLISPE/dropins/plugins. Then start eclipse with eclipse -clean, so the eclipse will clean the cache and load plugins.

  • Dependencies
    • com.fasterxml.jackson.datatype.jackson-datatype-guava_2.9.9.v20190906-1522.jar
    • com.spotify.docker.client_8.11.7.v20180731-1413.jar

Vulkan

Beginner-Friendly Vulkan Tutorials

How to Learn Vulkan

A Note on Vulkan 1.2 on Ubuntu 20.04 with Optimus

After installation, vkcube is a black window. I have to remove intel_icd.* and radeon_icd.* from /usr/share/vulkan/icd.d/ in order to pass vkvia

About

A ray tracer (C /CUDA)

Resources

Stars

Watchers

Forks

Languages