Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • Flagged for misleading title, since you admitted to using AI.
  • I think these kind of projects fail to impress these days, with or without AI.

    You need a second order effect, like “I did X using this thing I built Y”, where X is the actual impressive part and the Y is just an implementation detail. Maybe like that Roman Empire Names thing.

  • > without AI

    Now this is how you catch attention

  • I expect similar headlines like “I saved on token cost by hiring juniors” to come in soon too
  • Indeed. Until it turns out not to be true: https://news.ycombinator.com/item?id=48541543
    by gspr
  • A 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.
  • I basically was ready to come on and make a snarky comment like this. "I wrote one in the '90s!".

    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.

  • Without AI is the new "in Rust".
  • Me too, but in TS/WebGPU: https://github.com/ivanjermakov/moonlight

    Very fun! Packing data for GPU-side BVH was quite tricky.

  • Wow, pretty good. Why web?
  • for anybody else interested in this undertaking, I recommend this book https://pragprog.com/titles/jbtracer/the-ray-tracer-challeng...
  • "Without AI" is the new "Written in Rust", SCNR
  • 'Have you considered rewriting it without AI' seems like something I could see myself saying.
  • Ray tracing is one of those problems that is conceptually so simple, yet continues to take so much mindshare because of all the challenges to implementation.
  • This is (or at least used to be) a right of passage in the graphics world.

    I think many people go through the very popular https://raytracing.github.io/

    There was a big influx of this when Sebastian Lague did his video series on building a ray tracer.

  • And if you've decided you want to take it a bit more seriously, move on to:

    https://www.pbrt.org/

    which is effectively the bible, and has been for years (I wrote mine and moved into the VFX industry when the Second edition was still out! - I feel old now)

  • _" Btw this was initially coded without AI, but I've used it for the recent clean up and features. "_

    ???

  • Wow, I also wrote a game 8 years ago and have been using AI to rebuild upon it. I'm excited to tell people that I wrote it from scratch without AI! Love these new rules!
  • To be fair, the title is "I wrote a C++ ray tracer from scratch without AI", not "This C++ ray tracer, right now, contains no AI-written code"

    It sounds to me like there is some point in this project's history when both of the following were true:

    1) It was a C++ raytracer

    2) It was entirely human-written

    So technically there is no lie here.

  • Hey 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. Recently I polished it and completed some unfinished features and decided to make it public, finally. It's a C++20 Path Tracer with a CPU renderer. It is able to render good-looking images with reasonable performance and sample count.

    Btw this was initially coded without AI, but I've used it for the recent clean up and features. This project is a personal favorite of mine, and it can improve a lot, so I'd love to hear your feedback.

  • Congratulations on achieving it.
  • 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.
  • How did you like 42? Would you recommend it? I worked some great devs who came out of 42. They all wanted to be game developers. The industry is notoriously unreliable. So they pivoted to writing business software where the client actually pays you for more features. LOL.
  • Amazing. What happened with your professional career ? Did this exercise help you out professionally ?

    One of my worries about AI is that doing these deep dives are a lot harder to justify.

  • Congrats on doing 42 and to have worked and shared your project, very nice results !
  • 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 using f32, and generally double precision can be special-cased to particular areas of the renderer that need it (curve, sphere intersection, and some situations where volume scattering produces very small distances).

  • > Btw this was initially coded without AI, but I've used it for the recent clean up and features

    Then it makes sense to update the submission title. To me it reads as if the project was written completely without the help of AI (which might be a quality badge to some), but it is not 100% true then.

    Anyhow, cool project ;)

  • 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.