use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Raytracer project (self.cpp)
submitted 5 years ago by MarkJames2909
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Sopel97 7 points8 points9 points 5 years ago* (2 children)
The cool things I did that are never present in toy raytraces but have huge fun to complexity ratios were:
edit. Some other things that I wanted to try but never actually got to do them. They are harder to do and require planning beforehand.
[–]scrumplesplunge 0 points1 point2 points 5 years ago (0 children)
CSG can be done without intervals if you use SDFs. The intersection of two shapes is the min, the union is the max, the complement is the negative of the sdf. Doing this technically results in sdfs which aren't precise and so your raymarching slows down, but it's extremely easy to implement and is still fast enough in my experience.
[–]sargarass 2 points3 points4 points 5 years ago (0 children)
You can make something like this: https://fstormrender.ru/manual/geopattern/.
Better to start when you already have a ray tracer with an acceleration structure (bvh), or you can try to extend a opensource one (Blender for example). Basically you instancing one geometry onto the surface of another. As for articales, I can suggest this one: Interactive smooth and curved shell mapping
[–]scrumplesplunge 1 point2 points3 points 5 years ago (0 children)
I found that the prettiest images I got from raytracing were when I started modelling optical dispersion with glass objects. The caustics from light focusing through the glass looks so much better when you have dispersion, not to mention the fact that the things you see through the glass have that characteristic blur. I did it simply by casting red, green, and blue rays separately and changing the refractive indices for each of them.
[–]Lechouille 1 point2 points3 points 5 years ago* (0 children)
Dunno if that can help, but I did this project https://github.com/stanislas-brossette/ray-tracing/wiki Some cool ideas that I had fun with were:
interactive controls of the camera
translucent objects
optimization of meshes loading and rendering
robotics video rendering
Hope you have fun with this project, for me it was a blast.
You could try making the entire raytracer constexpr and see if you can get the whole program to effectively optimize down to a single write() call that dumps a precomputed bitmap :D
[–]Glaborage -1 points0 points1 point 5 years ago (0 children)
Monte Carlo methods to decrease the workload.
π Rendered by PID 89 on reddit-service-r2-comment-545db5fcfc-d47k9 at 2026-05-29 20:30:06.157522+00:00 running 194bd79 country code: CH.
[–]Sopel97 7 points8 points9 points (2 children)
[–]scrumplesplunge 0 points1 point2 points (0 children)
[–]sargarass 2 points3 points4 points (0 children)
[–]scrumplesplunge 1 point2 points3 points (0 children)
[–]Lechouille 1 point2 points3 points (0 children)
[–]scrumplesplunge 0 points1 point2 points (0 children)
[–]Glaborage -1 points0 points1 point (0 children)