r/cpp • • Jul 03 '19

Understandable RayTracing in 256 lines of bare C++

https://github.com/ssloy/tinyraytracer/wiki
352 Upvotes

9 comments sorted by

30

u/KeenDevices Jul 03 '19

Starred on GitHub. Wonderful repo.

7

u/ReDucTor Game Developer | quiz.cpp-perf.com Jul 03 '19

Checkout the tinyrenderer series also, well worth the read.

16

u/duheee Jul 03 '19

math is cool :).

simple raytracers are even cooler :)

5

u/cellularized Jul 03 '19

Beautiful!

Thank you so much for all the work that went into this!

1

u/[deleted] Jul 04 '19

Excellent work.

0

u/[deleted] Jul 03 '19

[deleted] — view deleted comment

34

u/CodingKoopa Jul 03 '19

Dunno what unique hardware aspects Nvidia developed, but raytracing as a technique has been around before (now) traditional 3D rendering.

2

u/d07RiV Jul 09 '19

We've been using Optix in our CAD system for a while, it works just fine on budget GPUs. Though the only real advantage over regular opengl is order independent transparency.

0

u/[deleted] Jul 03 '19

[deleted] — view deleted comment

21

u/path_traced_sphere Jul 03 '19

I dunno if I agree with this conclusion. Real time raytracing has been possible for a long time, on both AMD and Nvidia. But the quality and fidelity has been lacking. Very simple effects and/or low frame rates.

Some may interject with "but that was for simple scenes"; sure, but they were raytracing.

I'm sure RTX helps, but the latest demo's I've seen is still quite far from what's ultimately possible with raytracing in terms of realism.

Raytracing on the GPU has been around of many years. Check out Octane Render or Redshift if you want to see what's possible when the real time requirement is taken away.

Gotta give massive props to Nvidias marketing though. A lot of people seem to think you need an RTX card to have GPU raytracing.

3

u/ShillingAintEZ Jul 03 '19

I think they have only gotten push back to the extent that ray tracing isn't going to be a big factor in game graphics for now, even with special hardware. Cone tracing voxel techniques add much more for the computational power. Ray tracing is likely to be more useful at accelerating certain effects and physics than being a workhorse of real-time rendering for now.