|
Post by pierre on Feb 5, 2019 1:40:56 GMT
Hello Jamis - could you explain how you generated the presentation video for your book? Thanks
|
|
|
Post by Jamis on Feb 5, 2019 4:39:36 GMT
Hello pierre ! It's an enormous question, really, and the answer depends on which part of the video you're referring to, but I'm going to assume you just mean how to make an animation with your ray tracer. I don't have time to do a proper write-up (eventually I want to do a blog post, perhaps), but here's the general idea. First, start with a script. Know what your video is going to do, and (if there is narration) what is going to be said. Note the times at which different things need to happen; for example, a ball begins spinning at t=4s, and stops spinning at t=8s. Or maybe the camera position moves from X to Y between t=3s and t=5s. That sort of thing. Then, write a program. Decide how many frames per second you want, and run t from 0 to the end of your script, in the appropriate increments. For each t, call a function that sets up the world at that t; in my case, the function was a mess of if/else statements, and a lot of linear and cubic interpolation! The function returns the camera and the world, which you then render and save as an image. Number the images sequentially. When the program finishes, compile those images into a video (I used ffmpeg). My animation consisted of over 4000 frames, and took about a day and a half to render all of them at 720p. There were a LOT of test renders, usually of just specific segments of the video at a time. Does that give you the general idea? There really is a lot of additional things involved, too, but the hardest part was writing the program to generate the frames.
|
|
|
Post by pierre on Feb 5, 2019 17:46:10 GMT
Thank you for your reply. I thought the process was the way you are describing it, but I can't image how time-consuming this must have been! Still, the end result is really good and that's one of the reasons why I bought your book. Definitely worth a blog post if you can find time to write it.
|
|
|
Post by Jamis on Feb 5, 2019 17:48:58 GMT
It was definitely time-consuming! And very iterative. Implement a bit, render a subset of the video, tweak and repeat about a million times. Then render the whole thing at very low resolution to test integration, tweak and repeat. Then there was figuring out how to embed a video of myself as a texture on a cube, and generating the scrolling credits at the end, and reacquainting myself with the sox utility so I could splice and combine audio tracks, and of course learning ffmpeg is a project unto itself. I learned a lot!
|
|