A Simple SDL Raytracer made in C++
- Just run make
- You need an xwindow environment or the like
- The program was tested using
vcxsrv
from within WSL - You can use
xming
in WSL2, you just need to add your IP toX0.hosts
- Should just run natively on Linux with SDL2 installed
Requires SDL2
sudo apt-get install libsdl2-dev
in Ubuntu or the like
- Use
main.cpp
to create spheres and mess with lighting, an example is in place
Getting this error:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
malloc(): corrupted top size
or some equivalent? Run:
sudo ldconfig -p | grep -i gl.so
and look for any files on the right that have .1
on the end. If they exist, enter
sudo mv </file/location/file_name.so>.1 </file/location/file_name.so>.1.ORIGINAL
for example:
sudo mv /lib/x86_64-linux-gnu/libGL.so.1 /lib/x86_64-linux-gnu/libGL.so.1.ORIGINAL
- This is a ray tracer built from scratch using the SDL API to only place pixels individually, everything else is hand made by me
- Sphere rendering
- Specularity
- Shadows
- Reflections
- Here is a simple scene.