Tải bản đầy đủ - 0 (trang)
Chapter Five. Lighting Creatures, Characters, and Animation

Chapter Five. Lighting Creatures, Characters, and Animation

Tải bản đầy đủ - 0trang

lightsnottocastshadows.Anotherapproachtosettingupa

diffusepassistomodifythelightsnottoemitspecularity,and

globallyturnoffraytracedreflections.



SpecularPasses

Specularpasses(orhighlightpasses)isolatethespecular

highlightsfromyourobjects.Youcanrenderspecularpassesby

turningoffanyambientlightandmakingtheobject'sdiffuse

shadingandcolormappingpureblack.Theresult,asshownin

Figure11.13,willbearenderingofallthespecularhighlightsin

thescene,withoutanyothertypesofshading.



Figure11.13.Thespecularpassofthespaceship



Renderingaseparatespecularpassallowsyoumorecreative

controloverhowthehighlightsarerendered.Forexample,in

Figure11.13,abumpmapwasaddedtovaryandsoftenthe

highlights.Thebumpmapwasnotthereinrenderingthe

diffusepass;itwasappliedonlyforthehighlights.

Youmayalsomoveyourlightstodifferentpositionsifitmakes

betterhighlights.Naturallythelightsshouldcomefromthe



samegeneralangleasthelightingthatisusedinthediffuse

passandshadowpasses,butthere'snothingwrongwith

cheatingalittlebittomakeabetter-lookingrendering.

Duringyourcomposite,havingspecularhighlightsasaseparate

passwillallowcontrolovertheircolorandbrightness,sothat

youcanadjustthehighlightstomatchtherestofyour

compositedscene.Don'tcliplargeareasofyourhighlightsinto

purewhite.Yourspecularpasswillworkbestifhighlightsrun

throughdifferentshadesofgray,whichwillallowittolook

realisticwhenaddedtogetherwithotherpasses.

Youcanalsouseseparatelyrenderedhighlightstocontrolvisual

effects,suchasglowsaddedincompositing.Addingablurred

copyofyourspecularpasswillcreateglowsaroundyour

highlights,asshowninFigure11.14.Thisway,glowsdonot

takeanytest-renderstoadjust,andtheycanbeadjustedin

contextwiththefinalcomposite.



Figure11.14.Addingtogetherthespaceship

image(left)withablurredcopyofthespecular

pass(middle)createsagloweffectaroundits

highlights(right).



ReflectionPasses

Areflectionpasscanincludeself-reflections,reflectionsofother



objects,orreflectionsofthesurroundingenvironment.Often

youneedtorenderseveralreflectionpasses,especiallyifyou

wanttoisolateraytracedreflectionsondifferentobjects.

Tosetupareflectionpassshowingthereflectionsofthe

environmentontothespaceship,thespaceshipisgivena

shaderthatdoesnotshowdiffuseilluminationorspecular

highlights(itisgivenablackcolorandahighlightsizeof0),

butisreflective.Theobjectsthatitneedstoreflectaremade

invisibletoprimaryvisibility,butareleftvisibleinreflections.

Theresultshowsonlythereflectionsonthespaceship,without

anydiffuseorspecularillumination.Thereflectionpassforthe

spaceshipisseparatefromanyotherreflectionpassesthat

mightbeneededlater,suchasifyourenderedreflectionsofthe

shiponareflectivegroundsurface.



CompositingReflections

Reflectionpasses,diffusepasses,andspecularpassescanallbe

compositedtogetherwithanAddoperation(orLinearDodgein

Photoshop),asshowninFigure11.15.Thisway,lighterareasof

yourreflectionandspecularpasseswillbrightenyourdiffuse

pass,andblackareaswillhavenoeffect.



Figure11.15.Diffuse,specular,andreflection

passesareaddedtogetherinthefinalcomposite.



SomepeopleuseScreeninsteadofAddasthecompositing

modewhencombiningthesepasses.Insteadofaddingthe

valuesasa+b,aScreenoperationcalculates1-(1-a)*(1-b).The

resultlookssimilar,butnotasbright.WhileAddistruertothe

resultsofrenderingdiffuse,specular,andreflectionsatoncein

a3Dprogram,Screenislesslikelytoreachpurewhiteand

sufferfromclippingproblemsinbrightareas.Whentwovalues

