Now this is how you catch attention
Show HN: I wrote a C++ ray tracer from scratch without AI
11–20 of 67 posts
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#12Hey HN, 5 years ago I was 17 and learning to code C/C++ in a coding bootcamp (42). One of the projects was a simple C ray tracer. I really enjoyed working on the project and always loved computer graphics, so I decided to create my own path tracer from scratch, in C++, without using any third-party libraries. I ended up working on it consistently for over a year, then sporadically when CG excitement hit me again. Rec…
JFYI: Your inverse ray direction calculation is not NaN-safe: if rays are completely axis-parallel in one dimension, so the direction value is 0.0 for that axis, you'll be doing the val / 0.0 which results in a NaN... Also, as you're using full double/f64-precision all the time, you're leaving a fair bit of performance on the table: transcendentals (sin(), cos(), etc) in particular - can be a lot slower than when usi…
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#13> without AI Now this is how you catch attention
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#14Earlier quoted context omitted.
JFYI: Your inverse ray direction calculation is not NaN-safe: if rays are completely axis-parallel in one dimension, so the direction value is 0.0 for that axis, you'll be doing the val / 0.0 which results in a NaN... Also, as you're using full double/f64-precision all the time, you're leaving a fair bit of performance on the table: transcendentals (sin(), cos(), etc) in particular - can be a lot slower than when usi…
What's the proper way to handle a zero in the direction vector when calculating the reciprocal direction? Should it evaluate to infinity?
However, I'd just condition it for the moment.
so:
invDirX = dirX != 0.0 ? 1.0 / dirX : 0.0; etc, etc for each dimension.
Obviously doing the != 0.0 comparison is not great, as it suffers from potential issues again (especially if you have denormals), but you can generally get away with it I've found in most cases.
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#15Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#16A C++ ray tracer from scratch was the course project for my computer graphics class in 2016. I enjoyed the exercise immensely. Not nearly as robust as yours of course.
and then I saw the examples, and the feature set. I particularly like the blender-to-Luz export.
It seems great. Good luck to OP.
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#17Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#18Hey HN, 5 years ago I was 17 and learning to code C/C++ in a coding bootcamp (42). One of the projects was a simple C ray tracer. I really enjoyed working on the project and always loved computer graphics, so I decided to create my own path tracer from scratch, in C++, without using any third-party libraries. I ended up working on it consistently for over a year, then sporadically when CG excitement hit me again. Rec…
Hey ! Great work , I wanted to try something like this as well to begin my journey into games and computer graphics . I would love to know what resources you used to learn.
Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#19Re: Show HN: I wrote a C++ ray tracer from scratch without AI
#20Hey HN, 5 years ago I was 17 and learning to code C/C++ in a coding bootcamp (42). One of the projects was a simple C ray tracer. I really enjoyed working on the project and always loved computer graphics, so I decided to create my own path tracer from scratch, in C++, without using any third-party libraries. I ended up working on it consistently for over a year, then sporadically when CG excitement hit me again. Rec…
Great work, the examples look fantastic. I will say, it's misleading to put "without AI" in the title for you to then comment on your submission that you have in fact used it. While it may only be in a trivial capacity, you've still used it.