Skip to content

A high-performance ray tracing engine implemented in CUDA, GPU Course, University of Houston

License

Notifications You must be signed in to change notification settings

MasoudHeidary/cuda-ray-tracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compile command

run this command on the project directory. the compiled code and result will be in the out directory.

nvcc -O3 -o out/cuda source/main.cu `pkg-config --cflags --libs opencv4` --disable-warnings

run on CPU

./cuda --scene mesh.scene --obj subdiv.obj

run on CUDA

./cuda --scene mesh.scene --obj subdiv.obj --cuda

command line arguments

--scene <string:scene_file_name>
--obj <string:obj_file_name> [optional] 
--out <string:out_file_name> [optional] [default: "output.bmp"]
--threads <int:number_of_threads> [optional] [default: <all_cores_available>]
--width <int:width_of_image> [optional] [default: 1000]
--height <int:height_of_image> [optional] [default: 1000]
--shadow <bool:true|false> [optional] [default: false]
--cuda [optional] [default: false]

CUDA Speed Up

mesh 1000x1000

CPU (Multi thread): 36.255803 seconds
CUDA: 0.411442 seconds
speed up: x88.2

mesh 5000x5000

CPU (Single Core, Intel(R) Xeon(R) Gold 5218R): -
CPU (Multi Thread, Intel(R) Xeon(R) Gold 5218R): 535.287 seconds
CUDA (RTX A5500): 6.625 seconds
speed up: x80.8

Spheramid 5000x5000

CPU (Single Core, Intel(R) Xeon(R) Gold 5218R): 23.344 seconds
CPU (Multi Thread, Intel(R) Xeon(R) Gold 5218R): 1.385 seconds
CUDA (RTX A5500): 0.248 seconds

output exmaple

basic alt

spheramid alt

mesh alt

About

A high-performance ray tracing engine implemented in CUDA, GPU Course, University of Houston

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published