areaddedandtheyeachreachmediumgray,theresultispure

white.Whentwomediumgrayvaluesarescreenedtogether,

theyarealightgray,andittakesbrightervaluestoreachpure

white.

Insomecases,youwillgetthebestresultsbyblurringyour

reflectionpassslightlyinyourcompositingprogram.Ifyou're

goingtodothis,sometimesyoucansaverenderingtimeby

usinglessanti-aliasingorfewersamplesinyourreflection.Even

ifyourreflectionpassdoesn'tlookperfectlyrefinedwhen

rendered,itcanstilllookgoodafteritisblurredinyour

compositingprogram.



AddingReflectionstoRealObjects



Sometimesyour3Dobjectwillcastareflectionontoarealworldsurface,suchasashinyfloor,countertop,orwater

surface.Inthiscase,renderthecastreflectionasaseparate

reflectionpassreceivedbya3Dmodeloftherealsurface,such

asthegridinFigure11.16.

Fortheeffectofripplingwater,youmightaddabumpmaptoa

reflectivewatersurfaceobject,whichdistortsareflectionas

showninFigure11.17.



Figure11.16.Aplaneispositionedtoreceivea

reflectionpass.



Figure11.17.Bumpmappingdistortsthe

reflectiontomakeitmorewatery(right).



Whenkeyingthereflectionoverasurface,adjustitinyour

compositingprogramtomatchthetonesofexistingreflections

onthesurface,asinFigure11.18.Reflectionsthathavetoo

muchcolorandcontrastcanlookunrealistic,socolorcorrection

isusuallynecessarytomatchanyrealbackgroundsequence.



Figure11.18.Thereflectionisgradedtomatch

thewater'scolors.



ShadowPasses

Ashadowpassisarenderingthatshowsthelocationsof

shadowsinascene.

Insceneswithoverlappingshadows,itisimportanttokeepthe

differentshadowsseparatedwhenrenderingshadowpasses,so

thatyoucancontroltheirappearance,color,andsoftness

separatelyduringthecomposite.



ThesceneontheleftsideofFigure11.19islitbymultiplelight

sources.Ashadowpassthatlumpedthemalltogether(right)

wouldnotallowyoutoisolatethemandmanipulatethem

separatelyinthecomposite.Thiskindofshadowpassisaquick

presetinsomeprograms,butitputsallofyourshadows

togetherintothealphachanneloftheshadowpassimage.If

youhavetouseapresetlikethis,trytorenderseveralofthem,

oneforeachofyourlights,toavoidlumpingmultipleshadows

together.



Figure11.19.Ascenewithseveraloverlapping

lights(left)couldproduceanunmanageable

numberofoverlapsinashadowpass(right).



ColoredShadowPasses

Analternatewaytorenderashadowpassistosetuplights

withdifferentshadowcolors,suchasred,green,andblue.With

thelight'scolorsettoblack,thecoloredshadowsareallthat

appearinthepass.Ifyourenderacoloredshadowpassas

showninFigure11.20,thenyoucanseparatethered,green,

andbluechannelsduringthecomposite,andusethemasthree

separateshadowpasses.



Figure11.20.Shadowssplitintored,green,and



bluepackthreeshadowpassesintoone.



Thetrickofusingablacklightcolorandared,green,orblue

shadowcolordoesn'tworkineveryprogram.Youmayneeda

workaround,suchasgivingthelightanegativeintensityanda

negativeshadowcolor.Regardlessofhowyousetitup,packing

threeshadowsintoeachshadowpassismoreefficientthan

renderingshadowpasseswithonlyoneshadow,orashadow

passinwhichtheshadowscannotbeseparated.

Evenwiththeshadowsisolatedintodifferentcolorchannels,for

completecontroloveryourshadowsyoualsoneedtoseparate

thecastshadows(shadowsfromoneobjectontoanother)from

theattachedshadows(whereobjectsshadowthemselves).To

dothis,youshouldmaketheobjectsthatcasttheshadows

invisibletoprimaryrays,sotheyareonlypresentinthepassto

castshadows,asinFigure11.21.Havingshadowobjectscast

shadowswithoutbeingdirectlyvisibleinalayeralsohelpsyou

includeshadowscastfromonelayerintoanother.



Figure11.21.Isolatingshadowsonthetable

