The Ray Tracer Challenge: A Test-Driven Guide to Your First 3D Renderer (Pragmatic Bookshelf) (英語) ペーパーバック – 2019/3/8
Kindle 端末は必要ありません。無料 Kindle アプリのいずれかをダウンロードすると、スマートフォン、タブレットPCで Kindle 本をお読みいただけます。
Brace yourself for a fun challenge: build a photorealistic 3D renderer from scratch! It's easier than you think. In just a couple of weeks, build a ray-tracer that renders beautiful scenes with shadows, reflections, brilliant refraction effects, and subjects composed of various graphics primitives: spheres, cubes, cylinders, triangles, and more. With each chapter, implement another piece of the puzzle and move the renderer that much further forward. Do all of this in whichever language and environment you prefer, and do it entirely test-first, so you know it's correct. Recharge yourself with this project's immense potential for personal exploration, experimentation, and discovery.
The renderer is a ray tracer, which means it simulates the physics of light by tracing the path of light rays around your scene. Each exciting chapter presents a bite-sized piece of the puzzle, building on earlier chapters and setting the stage for later ones. Requirements are given in plain English, which you translate into tests and code. When the project is complete, look back and realize you've built an entire system test-first!
There's no research necessary -- all the necessary formulas and algorithms are presented and illustrated right here. Dive into intriguing topics from fundamental concepts such as vectors and matrices; to the algorithms that simulate the intersection of light rays with spheres, planes, cubes, cylinders, and triangles; to geometric patterns such as checkers and rings. Lighting and shading effects, such as shadows and reflections, make your scenes come to life, and constructive solid geometry (CSG) enables you to combine your graphics primitives in simple ways to produce complex shapes.
Play and experiment as you discover the fun of writing a ray tracer. Accept the challenge today!
What You Need:
Aside from a computer, operating system, and programming environment, you'll need a way to display PPM image files. On Windows, programs like Photoshop will work, or free programs like IrfanView. On Mac, no special software is needed, as Preview can open PPM files.
Jamis Buck has been active in open source for years, and has a deep passion for learning. He loves programming puzzles and trying new things, and especially enjoys finding ways to make programming fun again.
Jamis has written something truly unique and remarkable here. He has effectively solved the complexity problem by applying Test Driven Development to one of the most rewarding pieces of software you'll ever write. TDD, as a discipline, allows you to make the smallest possible incremental step while also giving you the confidence that you are headed in the right direction. Applied to the development of a Ray Tracer is nothing short of ingenious. You'll have written several dozen tests before you cast your first ray, confident in the knowledge that when you do, it'll be correct.
I'm happy to say that after many false starts over the years, I have in fact, written a working Ray Tracer thanks to this book. It's difficult to describe the sheer joy of building something up from nothing and viewing your first render of mirrored balls and checkered floors, reinforced by hundreds of unit tests.
I've been at this programming thing for over twenty years and I have to say, this is one of the most unique and welcome technical books I've read. Ever.
When it became a career much of the joy was lost to the drudgery of writing everyday software for "business value".
This book brings back that original joy of coding.
The style of the book is perfect. It lays down nice, straightforward test cases for you to implement. It's up to you to choose your language and your coding style. Quick and dirty or carefully constructed, whatever suits you. Implement the code to pass the tests however you want. You are quickly building up real functionality and getting visible results.
You don't even have to worry about the tricky parts. Jamis lays out a suggested implementation for the challenging parts of ray tracing, especially good if your last maths lesson was a long, long time ago.
The book is perfect for short or long coding sessions. Use a spare 30 minutes on your commute, squeeze in 10 minutes at lunch, or get so engrossed you pull an all-nighter- the good kind for a change! You can keep making progress even with limited free time.
And when you render that first shiny sphere... well the feeling is just awesome.
Buy this book. Have some fun again.
This book takes a complex subject and boils it down in a way that anyone can understand, and the flow of the book not only gives you tangible artifacts at the end of each chapter that motivate your progress, but given its test-driven design, inspires confidence in the correctness of your implementation.
I used this book to get back up to speed with C++17 after ten years of not using C++ and it was perfect for that, and results in a great project to contribute to one's github portfolio.
Very highly recommended. Buck's writing style is fun and casual, unlike so many other computer science books that are dry and dull. It was difficult to put down, as I wanted to do just one more chapter and see the progression.