3 ms·
"Since then I have written a bunch of ray tracers in Pascal, Fortran, Scheme, C, C++, Java, and most recently Swift (which is awesome for writing ray tracers).
by melling 11y ago
"Since then I have written a bunch of ray tracers in Pascal, Fortran, Scheme, C, C++, Java, and most recently Swift (which is awesome for writing ray tracers). "
What makes Swift so good for writing ray tracers?
- roskilli 11y agoLikely the strong generics while still being terse and inbuilt functional methods on collection types. Also being able to add extensions to any class is super helpful.
- petershirley 11y agoYa I think you got it. I just dabbled with swift and wrote my experiences here: http://psgraphics.blogspot.com/2014/09/inheritance-for-swift-ray-tracer.html?m=1 http://psgraphics.blogspot.com/2014/09/inheritance-for-swift...
- K0nserv 11y agoI've also been writing a ray tracer in Swift. Would love to look at yours if it's Open Source. The core rendering logic for mine is here[0]. I also started building a .obj loader for Swift[1]. Will definitely be buying the book. 0: https://github.com/k0nserv/SwiftTracer-Core https://github.com/k0nserv/SwiftTracer-Core 1: https://github.com/k0nserv/SwiftObjLoader https://github.com/k0nserv/SwiftObjLoader
- PhasmaFelis 11y agoWhat is the benefit of writing a bunch of different raytracers? Is it just an exercise to practice a new language and reenforce your understanding of raytracing fundamentals, or is there actually a notable difference?
- berkut 11y ago32 years is quite a long time in computing terms! Both the computing tech and raytracing/graphics theory and algorithms have changed significantly over that time, with better algorithms and much more powerful computing resources allowing more brute-force/accurate stuff to be more practically done. Writing a raytracer/renderer is also rather addictive, and it's quite cool writing something which produces something else (as is writing compilers).
- KayEss 11y agoI've written a few over the last 25 years as well, and it's fun to write something that produces pretty pictures -- like drawing or playing an instrument is fun. Currently I'm doing a C++ one that describes the model, colour handling and animation etc. using the type system directly rather than a traditional class hierarchy. https://github.com/KayEss/AnimRay https://github.com/KayEss/AnimRay
- petershirley 11y agoFortran it was for money :). But really the built-in array operations made it surprisingly sweet. The others it was just an excuse to learn the language mostly for fun.