8
H16 Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene behind the image plane. Mantra achieves this by sending out a number of rays from the camera’s position until they hit an object in the scene. Every time a ray hits an object, it will return some piece of information about the object (Its color, for instance). This process can broadly be described as “Sampling” the scene. Sampling once per pixel, however, can cause “aliasing” where information is lost between samples. This is particularly evident in scenes with more variety in shapes and colors. Increasing the number of samples per pixel gives an “anti-aliased” image which better represents the actual scene.

H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

  • Upload
    lengoc

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

Page 1: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

SAMPLINGANDNOISEWhengeneratinganimage,Mantramustdetermineacolorvalueforeachpixelbyexaminingthescenebehindtheimageplane.Mantraachievesthisbysendingoutanumberofraysfromthecamera’spositionuntiltheyhitanobjectinthescene.Everytimearayhitsanobject,itwillreturnsomepieceofinformationabouttheobject(Itscolor,forinstance).Thisprocesscanbroadlybedescribedas“Sampling”thescene.

Samplingonceperpixel,however,cancause“aliasing”whereinformationislostbetweensamples.Thisisparticularlyevidentinsceneswithmorevarietyinshapesandcolors.

Increasingthenumberofsamplesperpixelgivesan“anti-aliased”imagewhichbetterrepresentstheactualscene.

Page 2: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

Thesamplesdescribedabovecouldbedescribedas“Primary”rays(orpixelsamples).Theycandeterminetheoverallqualityoftheimagebeingrendered,especiallywithregardtotheshapeandaccuracyoftheobjectsinthescene.

Forotheraspectsofanimage,likelighting,reflectionsandrefractions,moreraysmustbecastintothescene,originatingfromthehitlocationoftheprimaryrays.Foreachprimaryray,Mantrawillfireatleastone“Secondary”ray.Thesesecondaryrayscanbedividedintotwotypes-DirectandIndirect.

DirectandIndirectRaysDirectRayscanbedescribedasrayswhichdealwithLights.Thisgenerallymeansthattheraystravelfromsomepositioninthescenetowardthevariouslightsources.Theseraysdetermineifasurfaceisinshadow,andifnot,lightinginformationcanbecalculated.

Thesame“aliasing”problemsdescribedpreviouslycanexistwiththesedirectrays,resultinginanoisyimage.Youwillusuallyfindnoisefromdirectsourcesshowingupwhenrenderingspecular

Page 3: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

highlightsorthesoftedgesofshadowscastfromarealights.Inthesecases,itmaybenecessarytosendmoredirectrays.

WhenevaluatingtheeffectofsendingmoreDirectRaysinyourrenders,itcansometimesbechallengingtoseparateonesourceofnoisefromanother.Addingthe“DirectLighting(percomponent)”imageplanewillallowyouviewthedirectcontributionofeachcomponentseparately.

Whenattemptingtooptimizethenumberofdirectraysinyourscene,the“DirectSamples”imageplanecanbeadded.Thisplanewillshowyouthenumberofdirectraysusedthroughoutyourimagedisplayedasintensity.

Page 4: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

IndirectRayscanbedescribedasrayswhichdealwithobjectsandtheirsurfaceproperties.Thisgenerallymeansthatraystravelfromsomepositioninthesceneindirectionsdeterminedbytheshaderattachedtotheobject.Refractionrayswilltravel“through”objects,ReflectionRayswillbounce,andDiffuseRayswillscatterinarandomdirectionwithinahemisphericaldistribution.

Withindirectrays,“aliasing”canbemuchworsethanwithDirectraysandusuallythegreatestcauseofnoiseinarender.Generallyspeaking,small,verybrightfeatureswillcausethemostnoiseinindirectsamples–softreflectionsofverybrightspecularhighlightsonotherobjects,forexample.Inthesecases,itmaybenecessarytosendmoredirectrays.

Page 5: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

WhenevaluatingtheeffectofsendingmoreIndirectRaysinyourrenders,itcansometimesbechallengingtoseparateonesourceofnoisefromanother.Addingthe“IndirectLighting(percomponent)”imageplanewillallowyouviewthedirectcontributionofeachcomponentseparately.

Whenattemptingtooptimizethenumberofindirectraysinyourscene,the“IndirectSamples”imageplanecanbeadded.Thisplanewillshowyouthenumberofindirectraysusedthroughoutyourimage.

Page 6: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

VOLUMESSamplingvolumetricobjectsrequiresadifferentapproachthansamplingsurfaces.Whiledirectraysarestillused,theymustsamplethevolumemultipletimeswhiletravellingthroughthevolume.Indirectraysbehaveinasimilarfashion,sentmultipletimesastheray“steps”throughthevolumetricobject.Thismeansthatsamplingvolumesisamuchmoreexpensiveprocessthansamplingasurface.

Asaraytravelsthroughavolume,itmovesforwardataratedeterminedbytheVolumeQuality.Ateachstep,itevaluatestheshaderandaccumulatesthedensityofthevolume.Becausethese

Page 7: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

densityvaluescanvarydrasticallythroughoutthevolume,nearbyrayscancalculatesubstantiallydifferentvalues,introducingnoiseintotherender.Inthesecases,itmaybenecessarytosendoutmoredirectandindirectraysortotakesmallerstepsthroughthevolume.

Evenatlowsamplingrates,itcanbecostlytorendercleanimagesofvolumetricdata.Thisisbecausetheshadingisrunforeverystepthroughthevolume.However,mantrahasavarietyofwaystooptimizevolumerenderingwhichcandecreaserendertimeswithoutsacrificingdetail.

Oneoptimization,knownasStochasticTransparency,decouplestheaccumulationofdensityvaluesfromtheshadingsamples.Thismeansthattheamountofsamplingcanbegreatlyreducedasvariationsinlightinginformationislessobviousthanvariationsindensity.

Page 8: H16 Mantra User Guide SAMPLING AND NOISE - … Mantra User Guide SAMPLING AND NOISE When generating an image, Mantra must determine a color value for each pixel by examining the scene

H16MantraUserGuide

WhenevaluatingtheeffectofsendingmoreDirectandIndirectraysinyourrenders,itcansometimesbechallengingtoseparateonesourceofnoisefromanother.Addingthe“DirectLighting(percomponent)”and“IndirectLighting(percomponent)”imageplaneswillallowyouviewthedirectandindirectvolumecontributionsseparately.