Skip to content

Modify Ray Tracing in One Weekend by Peter Shirley and CUDA code by Roger Allen. Use const kernel parameter to store all the scene and cam data

Notifications You must be signed in to change notification settings

pongsagon/CUDA-RT-one-weekend-const-parameter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cudart

CUDA-RT-one-weekend-const-parameter

Modify Ray Tracing in One Weekend by Peter Shirley http://in1weekend.blogspot.com/2016/01/ray-tracing-in-one-weekend.html and CUDA code by Roger Allen https://github.com/rogerallen/raytracinginoneweekendincuda.

In this version, I use const kernel parameter to store all the scene and cam data.
https://developer.nvidia.com/blog/cuda-12-1-supports-large-kernel-parameters/
I get around 10x speed up compare to the orignial CUDA RT version.
On RTX4090, Render at 1800x1000, 16 samples/pixel, can run at 15-20 fps.
Const kernel parameters can support 32KB of data. The RT in One weekend scenes use around 20KB.
The number of source files is less than the orignial one from Roger Allen because I cut and merge the code here and there to make things work.

This version use CUDA/OpenGL interop to draw the result as a full screen texture quad. I am also using shader.h and some other gl code snippets from learnopengl.com by Joey de Vries to init some shader codes.

User guides

use WSAD key to move the camera
drage left mouse to rotate the camera

Compilation using MSVC 2022 (WIP)

Library used

About

Modify Ray Tracing in One Weekend by Peter Shirley and CUDA code by Roger Allen. Use const kernel parameter to store all the scene and cam data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published