ptg ptg Mark Christiansen Adobe ® After Effects ® CS5 Visual Effects and Compositi ng STUDIO TECHNIQUES ptg Adobe® After Effects® CS5 Visual Effects and Compositing Studio Techniques Mark Christiansen This Adobe Press book is published by Peachpit. For information on Adobe Press books, contact: Peachpit 1249 Eighth Street Berkeley, CA 94710 (510) 524-2178 Fax: (510) 524-2221 To report errors, please send a note to errata@peachpit.com Peachpit is a division of Pearson Education Copyright © 2011 Mark Christiansen For the latest on Adobe Press books, go to www.adobepress.com Senior Editor: Karyn Johnson Development and Copy Editor: Peggy Nauts Production Editor: Cory Borman Technical Editor: Todd Kopriva Proofreader: Kelly Kordes Anton Composition: Kim Scott, Bumpy Design Indexer: Jack Lewis Cover design: Peachpit Press/Charlene Will Cover illustration: Regina Cleveland Notice of Rights All rights reserved. No part of this book may be reproduced or transmitted in any form by any means, elec- tronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the pub- lisher. For information on getting permission for reprints and excerpts, contact permissions@peachpit.com. Notice of Liability The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of the book, neither the author nor Peachpit shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the instructions contained in this book or by the computer software and hardware products described in it. Trademarks Adobe, the Adobe logo, and Adobe After Effects are registered trademarks of Adobe Systems Incorporated in the United States and/or in other countries. Many of the designations used by manufacturers and sellers to dis- tinguish their products are claimed as trademarks. Where those designations appear in this book, and Peachpit was aware of a trademark claim, the designations appear as requested by the owner of the trademark. All other product names and services identifi ed throughout this book are used in editorial fashion only and for the ben- efi t of such companies with no intention of infringement of the trademark. No such use, or the use of any trade name, is intended to convey endorsement or other affi liation with this book. ISBN 13: 978-0-321-71962-1 ISBN 10: 0-321-71962-X 9 8 7 6 5 4 3 2 1 Printed and bound in the United States of America ptg iii Contents Foreword xi Introduction xxi Section I Working Foundations 1 Chapter 1 Composite in After Effects 3 Organization 11 Take Control of Settings 18 View Panels and Previews 26 Effects: Plug-ins and Animation Presets 33 Output and the Render Queue 34 Assemble the Shot 37 Chapter 2 The Timeline 39 Organization 40 Keyframes and the Graph Editor 46 Timeline Panel Shortcuts 56 Spatial Offsets 59 Motion Blur 62 Timing and Retiming 66 So Why the Bouncing Ball Again? 74 Chapter 3 Selections: The Key to Compositing 75 Methods to Combine Layers 76 Optics and Edges 82 Transparency: Alpha Channels and Edge Multiplication 85 Mask Modes 88 Combine Selections 92 Animated Masks 96 Composite With or Without Selections: Blending Modes 97 Track Mattes 104 Right Tool for the Job 106 Chapter 4 Optimize Projects 107 Nested Comps, Multiple Projects 108 Adjustment and Guide Layers 118 Faster! Control the Render Pipeline 121 Optimize a Project 127 Conclusion 131 Section II Effects Compositing Essentials 133 Chapter 5 Color Correction 135 Color Correction for Image Optimization 137 Levels: Histograms and Channels 145 Curves: Gamma and Contrast 148 Hue/Saturation: Color and Intensity 155 Color Look Development 156 Color Matching 159 Conclusion 172 ptg iv Chapter 6 Color Keying 173 Procedural Mattes 174 Linear Keyers and Hi-Con Mattes 177 Color Keying: Greenscreen, Bluescreen 182 Keylight for Color Keying 191 Fine Tuning and Problem Solving 197 Shoot for the Perfect Matte 205 Conclusion 209 Chapter 7 Rotoscoping and Paint 209 Roto Brush 211 The Articulated Matte 216 Refi ned Mattes 222 Deformation 226 Paint and Cloning 221 Alternatives 236 Chapter 8 Effective Motion Tracking 237 Point Tracker 239 Track a Scene 248 Smooth a Camera Move 251 Planar Tracker: mocha-AE 255 Track Roto/Paint 261 3D Tracking 263 Chapter 9 The Camera and Optics 267 Cameras: Virtual and Real 269 3D 280 Camera and Story 286 Depth of Focus 293 Grain 298 Lens Optics and Looks 303 Conclusion 312 Chapter 10 Expressions 313 What Expressions Are 314 Creating Expressions 316 The Language of Expressions 318 Linking an Effect Parameter to a Property 318 Using a Layer’s Index 320 Looping Keyframes 322 Using Markers 324 Time Remapping Expressions 327 Layer Space Transforms 331 Color Sampling and Conversion 340 Extra Credit 341 Conclusion 346 Chapter 11 Advanced Color Options and HDR 347 Dynamic Range: Bit Depth and Film 349 Color Realism: Linear HDRI 361 Color Fidelity: Management, Depth, LUTs 371 Conclusion 384 ptg v Section III Creative Explorations 385 Chapter 12 Light 387 Source and Direction 388 Color Looks 392 Source, Refl ection, and Shadow 396 Multipass 3D Compositing 406 Chapter 13 Climate and the Environment 413 Particulate Matter 414 Sky Replacement 418 Fog, Smoke, and Mist 420 Billowing Smoke 423 Wind and Ambience 426 Precipitation 430 Chapter 14 Pyrotechnics: Heat, Fire, Explosions 435 Firearms 436 Energy Effects 441 Heat Distortion 445 Fire 448 Explosions 453 In a Blaze of Glory 454 Index 455 Scripting appendix by Jeff Almasol and After Effects JavaScript Guide by Dan Ebberts available on the accompanying DVD-ROM Bonus chapters mentioned in this eBook are available after the index Appendix Scripting APX-1 JavaScript Guide JSG-1 Links to Scripts Referenced in the Book LSR-1 ptg vi About the Author Mark Christiansen is a San Francisco–based visual effects supervisor and creative director. Some of his Hollywood feature and independent fi lm credits include Avatar, All About Evil, The Day After Tomorrow and Pirates of the Caribbean 3: At World’s End. As a director, producer, designer, and compositor/animator, he has worked on a diverse slate of commercial, music video, live event, and television documentary projects for clients as diverse as Sony, Interscope, HBO, and many of the world’s best-known Silicon Valley companies. Mark has used After Effects since version 2.0 and has worked directly with the After Effects development and marketing teams over the years. He has written four previ- ous editions of this book as well as After Effects 5.5 Magic (with Nathan Moody), and has contributed to other pub- lished efforts including the Adobe After Effects Classroom in a Book. Mark is a founder of Pro Video Coalition (provideocoali- tion.com). He has created video training for Digieffects, lynda.com, and others; has taught courses at fxphd.com and Academy of Art University; and has been a guest host of popular podcasts such as “The VFX Show.” You can fi nd him at christiansen.com. ptg vii About the Contributors Jeff Almasol (Appendix: Scripting) is a senior quality engineer on the Adobe After Effects team by day and crafter of After Effects scripts at his redefi nery.com site by night. His site provides numerous free scripts, reference material, and links to other scripting resources. Prior to Adobe, Jeff worked at Elastic Reality Inc. and Avid Technology on Elastic Reality, Marquee, AvidProNet, and other products; and at Profound Effects on Useful Things and Useful Assistants. You might fi nd him talking in the third person on Twitter (redefi nery) and other sites. Dan Ebberts (Chapter 10: Expressions and After Effects Javascript Guide) is a freelance After Effects script author and animation consultant. His scripting services have been commissioned for a wide range of projects, including workfl ow automation and complex animation rigging. He is a frequent contributor to the various After Effects forums and has a special interest in expressions and complex algorithms. Dan is an electrical engineer by training, with a BSEE degree from the University of California, but has spent most of his career writing software. He can be reached through his web site at http://motionscript.com. Stu Maschwitz (Foreword) is a writer and director, and the creator of the Magic Bul- let Suite from Red Giant Software. Mas- chwitz spent four years as a visual effects artist at George Lucas’s Industrial Light & Magic (ILM), working on such fi lms as Twister and Men in Black. He cofounded and was CTO of The Orphanage, a San Francisco-based visual effects and fi lm production company. Maschwitz has directed numerous commercials and super- vised effects work on fi lms including Sin City and The Spirit. Maschwitz is a guerilla fi lmmaker at heart and combined this spirit and his effects knowledge into a book: The DV Rebel’s Guide: An All-Digital Approach to Making Killer Action Movies on the Cheap (Peachpit Press). ptg viii To the muse, in all of her guises. Acknowledgments When I started the fi rst edition of this book, I may have guessed there was a chance it would be a success and fi nd its way into multiple editions, but I certainly wasn’t focused on that. Some fundamental things about the book, like its basic structure, have not changed, but other aspects have been radically revamped for this one. That parallels the development of After Effects itself. I can still vividly remember the excitement of getting started creating shots in After Effects before I even had heard the term “compositor,” and fooling a renowned visual effects veteran—a veteran, who shall remain nameless, who had no idea the tools existed on the desktop to do this kind of stuff. After Effects is compelling enough on its own to make it worth becoming an expert. Thank you in particular to Adobe for loaning the time and energy of Todd Kopriva to work on this edition. Todd doesn’t let you get away with anything and, as Michael Coleman said to me, he represents the “gold standard” for technical editorial work. I can’t imagine a better person for that role on this edition of the book. It can be diffi cult to properly acknowledge the deceased. When the last version of this book came out, The Orphan- age, the facility where my After Effects chops found a set- ting in which we could push compositing in this software to the maximum, was still very much alive. I remain grateful to fi lmmaker Stu Maschwitz, who cofounded and was CTO of The Orphanage, for helping to guide the fi rst edition to truly refl ect best practices in VFX and help set a standard for this book. Maintaining that standard has been possible only with the collaboration of others. In the last edition, I brought in the best guy I knew to explain expressions, Dan Ebberts, and a counterpart on the scripting side, Jeff Almasol, to con- tribute chapters on their respective specialties, and those remain in this edition. ptg ix But there have been other, perhaps less likely contributors to the book and disc you have before you. It was a chal- lenge from a reader, a fi lmmaker in Switzerland named Sergio Villalpando, that caused me to completely redo a chapter that I had considered the heart of the book (Chap- ter 6: Color Keying). He encountered diffi culty putting the techniques described into practice, and the way in which he articulated his frustration was clear and concise enough to motivate me to approach it as if starting over, basing the new version much more closely on a step-by-step example. My students at Academy of Art made me realize that— although it’s great to impress everyone with a mind- blowingly clever technique—clear, patient elucidation of fundamentals is far more valuable. The personal experi- ence of using the previous edition of the book to teach this material led to many changes in this edition, including the addition of a simple example comp in the very fi rst chap- ter. Students have a better understanding of this process before even beginning it these days, and even though this is not a beginner book, the patient novice may now fi nd an easier way in, thanks to my classroom experience. Collaboration is key to this work. In gathering new mate- rial for this edition I had a few collaborators who were willing to shoot material, either with me on a day out (thanks Tyler McPherron) or remotely (gratitude to Chris Meyer—yes, that Chris Meyer—and to Eric Escobar). Brendan Bolles provided a wonderful description of the difference between low and high dynamic range imaging, which remains lucid and lively enough that I’ve left a lot of it intact in Chapter 11. More and other contributors have been essential to past, current, and future book editions including Kontent, Pixel Corps, Artbeats, fxphd, Case Films, Creative COW, Ken- wood Group, Inhance, Sony, ABC, Red Bull USA, and indi- viduals such as Pete O’Connell, Benjamin Morgan, Matt Ward, Ross Webb, Luis Bustamente, Micah Parker, Jorge L. Peschiera, Shuets Udono, Eric E. Yang, and Kevin Miller. This book’s cover was designed by Regina Cleveland with the guidance of Charlene Will. Thanks to both of you for [...]... 1 of this book and let me know how it goes Organization of This Book, and What’s New Like its predecessors, Adobe After Effects CS5 Visual Effects and Compositing Studio Techniques is organized into three sections Although each chapter has been refined and updated, the broad organization of the book remains as follows Section I, “Working Foundations,” is predominantly about the After Effects UI itself... unfamiliar with After Effects but experienced in other compositing software Here’s a brief overview of how the After Effects workflow is unique from every other compositing application out there Each application is somewhat different, and yet the main competitors to After Effects Nuke, Shake, Flame, Fusion, and Toxic, to name a few—are probably more similar to one another than any of them is to After Effects, ... surprised you, then you weren’t thinking enough about what makes a movie a movie In Your Hands You’re holding a book on visual effects compositing in Adobe After Effects There are those who question the validity of such a thing Some perpetuate a stigma that After Effects is for low-end TV work and graphics only To do “real” effects work, you should use a program such as Nuke or Shake Those techy, powerful... xxiii Introduction Section II, Effects Compositing Essentials,” focuses on the core techniques at the heart of effects compositing Color matching, keying, rotoscoping, and motion tracking are the topics that are essential throughout the rest of the book and in your compositing experience generally There is also a chapter that handles the camera and 3D, one on expressions, and one about working in 32-bpc... primer on After Effects in particular or digital video in general If you’re new to After Effects, first spend some time with its excellent documentation or check out one of the many books available to help beginners learn to use After Effects On the other hand, I have noticed recently that even beginners often understand more than they used to about the compositing process in general and about Adobe software... that can make After Effects easier for the beginner to use but can constrain others: Render order is established in the Timeline and via nested compositions: layers, not nodes After Effects has Flowchart view, but you don’t create your composition there the way you would with a tree/node interface Transforms, effects, and masks are embedded in every layer and render in a fixed order After Effects has... beat After Effects The two that come up the most are the handling of precomposing and the lack of macros This book attempts to shed light on these and other areas of After Effects that are not explicitly dealt with in its user interface or documentation After Effects itself spares you details that as a casual user you might never need to know about but that as a professional user you should understand... he who is not an artist; the worst artist is he who is no scientist —Armand Trousseau Composite in After Effects T his book is about creating visual effects using Adobe After Effects, the world’s most ubiquitous compositing application It helps you create believable, fantastic moving images using elements from disparate sources, and do so with the least possible effort This first section offers a jump-start... jump-start (if you’re relatively new) or a refresher (if you’re already an After Effects artist) on the After Effects workflow Effective visual effects compositing uses your best skills as both artist and engineer As an artist, you make creative and aesthetic decisions that are uniquely your own, but if you are not also able to understand how to implement those decisions effectively, your artistry will suffer... core visual effects topics—color correction, keying, tracking, and roto among them—that are only touched on by other After Effects books, while leaving tools more dedicated to motion graphics (Text, Shape layers, many effects, and even a few specialized tools such as Motion Sketch) more or less alone I do not shy away from strong opinions, even when they deviate from the official line My opinions and techniques . Christiansen Adobe ® After Effects ® CS5 Visual Effects and Compositi ng STUDIO TECHNIQUES ptg Adobe After Effects CS5 Visual Effects and Compositing Studio Techniques Mark Christiansen This Adobe. software and hardware products described in it. Trademarks Adobe, the Adobe logo, and Adobe After Effects are registered trademarks of Adobe Systems Incorporated in the United States and/ or in. Your Hands You’re holding a book on visual effects compositing in Adobe After Effects. There are those who question the validity of such a thing. Some perpetuate a stigma that After Effects