allowsthemtobeblurredseparatelyfromthe

foregroundgeometry.



Attachedshadowsdon'talwaysneedtobeincludedinashadow

passatall.Sometimesyoucanrenderattachedshadowsasa

partoftheobject'sdiffuseandspecularpasses,andonlyworry

aboutthecastshadowsinyourshadowpasses.It'sagoodidea

torenderdifferentshadowpassesfordifferentlayers.Especially

inascenewithtransparentobjects,renderingashadowpass

fortheforegroundobjects,andanotherforthebackground,

wouldbemoremanageablethanrenderingthemalltogether.

Therearemanywaystoactuallyuseashadowpassin

compositing.Somepeoplelaytheshadowpassoverother

passes,sothattheycoverthebackgroundwithblackinthe

areaswheretheiralphachannelsaremoresolid.Other

compositorstreatashadowpassasamaskforadarkening

adjustment.Anotherpopularapproachistoinverttheshadow

pass(sothatitbecomesablackshadowonawhite

background)andmultiplyitwiththecoloredimage.Ifyouplan

tomultiplyyourshadowpasswithotherelements,youmight

wanttorenderitstraightinsteadofpremultiplied,toavoid

mattelinesbuildingupinyourcomposite.



BlurringandDistortingShadowPasses

Shadowssometimeslookbetterwhentheshadowpassis

blurredduringcompositing.Ifyouarerenderingashadowpass



thatyouknowwillbeblurredlateranyway,youmightuseless

anti-aliasingontheshadowpass,turndownthenumberof

shadowsamplesorshadowraysonsoftshadows,orusea

lowerresolutionshadowmap.Figure11.22showsthescene

withtheshadowsonthetableblurredduringthecomposite.



Figure11.22.Becausetheshadowsonthetable

wereaseparatepass,theycanbeleftcrisp(left)

orblurredinthecomposite(right).



Ifyourshadowpassiscastontoaflat,smoothsurface,then

blurringtheshadowpasswillcreatearealisticresultthatlooks

asifyouhadrenderedasoftshadow.Ifthesurfacereceiving

theshadowisrough,jagged,orhasanycomplexshape,then

youruntheriskthatpartsoftheshadowwillgetblurredoutof

alignmentwiththegeometry,darkeninginappropriatepartsof

thescene.Ifyourshadowisn'tcastontoaflatsurface,then

makesureyourshadowisrenderedwiththeamountofsoftness

youneed,becauseyouwillbelimitedinhowmuchyoucanblur

itincompositing.

Separatingtheshadowsthatfallontothegroundisespecially

importantifyouareintegratingCGwithphotographsorfilmed

backgrounds.Inaddingshadowpassestolive-actionplates,

sometimesanextradisplacementisappliedduringthe

composite,suchasusingtheluminanceofthebackgroundplate

toshiftpartsoftheshadowbyafewpixels.Thiscanmakethe

edgesofyourshadowsappearrougherwheretheyfallonto



rocks,grass,orotherdetailsonarealgroundsurface.



DoubledShadows

Acommonproblemincompositingvisualeffectsshotsis

doubledshadows.AsshowninFigure11.23,doubledshadows

occurwhereashadowpassfurtherdarkensanareathatwas

alreadyshadowedfromthesamelightsource.Whencombining

twoshadowpassesthatrepresenttheblockingofthesame

light,besuretocompositethepassestogetherfirstina

lighten-onlyordarken-onlymode,andthenusethemerged

shadowstodarkenthebackgroundplate.



Figure11.23.Shadowsmotivatedbythesame

lightsourceshouldnotdouble-darkenanarea

wheretheyoverlap(left)butshouldblend

seamlesslytogether(right).



Doubledshadowscanbeaproblemwhenaddingashadowpass

toalive-actionbackgroundplate.Especiallyforexteriorscenes

wherethesunprovidesasinglesourceforshadows,doubled

shadowswouldlookhighlyunrealistic.Theshadowpassmust

notdarkenareasthatarealreadydarkenedbyarealshadow.

Therealshadowneedstobemaskedout,sothatyourshadow

passdarkensonlytheareasthatweren'talreadyinshadow.

Yourshadowpassshouldappeartoextendtheareaofthereal



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter Five. Lighting Creatures, Characters, and Animation

Tải bản đầy đủ ngay(0 tr)

×