在2D实拍视频中合成3D动画.docx
《在2D实拍视频中合成3D动画.docx》由会员分享,可在线阅读,更多相关《在2D实拍视频中合成3D动画.docx(9页珍藏版)》请在冰豆网上搜索。
在2D实拍视频中合成3D动画
在2D实拍视频中合成3D动画
3DInA2DScene
在2D场景中加入3D动画
BenCowell
Cricket翻译
cuiyunpeng@我相信你一定会被这篇教程所的缜密的思维、精致的叙述所感染!
Thisisaverysimpletutorialdemonstratinghowtotake2Dvideofootageandcompositea3Danimatedobjectinthescene.I'mnotgoingtogointoeveryspecificMAXfeatureandoptionused,InsteadI'llbeconcentratingmoreontheactualprocessandflowofworkandfiles.
这是一个关于如何在2D视频脚本中混入3D动画物体的简单教程。
教程不涉及3Dmax的详细功能,而是注重与实际的工作程序。
1.ConvertyourvideosequencetoindividualTIFfiles.
1.把你的视频序列转换为TIF文件。
Aswehavediscussedearlierwhenworkingwitheffectwewanttokeepfilequalityashighaspossible,thereforeJPEG'sarenotthebestmediumforimagestorage.Inthistutorialwe'llbeusingTIFFfilesorTARGAfileswhenwerequireanalphachannel.TakethisTIFFsequenceandstoreitforlater.
我们要尽量保持文件的品质,所以JPEG等格式不在考虑范围之内。
自在这个教程中,当需要alpha通道时我们向选用TIFF或TARGA格式。
把视频转换成TIFF序列以备后用。
Unlessyou'reusingaveryhighendmachineyou'renotgoingtowanttobedealingwithlargeamountsoffileswhilecompositing,sotakeoneframeofyoursequenceandkeepithandy.Storetherestofthefilessomewhereelseforlater.Keeponeframeasaproxy.Makesureyoukeepyourfilesanddirectoriesneat,compositingcanbealogisticalnightmarewiththeamountoffilesyou'llbedealingwith.Abitofplanningandneatdirectorystructuringcansaveyoualotofheadacheslaterondowntheline.
除非你使用的机器非常高端,否则在合成时不能处理大量的文件。
所以从你的视频序列中选出一帧并放在容易调用的地方。
保持一个静止帧作为代理。
一定要保持你的文件和目录清晰明了,因为如果要处理大量文件的话合成操作将会苦不堪言。
进行一点计划并保持文件组作执整洁会在后期避免许多麻烦。
2.CreatetheAnimation.
2.创建动画。
I'mnotgoingtotalkmuchaboutyouractualanimation.I'llassumeyouhavesomethingsimplelikearollingballorthelittlecarI'musinginmydemo.Rememberthatyourcameracannotmoveinthisexample(cameramatchingissupportedinMAX,butI'llnottouchonthatforthisdemo,we'llbeworkingwithasimplelockedoffcamera).
这里不涉及具体动画制作,我肯定你手头上有像球滚动或汽车移动这样的可在这个示例中使用的小动画。
一定要保证在动画中摄像机是静止的。
(虽然3Dmax支持摄像机匹配,但在这个示例中不涉及这些。
我们将处理简单的摄像机被锁死的动画。
)
3.Tearyourhairoutliningupthecamera.
Sonowyouhaveashortanimationandavideosequence.Thenextstepistomakethecamerainyouranimationlineupwiththecamerayouusedforyourvideoshoot.
3.现在准备好了一个小动画和视频序列。
下一步是将3D动画中的摄像机与视频中使用的摄像机对齐。
Nowisthetimeallthosemeasurementsandnotesyoutookonsetwillcomeinhandy..assumingyoudidactuallymakeallthosenotesonset.Ifnotthenit'saverylongslowprocessofsettingtheviewingangleandthezoomofthecameraandshiftingit'sorientationuntilitmatches.
现在手头上应该有你在拍摄时的测量数据和笔记。
否则设置3D动画中的摄影机的角度、焦距、方向与实拍时一致将会是很慢的过程。
Tospeedthisprocessupitwouldhelpifyou'dshotafewframesofarealobjectinyourscene,andthenkeepthisforreferencealongwiththedimensionsoftheobject.ThenwhenyoucometoMAXyoucanloadaframeofthisintoyourbackgroundandcreatetheobjectusingit'sexactmeasurements.Nowyoucanbesureyourscaleofyour3Dobjectsinrelationtothebackgroundfootageandpositioningofthevirtualcamerawillbecorrect.
为了加速这个过程,在实拍时加几帧参考物体会很有帮助。
当进入3Dmax中你可以在如一帧作为背景并以其为参考创建物体。
现在已可以保证3D物体的放缩值、移动与实际相符。
Iusedavideocase,tooktheshotintoMAX,createdavideoboxinMAXandthenlinedthembothupperfectly,thiswayicouldbesurewherethegroundwasinmyMAXscene,andthattheanimationwouldaligncorrectlywiththefootage.
我把一个录像带盒摄入MAX,再在MAX中创建一个虚拟的方块与其严格对齐,这样我可以保证虚拟的场景与实拍的场景吻合。
Asyoucanseeaboveitcantakealotofworktolinetheobjectsupcorrectly,andyoumayrequireafewreferenceobjectstoensurethecameraisperfectlymatched.
从上图中可以看出对齐物体需要许多工作。
你可能需要多个参考物体来使摄像机完美的吻合。
4.Lights!
.
4.灯光!
Onceyou'resureyouhaveyourcameramatched,freezeitinMAXtoavoidaccidentallyshiftingitwhilstyoucontinuetoworkonthescene.
一旦你对齐了摄像机,在MAX中锁定它,以避免在下面的工作中不小心被移动。
Nowyoucanrefertoallthoselightingnotesyoutookonset.Itendtousealittlecheatandplacesomewhitepingpongballsinthesceneandshootafewframes,thenwhenicomebacktothecomputer,icancreatesomeballsinMAXandgetthelightingandpositioningtomatchperfectly.
现在你可以参考在实拍时的灯光纪录。
我喜欢在实拍中加入几帧乒乓球的画面,在MAX中我创建一样的球体一保持光照和位置吻合。
Againthiswilltaketime,lightingisanartform.It'simportantnottorushthisstageasthequalityofthelightingwilldecidewhetherornotaneffectsshotworks.
这也需要时间,打光是一门艺术。
这一步一定不能着急,因为打光的品质将决定最终效果的质量。
Playcloseattentiontoshadowsandthecolorofthelightinthescene,alsobeawarethatunlikeincomputeranimation,lightintherealworldbouncesaround,soifanobjectisplacedonawhitesurfacelightwillbouncefromthewhitesurfaceontotheundersideoftheobject.Youwillhavetotrytosimulateallthiswithyourcomputerlighting,whichcanbeaveryhardtask.
注意场景中的阴影和光的颜色,注意,与电脑动画不同的是,显示中的光线会被四处反弹,所以当一个物体在被放置在白色表面上将把白色应在物体的底部。
你必须努力用电脑中的光模拟这一切。
这将会是项艰巨的工作。
Thebestadvicetomatchinglightingisgoodobservationandnotetakingduringtheshoot.
吻合光照的最佳建议是仔细观察和在拍摄时纪录笔记。
5.Anchoringyourimagesusingshadow.
5.用阴影描绘图像
Therearemanyvisualcluesoureyesneedtounderstandtherelationshipbetweenobjectsinanimage,butoneofthemostimportantisshadows.Shadowshelpusunderstandwherethelightiscomingfrom,howmanylightsourcesthereareandtheintensityofeach.
我们的眼睛需要许多视觉线索来判断一张画中物体的关系,其中最重要的是阴影。
阴影帮我们理解光从哪里来,有多少个光源和每个光源的强度。
InthisexampletheintensityandblurofshadowswillbeachievedinpostproductionsoI'veusedraytracedshadowstogivemeperfectblackshadowswithahardoutline.
在这个示例中阴影的强度和模糊度将在后期处理中完成,所以我是用光线跟踪类型的阴影来产生完美的黑色硬边阴影。
Assumingyourlightsaresetupcorrectlyyourshadowsshouldworkwithoutmuchalteration,wesimplyhavetoplaceproxyobjectsinourscenetoreceivetheshadows.ProxyobjectswillbeplacedwhereverthereisanobjectinourshotthatwillreceiveashadowfromourCGobject.IfyoulookattheexamplebelowyoucanseethatI'vehadtorecreatetheCPU,thedesk,thewallandthecuptoreceiveshadowsfrommycar.
为保证灯的位置正确设置,阴影不应有太大的改动,我们必须在场景中创建虚拟物体来接受阴影。
在实拍中有实际物体的地方都应放置相应的虚拟物体来接收CG物体产生的阴影。
从下图中可以看出我创建了主机、桌子、墙壁和杯子来接收小车产生的。
6.Multi-passrendering.
6.多次渲染
ToallowmetocontroltheattributesofeachshadowindividuallyinpostproductionI'mgoingtorendereachshadowoutseparately.Inmyexampletherearethreeshadows,adownwardshadowbeneathobjects,andthenalongshadowcastbehind.I'vesplittherenderofthelongshadowintotwopasses,onefortheverticalobjectssuchasthecupandtheCPU,andoneforthehorizontalobjectssuchasthedesk.ThisisbecausethehorizontalshadowsaremuchlighterthanthosecastonverticalobjectsandI'dliketheabilitytocontrolthisinpostproduction.
为了在后期处理中能分别控制每一个阴影的属性,我将会分别渲染出每个阴影。
在例子中有三个阴影:
在物体下指向下的阴影,然后是物体后的长阴影。
我把长阴影的渲染分成两步,一是对于垂直的物体例如、杯子和主机,另一个是为水平物体例如桌面。
这是因为水平方向的阴影比在垂直物体上投射的阴影要轻的多,我想要在后期处理中能控制这些特性。
Sonowwewanttorenderoutoutshadowsforthewholesequence.MAXcomeswithamaterialcalled'shadow/matte'thatwillonlyrendershadowscastontheobjectthisisidealforourpurposes.WecanapplythismaterialtotheobjectsinthescenesuchasmyproxyCPU,desk,wallandcup.
现在我要为整个场景渲染出阴影。
MAX有一种材质叫做'shadow/matte'(阴影/遮罩),它将只渲染被投射在其物体上的阴影,这对我们达到目的是理想的材质。
我们可对场景中的虚拟物体例如主机、桌子、墙壁和杯子赋予这种材质。
Nowifwesettheenvironmentbackgroundtowhiteandrenderoutashotyou'llseeyouonlygettheobjectandtheshadowsitcasts.
现在如果我们将场景的环境背景设置为白色并渲染出,你发现你只得到了小车物体和它投下的阴影。
Theproblemiswestillhavethe3Dobjectintheshot,whichwereallydon'twantwhenwecometopostproduction.WhenusingraytracedshadowsMAXwon'tallowyoutoseeshadowswithouttheobjectbeingvisible,sowe'lluseaplugintexturecalledwhichisavailablefromthenicepeopleat:
问题是在镜头中仍有我们在后期不想看到的3D物体。
当时用光线跟踪类型的阴影时MAX不允许在物体不可见是投射阴影,所以我们将使用一个叫做'castshadowsonly'(只投射阴影)的纹理插件。
插件可从
Thismaterialcannowbeappliedtotheobject(inmyexamplethecar)sothatwhenwerenderweonlyseeshadows.Nowyou'llhavetoplaywiththeshadowcast/receiveoptionsforyourproxyobjectsasobviouslywedon'twantthemtocastshadowsoneachother.
这个材质现在可以被赋予物体(在这个例子中是小车),结果是当渲染时我们将只看见阴影。
现在我们必须调整虚拟物体的阴影产生、接收选项,以避免它们之间产生阴影。
Nowwecanrenderourshadowsoutonebyone.Inmycasethisinvolvedrenderingout300framesforeachshadow,eachtimeturninglightsonoroffandalteringthecast/receiveshadowsoptionsforvariousobjects.
现在我们能一个个渲染出阴影了。
这个例子中我为每阴影渲染300帧图像,每次为不同的物体设置阴影产生、接收选项和调整光源的开闭.
Asyoucanseeaboveyounowhavethreesetsofshadows.Taketheseframesandstorethemforlater,onceagainkeepingaproxyofeachforcompositing.
从上图可看出现在有三种类型的阴影。
储存这些帧,再次为每段设定一个代理。
7.Shadowscastbyforegroundobjects.
7.前景投射的阴影
You'llnoticeinmyexamplethatthemonitorshouldcastashadowonthecarasitemergesfrombetweenitandtheCPU.Thisissimplyachievedbycreatingaproxymonitor,andassigningourcastshadowsonlymaterialtoit.Notwearereadytoperformthefinalrenderofthecarelement.TheseframesshouldbesavedasTARGAimagesastheAlphaChannelwillcomeinusefulwhenweperformthecomposite.
你会注意到在例子中当小车在主机与显示器之间是显示器应在小车上投射阴影。
这可通过创建显示器并赋予其产生阴影的材质见大的解决。
现在我们准备好了渲染小车这个元素。
因为在合成时需要Alpha通道,所以这些帧应被储存成TARGA文件。
8.Puttingitalltogether.
8.把他们放在一起。
OnceagainI'mnotgoingtogointoanyrealdepthonthesoftwaresideoncompositingallthistogether.ForthisexampleIusedAftereffects.
再次说明我不会深入软件的技术细节。
在这个例子中我使用Aftereffects。
YoumayhavebeenwonderingwhyIremindedyoutokeepacopyofoneframe