Skip to content

๐Ÿ™ Small raytracer writtern in Objective-C

License

Notifications You must be signed in to change notification settings

Qazalbash/tinyraytracer-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

tinyraytracer-C

It is inspired from tinyraytracer by ssloy which is written in C++. This is a C version of it. It is a very good tutorial for beginners to learn ray tracing. I have tried to keep the code as close to the original as possible. I have also added some comments to make it easier to understand. I have also added a Makefile to make it easier to compile and run.

Result

Requirements

  • git
  • C compiler
  • CMake (> 3.0)

How to compile and run

If you have gcc and make installed, then you can simply run the following commands:

git clone https://github.com/Qazalbash/tinyraytracer-C.git
mkdir build
cd build
cmake ..
make
./tinyraytracer

Otherwise, you can compile it manually:

git clone https://github.com/Qazalbash/tinyraytracer-C.git
gcc -Wall -Wextra -g -O3 -fopenmp -o tinyraytracer tinyraytracer.c -lm
./tinyraytracer

Future work and improvements

There are many things that can be improved in this code. The first and foremost thing is to make it more optimized. I have tried to make it as optimized as possible, but there is still a lot of room for improvement. One aspect is to less use static variables and use dynamic memory allocation instead. I am also planning to make this in OpenCL and CUDA.

Contributors

Made with contrib.rocks.