Académique Documents
Professionnel Documents
Culture Documents
VRayRenderOptimization|AkinBilgic
Home
Gallery
Tutorials
About
Contact
VRayRenderOptimization
AnindepthtutorialonoptimizingVRaytodeliverthe
highestqualityrenderswiththefastestrendertimes.
v1.3
August2014
Changelog
v1.0December162013PublicRelease.
v1.1December222013ImprovedthelayoutoftheOptimizationProceduresection,andaddedanoteaboutGIcontrollingVRayHairMtl'sreflection/refractionquality.
v1.2February012014AddedinformationaboutSpecularHighlights,andelaboratedGlobalIlluminationmethodsintheOptimizationProcedure.
v1.3August182014UpdatedtheOptimizationProceduresectiontonolongerrelyonthe'DefaultLights'setting,whichsometimescreatedissuesforindoorscenes.
Intro
ThistutorialattemptstocovertheprocessofoptimizingyourVRayrendersettingstogetthebestpossiblerenderqualityandfastestrendertimeforagivenscene.
There'softenalotofconfusionsurroundingVRay'ssamplingmethodsandwhat'ideal'settingsare.Manytimesyou'llseeartistsadoptthe'UniversalVRaySettings'of
havingtheImageSampler(AntiAliasing,orAA)MaxSubdivsvaluesetveryhigh(like50or100),andthensimplyloweringthenoisethresholdvalueuntiltherender
becomescleanenoughthinkingthatit'sthebest/fastestthatVRaycando.ButwithabitofunderstandingofhowVRayworksunderthehood,youcanachievea
higherqualityresultWITHfasterrendertimesinsomeextremecasesrangingbetween3xfasterto13xfasterthantheuniversalsettings.
We'llfirstcoversomeoftheunderlyingconceptsbehindhowraytracingandVRay'ssamplingworks.Thenwe'llgooveranexamplescenetodemonstrateexactlyhowa
rendercanbeoptimizedtobefasterandcleaner.Thenwe'lllearnhowtoidentifythedifferentsourcesofnoiseascenecanhave.AndfinallyI'llprovideastepbystep
proceduretooptimizeanyscenetorenderwithanidealbalanceofqualityandspeed.
Ifyoualreadyknowtheunderlyingconceptsandjustwantthetechnicalstepbystepprocedure,clickheretoskiprighttoit.
Raytracing101
Whenarenderbegins,raysarefirstsentoutfromourcameraandintothescenetogatherinformationaboutthegeometrythatwillbevisibleinthefinalimage.These
raysoriginatingfromthecameraarecalledPrimaryRays(alsocalledCameraRaysorEyeRays)andarecontrolledbyVRay'sImageSampler(alsoknownasAnti
AliasingorAA).
WheneveraPrimaryRayintersectswithgeometryinthescene,additionalraysgetsentoutfromthatpointofintersectionintotherestofthescenetogatherinformation
aboutthingslikeLighting,Shadows,GlobalIllumination(GI),Reflection,Refraction,SubsurfaceScattering(SSS),etc.TheseadditionalraysarecalledSecondaryRays
andarecontrolledbyVRay'sDMCSampler.
http://www.cggallery.com/tutorials/vray_optimization/
1/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Figure01
Asimplifieddiagramofraytracing:
PrimaryRaysaresentoutfromthecameraintothescene,intersectwithgeometry,andsendoutvariousSecondaryRaystofurthersamplethescene.
Fromthispointforward,we'llsimplyreferto'Rays'as'Samples'becausethat'swhatthepurposeofaRayistotakeaSampleofascenetogatherinformationabout
what'sgoingoninit.SobasicallyRays=Samples.
Inordertoaccuratelyfigureoutwhat'sgoingoninascene,manyPrimaryandSecondarySamplesareneededtobetaken.Themoreascenegetssampled,themore
informationVRayisabletogatheraboutthescene,andthehigherqualitytheresultingrenderwillbewhichmeanslessNoiseintherender.ThisisbecauseNoiseis
causedbyalackofinformation.NoisepresentinarendermeansthatVRaywasn'tabletogatherenoughinformationaboutwhat'sgoingoninascene.Soinorderto
reducenoise,youneedtoprovideVRaywithmoreinformationandtoprovideVRaywithmoreinformation,youneedtotakemoresamples.
TheamountofPrimarySamplessentoutintothesceneismainlycontrolledbytheMinSubdivs,MaxSubdivs,andColorThresholdsettingsoftheImageSampler.
TheamountofSecondarySamplessentoutintothesceneismainlycontrolledbytheSubdivssettingsfromindividualLights/GlobalIllumination/Materialsinthe
scene,andtheNoiseThresholdsettingoftheDMCSampler.(NoiseThresholdisnamedAdaptiveThresholdinVRayforMaya)
Sotorecaptheimportantterms:
Ray=
Sample
Primary
Samples=
ThesamplescontrolledbyVRay'sImageSampler(alsoknownasAntiAliasingorAA),whichisspecializedinsamplingascene'sGeometry,Textures,
DepthofField,andMotionBlur.
Secondary
Samples=
ThesamplescontrolledbyVRay'sDMCSampler,whichisspecializedinsamplingascene'sLighting,GlobalIllumination(GI),Shadows,Material
Reflection&Refraction,andSubSurfaceScattering(SSS).
Noise=
Alackofinformation.
Subdivs=
ThesquarerootoftheactualnumberofSamples.SoSubdivs2=Samples.
Forexample:8Subdivs=64Samples.(82=64)
Inthistutorialwe'lllearnhowtobestutilizethesePrimaryandSecondarySamplestogetthehighestqualityrender(lowestamountsofNoise)inthefastestamountof
time.
http://www.cggallery.com/tutorials/vray_optimization/
2/13
1/12/2016
VRayRenderOptimization|AkinBilgic
UnderstandingTheSampleRateRenderElement
TheSampleRaterenderelementisoneofthemostimportanttoolswe'llbeusingtohelpusoptimizeourrenders.It'sVRaywayofshowingusexactlywhattheImage
Sampler(AA)isdoingatanygivenpixel.ItdoesthisbyassigningacertaincolorforeachpixelintherenderaccordingtohowmanyPrimarySamples(AA)arebeing
takenatthatpixel(whichcanbeseenbyviewingtheSampleRaterenderelement).
ABlueishcolormeansalowamountoftheavailablePrimarySamples(AA)wastakenatthepixel.
AGreenishcolormeansamediumamountoftheavailablePrimarySamples(AA)wastakenatthepixel.
ARedishcolormeansahighamountoftheavailablePrimarySamples(AA)wastakenatthepixel.
Figure02
TheSampleRaterenderelement(right),showinghowmanyoftheavailablePrimarySamplesarebeingtakenatanypixeloftherender(left).
SoforascenewiththeImageSampler(AA)setto1minand10maxSubdivs(meaning1minand100maxPrimarySamples):
ABluepixelmeansthat1PrimarySamplewastaken
AGreenpixelmeansthat50PrimarySamplesweretaken
ARedpixelmeansthat100PrimarySamplesweretaken.
AndforascenewiththeImageSampler(AA)setto1minand100maxSubdivs(meaning1minand10000maxPrimarySamples):
ABluepixelmeansthat1PrimarySamplewastaken
AGreenpixelmeansthat5000PrimarySamplesweretaken
ARedpixelmeansthat10000PrimarySamplesweretaken.
ExampleSceneUnderstandingHowVRayWorks
Forthistutorial,we'llbeworkingwithasimpletestsceneconsistingof:Aplanewithafewspheresontop,varioussimplematerials(includingdiffuse,glossyreflection,
glossyrefraction,andSSS),2areaslights,andadomelightwithanHDRI.GlobalIlluminationisenabledandsettoBruteForce+LightCache.Thisscenefilecanbe
downloadedHERE.
We'llbeginwithabaselinerenderwiththefollowingrendersettings:
ImageSampler(AA)setto1min&8maxSubdivs.
Lights,GI,andMaterialsallsettothedefaultof8Subdivs.
NoiseThresholdsettothedefaultof0.01.
http://www.cggallery.com/tutorials/vray_optimization/
3/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Allotherrendersettingsareleftattheirdefaults.
Figure03
BaselineRender
1min&8maxSubdivs=ImageSampler(AA)
8Subdivs=Lights,GI,andMaterialseach.
Nowletsgooverexactlywhat'shappeninginthisbaselinerender.Throughtherendersettings,you'retellingVRay:
"I'mallowingyoutouseupto64(8Subdivs)PrimarySamples(AA)perpixeltofigureoutwhat'sgoingoninthissceneandreducethenoiseascloseasyoucantomy
specifiednoisethreshold...BUTforeachofthosePrimarySamplesyoutake,you'reonlyallowedtotake1additionalSecondarySampletofigureoutwhat'sgoingonfor
eachLight,GI,andMaterial."
Atthispointyoumaybeasking:
"Wait,only1SecondarySamplefortheLights,GI,andMaterialseach?Shouldn'titbe64Samples(8Subdivs)aswe'vesetthem?"
Wellit'simportanttonotethateventhoughtheLights,GI,andMaterialsaresetto64Samples(8Subdivs)eachVRayinternallydividesthisvaluebytheAAMax
Samplesvalueofyourscene.Soinsteadofthe64Samplesforthelightandmaterialeachasyoumightexpect,thisgetsdividedbytheAAMaxof64Samples(8
Subdivs),whichresultsinonly1SecondarySamplebeingtakenfortheLights,GI,andMaterialseach.(64SecondarySamples/64PrimarySamples=1Secondary
Sample).
ThereasonVRaydoesthisisbecauseit'sinternalformulasaresetupinawaythatattemptstoautomaticallybalanceit'stwosamplers.Thethinkingbehindthisisthat
withmorePrimarySamplesbeingtakenofyourscene,aproportionallysmalleramountofSecondarySamplesareneededtofigureoutexactlywhat'shappeninginthe
scene(whichwe'llsoonlearn,thisisn'talwaysdesirable).ThisbalancingoftheImageSamplerandtheDMCSamplercanbeabitconfusingatfirst,buttheimportant
thingtotakeawayisthis:WheneveryouincreaseyourImageSampler(AA)settings,VRaytriestocompensatebyinternallydecreasingyourDMCSamplersettings.
Lateronifyou'reinterestedinlearningmoreabouthowVRaysinternalformulasworkyoucancheckouttheDMCCalculatorI'vecodedbutforrightnowit'snot
necessary.
Soletsgetbacktotherendering:
VRayfinishestherenderasbestasitcanmanage,butwarnsyou(bythemanyREDpixelsintheSampleRaterenderelement):
"IwasNOTabletofigureoutwhat'sgoingoninallofthissceneaccordingtothelevelofquality(noisethreshold)youwantittobeat!AlotofthetimeIhadtouseup
allofthe64PrimarySampleswith1SecondarySampleperLight,GI,andMaterialyouallowedmetouseforeachpixel,butitstilldidn'tprovidemewithenough
informationinthoseareas."
Ifwetakealookattherenderwe'llnoticethatwhilethegeometricdetail(edgesofobjects)seemfairlycleananddefined,thereareindeednoisyareasoftheimage
specificallynoticeableinthereflectionsandshadows.Sowe'vegotthisnoisybaselinerender,andwehavetwooptionstoreducethenoisetomeetourdesiredlevelof
quality(noisethreshold):
http://www.cggallery.com/tutorials/vray_optimization/
4/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Option
#1=
IncreaseAAMaxSubdivsLetVRaytakemorePrimarySamplestofigureoutthescenebutagainonly1additionalSecondarySamplefortheLights/GI
/MaterialseachperPrimarySample.
Option
#2=
IncreaseLights/GI/MaterialsSubdivsTellVRaytostayatthesameamountofPrimarySamplesbutinsteadallowittakemoreSecondarySamples
witheachPrimarySampletobetterfigureoutthescene.
ExampleSceneOption#1IncreasedAAMaxSubdivs
Soletsfirsttrywhatmostpeopleusuallydotogetahighquality(lownoise)renderadoptthesocalled'UniversalVRaySettings'andletVRaytakeasmanyPrimary
Samples(AA)asneededtoeliminatethenoise.
We'llincreasetheImageSampler(AA)to1min&100maxSubdivs.
We'llleavetheLights,GI,andMaterialssetto8Subdivseach.
We'llreducetheNoiseThresholdto0.005totellVRaywereallywantanoisefreerender.
Figure04
Option#1RenderIncreasedAAMaxSubdivs
1min&100maxSubdivs=ImageSampler(AA)
8Subdivs=Lights,GI,andMaterialseach.
0.005=NoiseThreshold.
Nowletsgooverexactlywhat'shappeninginthisOption#1render.Throughtherendersettings,you'retellingVRay:
"I'mallowingyoutouseupto10000(100subdivs)PrimarySamples(AA)perpixeltofigureoutwhat'sgoingoninthissceneandreducethenoiseascloseasyoucanto
myspecifiednoisethreshold...BUTforeachofthosePrimarySamplesyoutake,you'reonlyallowedtotake1additionalSecondarySampletofigureoutwhat'sgoingon
withtheLights,GI,andMaterialseach."
Again,rememberthateventhoughtheLights,GI,andMaterialsaresetto64Samples(8Subdivs)eachVRayinternallydividesthesevaluesbytheAAMaxSamples
valueofyourscene.Soinsteadof64Samples,thisgetsdividedbytheAAMaxof10000Samples(100Subdivs),whichresultsintheminimumofonly1Secondary
SamplebeingtakenfortheLights,GI,andMaterialseach.(64SecondarySamples/10000PrimarySamples=1SecondarySample).
VRayfinishestherenderasbestasitcanmanage,andtellsyou(bythenowmostlyBLUESampleRaterenderelement):
"Iwasabletofigureoutallofwhat'sgoingoninthisscenetothelevelofquality(noisethreshold)youwantittobeat!Infact,IwasabletofigureitoutwellbeforeI
hadtouseall10000PrimarySampleswith1SecondarySamplesperLights,GI,andMaterialsyouallowedmeforeachpixel."
http://www.cggallery.com/tutorials/vray_optimization/
5/13
1/12/2016
VRayRenderOptimization|AkinBilgic
WetakealookattheOption#1renderandseethenoisehasdefinitelybeenimprovedcomparedtothebaselinerender.Therendertimehasincreasedby11min44s
(9.8xlonger)comparedtotheBaselineRender,butthat'stobeexpectedwithahigherqualityrender,right?Atthispoint,mostpeoplewouldthinkthisisasgoodasit
gets,andcalltherenderFINISHED!
...ButwhathappensifweweretotrythatOption#2wediscussedearlier?InsteadofincreasingtheAAMaxSubdivs,whathappensifweinsteadoptedtoonlyincrease
theLights/GI/MaterialsSubdivs?Wellletsfindout...
ExampleSceneOption#2IncreasedLight/GI/MaterialsSubdivs
Thistimewe'lltrysomethingalittledifferentwe'lltellVRaytotakesameamountofPrimarySamplesthatweoriginallydidinthebaselinerenderbutinsteadallow
VRaytotakemoreSecondarySampleswitheachPrimarySampletobetterfigureoutthescene.
We'llleavetheImageSampler(AA)settotheoriginalbaselinerender'ssettingsof1min&8maxSubdivs.
We'llincreasetheLights,GI,andMaterialsto80Subdivseach.
We'llleavetheNoiseThresholdsettotheoriginalbaselinerender'sdefaultof0.01
Figure05
Option#2RenderIncreasedLights,GI,andMaterialsSubdivs
1min&8maxSubdivs=ImageSampler(AA)
80Subdivs=Lights,GI,andMaterialseach.
0.01=NoiseThreshold.
Oncemore,letsgooverexactlywhat'shappeninginthisOption#2render.Throughtherendersettings,you'retellingVRay:
"I'mallowingyoutouseupto64(8subdivs)PrimarySamples(AA)perpixeltofigureoutwhat'sgoingoninthissceneandreducethenoiseascloseasyoucantomy
specifiednoisethreshold...ANDforeachofthosePrimarySamplesyoutake,you'reallowedtotakeupto100additionalSecondarySamplestofigureoutwhat'sgoing
onwiththeLights,GI,andMaterialseach."
Again,rememberthateventhoughtheLights,GI,andMaterialsaresetto6400Samples(80Subdivs)eachVRayautomaticallydividesthesevaluesbytheAAMax
Samplesvalueofyourscene.Soinsteadof6400Samples,thisgetsdividedbytheAAMaxof64Samples(8Subdivs),whichresultsinonly100SecondarySamples
beingtakenfortheLights,GI,andMaterialseach.(6400SecondarySamples/64PrimarySamples=100SecondarySample).
VRayfinishestherenderasbestasitcanmanage,andtellsyou(throughtheSampleRaterenderelement):
"Iwasabletofigureoutalmostallofwhat'sgoingoninthisscenetothelevelofquality(noisethreshold)youwantittobeat!Infact,mostofthetimeIwasableto
figureitoutwellbeforeIhadtouseall64PrimarySamplesperpixel!Allthoseextra100SecondarySamplesperLight,GI,andMaterialprovidedeachPrimarySample
http://www.cggallery.com/tutorials/vray_optimization/
6/13
1/12/2016
VRayRenderOptimization|AkinBilgic
withsomuchmoreinformationthistime!"
WetakealookattheOption#2renderandseethenoisehasdefinitelybeenimprovedcomparedtothebaselinerender.Therendertimehasincreasedby4m38s(4.5x
Longer)comparedtotheBaselineRender,butthat'stobeexpectedwithahigherqualityrender.
Buthere'swherethingsstarttogetinteresting...
WhenwecompareOption#2'srenderagainstOption#1'srender,wecanseethatOption#2gaveusacleanerrender!
Andlookatthat!Option#2finished2.2xfasterthanOption#1!5m58sforOption#2versus13m04sforOption#1!
Figure06
Option#1Renderontheleft,andOption#2Renderontheright.
Atthebottom,therenderszoomed400%tobettershownoiselevels.
Whyisthis?WhydidincreasingtheDMCSamplersettings(Lights/GI/MaterialsSubdivs)ratherthanincreasingtheImageSampler(AA)settingsresultinacleaner
ANDfasterrenderforthisscene?WeevensetOption#1tohavealowernoisethreshold,yetitstillturnedoutnoisierthanoption#2!Welltheanswerliesinwhatwe
originallynoticedabouttheBaselinerender...
HowOptimizationWorks
InourBaselineRender,wesawthatwhiletheedgesofobjectslookedcleananddefined,thenoiseseemedtoresideprimarilyinthereflectionsandshadows.Well,ifyou
http://www.cggallery.com/tutorials/vray_optimization/
7/13
1/12/2016
VRayRenderOptimization|AkinBilgic
rememberwhatwelearnedearlier:PrimarySamples(AA)specializeinfiguringoutthegeometry,textures,depthoffield,andmotionblurinascene.WhileSecondary
Samplesspecializeinfiguringoutlighting,GI,shadows,materials,etc.
SointhecaseoffixingthenoiseintheBaselinerender,thechoicebetweenOption#1andOption#2isactuallyanobrainer!Whyuseascrewdrivertodoahammer's
job?TheImageSampler(AA)hadalreadydonewhatitwasdesignedtodomakethegeometricdetail(edgesofobjects)cleananddefined.Soinsteadoffiringabunch
ofadditionalPrimarySamples(AA)atthescenetocleanupnoiseit'sbettertoallocatethoseadditionalsamplestotheDMCSampler(Lights/GI/MaterialsSubdivs)
soitcanproperlydowhatitwasdesignedtodocleanupthenoiseinthelighting,shadows,GI,reflections,andrefractions.There'souranswer!
Andnowcanwebegintounderstandwhythe'UniversalVRaySettings'of1minand100maxAAisgenerallynotgoingtobethemostefficientmethodtorenderascene
infactitneverwasmeanttobethemostefficientmethod!TheUniversalVRaySettingsweredesignedtomakeVRayaccessibleandeasyforuserswhodon'tcare
aboutrenderoptimizationorlearninghowVRayworksunderthehood.It'ssimplyamethodtoputVRayonautopilot.Itallowsausertocontrolallrenderqualityby
adjustingonlyonesettingthenoisethreshold.Ifthere'stoomuchnoiseinarender,justlowerthenoisethreshold,andVRaywillkeepfiringPrimarySamples(AA)at
thesceneuntiliteventuallyreachesthenoisethresholdguaranteeinganicelookingrenderwithminimalunderstandingofhowVRayworks.Butthatrenderis
generallynotgoingtobeascleanorrenderasfastasifyoutakethetimetounderstandhowVRayworksandbalancetheImageSamplerandDMCSampleraccording
toascene'sdemands!
AndjusttoreallydrivethepointhometheOption#2Rendercanstillbeoptimizedevenfurther!Usingsomeadditionaltrickslistedintheproceduresattheendofthis
tutorial,wecanreduceit'srendertimefrom5m58sto4m53swithonlyaslighthitinnoiseamounts!Forafinalrenderspeedincreaseof2.7timesfasterthantheOption
#1Render!
Figure07
Option#1Renderontheleft,andOption#2Renderoptimizedevenfurtherontheright.Foratotalrenderspeedincreaseof2.7x!
Here'sanotherexampleofoptimization,thistimewithamoreproductionorientedscene...
Theoptimizedrender(right)rendersnearly35%fasterthantheuniversalsettingsrender(left)whilereducingnoiseandimprovingrenderquality.Alsonotehowthe
reflectionshavebecomemoreaccuratenoticeableonthefloortowardstheendofthehallway.
http://www.cggallery.com/tutorials/vray_optimization/
8/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Figure08
'UniversalVRaySettings'ontheleft,andtheOptimizedrenderontheright.
RenderscenecourtesyofPeterGuthrie
IdentifyingSourcesOfNoise
Thekeytoproperlyoptimizingarenderistocorrectlyidentifywhichaspectsofascenearecausingnoise,andassigningtherightsamplerwithenoughsamplestoattack
thatnoiseatit'ssource.SomesceneswillrequiremoresamplesfortheImageSampler,whileothers(liketheonesshownintheexamplesabove)willrequiremore
samplesfortheDMCSampler.Asageneralguideline:
CircumstanceswheretheImageSampler(AA)willrequirelargeramountsofPrimarySamplestoeliminatenoise:
FinegeometricdetaillikeHair,Grass,Foliage,etc.
Veryfinetexturedetaillikeweaves,tinybumpmapdetails,etc.
SceneswithshallowDepthofFieldorheavyMotionBlur.
http://www.cggallery.com/tutorials/vray_optimization/
9/13
1/12/2016
VRayRenderOptimization|AkinBilgic
CircumstanceswheretheDMCSamplerwillrequirelargeramountsofSecondarySamplestoeliminatenoise:
Largelightsourcesthatcastsoftshadows.
MaterialswithstrongglossyReflectionorRefraction.
SceneswithprominentGlobalIlluminationparticularlyindoorscenes.
NoisecausedbytheImageSampler(AA)isluckilyveryeasytospottothenakedeye.Itmanifestsitselfinjaggedorunclearobjectedges,undefinedtexturedetailor
effectslikeMoirpatterns,andgrainydepthoffieldormotionblur.
NoisecausedbytheDMCSamplercanbeabittrickiertoseeexactlywhat'scausingit.LuckilywehavesomehandytoolsatourdisposaltohelpusfigureitoutV
Ray'sRenderElements:Lighting,GlobalIllumination,Specular,Reflection,andRefraction.Bylookingthroughthesevariousrenderelements,youcanquicklyisolate
andcheckthelevelsofnoisecausedbyanyoftheseindividualaspectsofyourscene.
Figure09
BylookingattheReflectionrenderelement,wecanseetheamountofnoisecausedbymaterialreflectionsalone.
OptimizationProcedure
SonowthatwehaveasolidunderstandingofwhatcanbegainedbyproperlyutilizingVRay'ssamplers,andhowtoidentifythesourcesofnoiseinourscene,wecan
followastepbystepproceduretohelpoptimizewhateversceneyoumaybedealingwith.
ThegeneralideabehindthisprocedureistobeginbysettingtheImageSampler(AA)MaxjusthighenoughtoclearlydefinetheGeometry,Textures,DepthofField,and
MotionBlurdetailinyourscene,andthentuneeachoftheDMCSampler'saspects(Lights/Specular/Shadows,GI,MaterialReflection/Refraction)oneatatimeto
eliminatenoise.Sowe'llstartwithdefaultVRaysettings,andbringourrendertoaverybasicstatetostarttheoptimizationprocess:
1. InVRay'sGlobalSettingsrolloutuncheck'Shadows','Reflection/Refraction',and'GlossyEffects'todisablethem.
2. InVRay'sGI(IndirectIllumination)tabdisableGlobalIllumination.
3. InVRay'sRenderElementstabadd:SampleRate,Lighting,GlobalIllumination,Specular,Reflection,Refraction.
4. Optional:Reduceyourrenderframesizeforfasterfeedbackduringtheoptimizationprocess.
Atthispoint,yourrendershouldbenothingbutaveryplainlylitdiffuserenderofyourscene.[Example]
TuningtheImageSampler(AA):
5. GraduallyraisetheImageSampler(AA)MaxSubdivsvalueuntilallgeometryedges,texturedetail,depthoffield,andmotionblurinyoursceneappearscrispand
clear.ChecktheSampleRateRenderElementforredareasandreducethemasneededbyincreasingyourImageSampler(AA)SubdivsMaxvalueuntiltheyonly
http://www.cggallery.com/tutorials/vray_optimization/
10/13
1/12/2016
VRayRenderOptimization|AkinBilgic
residealongtheveryedgesofyourobjectandtexturedetails.Oncethesedetailsappearniceandcrisp,leaveyourImageSampler(AA)settingsalone.
Tuningthescene'sLighting/Shadows/Speculars:
6. InVRay'sGlobalSettingsrolloutCheck'Shadows'toreenablethem.
Atthispointyourrendershouldhavelightingandshadows,butstilldiffusematerials.[Example]
Noticethatnoise(alongwithmoreredpixelsintheSamplerRaterenderelement)hasbeenreintroducedtotherenderfromenablingyourscene'sLighting.
7. RaisetheSubdivsvalueinyourLightsuntilthenoiseintheshadowsandlightingbecomeacceptablysmoothandclear.It'seasiesttoseetheeffectofraisingthese
SubdivsvaluesbycheckingyourLightingrenderelement.AsyouraisetheseSubdivvalues,theredpixelsinyourSampleRaterenderelementshouldagainbe
recedingbacktotheveryedgesofyourobjectsandtextureswhilemostotherareasgraduallybecomemoreblueorgreenindicatingthatlessImageSamples(AA)
arebeingneeded.
AnoteaboutSpeculars:ThequalityofspecularhighlightsinyourscenearealsocontrolledbyyourLightsSubdivsvalue.Asageneralruleofthumb,oncethe
shadowsofalightarefreeofnoise,thespecularhighlightforthatlightshouldalsobefreeofnoise.Butfornowwewontbeabletotellsincewecurrentlyhave
GlossyEffects(whichSpecularHighlightsareapartof)globallydisabledforthisstageoftheoptimizationprocess.Solateronwhenwrappinguptheoptimization
processifyounoticeanynoisyspecularhighlightsintheSpecularrenderelement,increasingthelight'sSubdivsvalueishowtofixit.
Tuningthescene'sGlobalIllumination(GI):
8. InVRay'sGI(IndirectIllumination)tabreenableGlobalIllumination.
IrecommendusingBruteForcefortheprimaryengine,andLightCacheforthesecondaryengineunlessdealingwithspecificcases(likeacameraflythrough)
whereusingacachedGImethodlikeIrradienceMapismoreappropriate.
Atthispointyourrendershouldhavenormallighting,shadows,andnowGI,butstilldiffusematerials.[Example]
Againnoticethatnoise(alongwithmoreredpixelsintheSamplerRaterenderelement)hasbeenreintroducedtotherenderfromenablingyourscene'sGI.
9. RaisetheSubdivsvalueofyourBruteForceGIuntilanynoiseintheGlobalIlluminationbecomesacceptablysmoothandclearthistimeusingtheGlobal
Illuminationrenderelementpasstocheckthenoiselevels.Again,asyouraisetheSubdivsvalue,theredpixelsinyourSampleRaterenderelementshouldbe
recedingbacktotheveryedgesofyourobjectsandtextureswhilemostotherareasgraduallybecomemoreblueorgreenindicatingthatlessImageSamples(AA)
arebeingneeded.
AnoteaboutHair:IfusingtheVRayHairMtlinyourscene,thequalityofyourhair'sreflectionandrefractionisinfactcontrolledbyyourscene'sGlobal
IlluminationSubdivsvalue.Youcanverifythisbynoticinghowhair'sreflectionandrefractiondoesn'tappearatallintheReflectionorRefractionrenderelements
untilGIisturnedon.ThisisbecausetheVRayHairMtl'sreflectionandrefractioncomponentsareentirelydependentonGI,andthisisalsowhytheVRayHairMtl
hasnoseparateSubdivsvaluesforit'sreflectionandrefraction.Sonowisalsothetimetobetuningyourhairreflectionandrefractionquality.
Tuningthescene'sReflectionsandRefractions:
10. InVRay'sGlobalSettingsrolloutCheck'Reflection/Refraction'and'GlossyEffects'toreenabledthem.
Atthispointyoursceneshouldrenderasnormal,withlighting,GI,andmaterialreflection&refraction.[Example]
Butagain,noticethatnoise(alongwithmoreredpixelsintheSamplerRaterenderelement)havebeenreintroducedtotherenderfromenablingyourscene's
Reflections&Refractions.
11. RaisetheSubdivsvaluesinyourmaterials'Reflectionsuntilanynoiseinthembecomesacceptablysmoothandclear.It'seasiesttoseetheeffectofraisingthese
SubdivsvaluesbycheckingyourReflectionrenderelementpass.Again,asyouraisetheseSubdivvalues,theredpixelsinyourSampleRaterenderelementshould
againberecedingtotheveryedgesofyourobjectsandtextureswhileotherpixelsgraduallybecomemoreblueorgreenindicatingthatlessImageSamples(AA)
arebeingneeded.
12. Repeatthepreviousstep,thistimewithyourscenematerials'Refractions.
Yourrendershouldnowbeoptimizedforanidealrendertimeaccordingtothelevelofquality(noisethreshold)youhaveitsetat!
Ifyoudesirelessnoise,lowertheImageSampler's'ColorThreshold'value,andraiseLights/GI/MaterialsSubdivsasneeded.
http://www.cggallery.com/tutorials/vray_optimization/
11/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Figure10
AnanimatedGIFillustratinghowallocatingmoresamplestotheDMCSamplerreducesthestressontheImageSampler.TheImageSampler'sMin&MaxSubdivsstay
thesame,whilethescene'sLights/GI/MaterialsSubdivsriseresultinginlessPrimarySamples(AA)beingneededwhilequalityimproves.
AdditionalTips&Tricks
Intheexamplesinthistutorial,IkepttheLights/GI/MaterialsallatthesameSubdivsvaluesforthesakeofsimplicityandtomaketheconceptseasyto
understand.Butit'simportanttorememberthataproperlyoptimizedscenewillhavevaryingSubdivvaluesspecificallytailoredtotheneedsofeachofthese
secondaryaspectsofthescene.
Forexample:Amaterialthat'sonly5%reflectiveprobablywontneedtoomanyreflectionsamplestopreventnoisefrombeingvisibleinthefinalimage,sinceit's
finalRGBvaluewillbe95%dependentonthematerial'sdiffuseorrefractioncomponents.Butifthatsamematerialwasinstead95%reflective,itwillneedmore
reflectionsamplestopreventnoisebeingvisibleinthefinalrender,sincethereflectionwillnowbethemaincontributingfactorofthematerial'sfinalRGBvalues.
Thesamegoesformaterialglossinessthemoreglossyamaterial'sreflectionorrefractionis,themoresamplesit'llneedtoeliminatenoise.Thesameappliesfor
lightsthelargerthelight,thesoftertheshadows,andthemoresamplesit'llneedeliminatenoise.
KeeptheDMCSampler'sAdaptiveAmountsettingbelow1.0.Therearemanyinstanceswheresettingthisvalueatornearthemaximumvalueof1.0cangive
reallyunpredictableresults.Thedefaultvalueof0.85isagoodplacetoleaveitset.
ExperimentwithunlinkingtheImageSampler'sColorThresholdvaluefromtheDMCSampler'sNoiseThresholdbyuncheckingthe'UseDMCSampler
Threshold'checkboxunderVRay'sImageSamplerrollout.ThenincreasetheColorThresholdvalueinsmallincrementstohelptheImageSamplernotconfuse
noisecausedbyLights/Shadows/GI/Materialsforgeometricortexturaldetail.Raisingthisvaluecanpotentiallyreintroducenoiseinyourimage,soyoucan
eitherraiseyoursecondarySubdivsvalueshighertocompensate,orjustaccepttheslightlynoiserbutfasterrendertimes.Ittakesabitofexperimentationtoseeif
it'sworthitforyourparticularscene.
ExperimentwithdisablingtheImageFilteroftheImageSamplerifyoudon'thaveverysmallrepeatingdetailpatternsinyourscene.VRay'sImageSampler
(AA)alreadydoesagoodjobresolvingandsmoothingdetailsoadditionalfilteringsometimesisn'tneeded.
ExperimentwithdisablingtheFilterMapscheckboxinVRay'sGlobalSettingsrollout,orloweringthefilter/blurvaluesofindividualbitmapsusedinyour
scene'smaterialstovalueslike0.1or0.2.Especiallyconsiderdisablingthefilteringofopacitymapsformaterialslikeleavesintrees.Disablingorreducingthe
filter/blurvaluesofmapswillhaveadefiniterenderspeedincreasewhilemakingyourmapsappearsharper,butcanalsohavethesideeffectsofincreasedRAM
usage,andpossibleflickeringorscintillationofmapsinanimations.
IfusingLightCacheforyourGI'ssecondarybouncesenable'UseforGlossyRays'and'RetraceThreshold'tohelpspeedupthecalculationofglossymaterials.
IfusingVRay3.0tryenablingtheEmbreeraycasterviathe'UseEmbree'checkboxintheVRay'sSystemrollout.InmanyscenestheEmbreeraycastercan
yieldagreatreductioninrendertimewithnovisibledifferenceinquality.
ReduceVRay'sBucketSizetosomethinglike32x32or24x24toavoidlargerindividualbucketsgettingstuckonaparticularlydifficultpartoftherenderwhile
otherthebucketsfinishrenderingandleavetheimagecausingyourCPUtoonlyuseafractionofit'savailablepowertofinishthelastbitoftherender.VRay3.0
dynamicallyreducesBucketSizetowardstheendofarendertohelpavoidthisforyou.
http://www.cggallery.com/tutorials/vray_optimization/
12/13
1/12/2016
VRayRenderOptimization|AkinBilgic
Conclusion
Inclosingit'simportanttokeepinmindthateverysceneisdifferent,andthereforehasdifferentneedsfromVRay'stwosamplers.Settingsthatoptimizeonescenecan
potentiallygrindanotherscenetoahaltsopleaseremember:Yoursettingsandabilitytooptimizearendercanvarygreatlyfromonescenetothenext.Withabitoftrial
&error,practice,andpatience,you'llgaintheexperiencetointuitivelyknowwhatsettingsascenecallsfor.
SohopefullythathelpedtoclearuptheoftenconfusingtopicofVRayRenderOptimizationforyou!Iwishyoufastrendersandthebestofluckwithyourprojects!
Specialthanksto:
ToniBratinevicandJohnO'Connellfortheinformationthey'vegenerouslysharedwiththecommunityonthesubject.PeterGuthrieforlendinghisgallerysceneforuse
intheexamples.JohnRouseforproofreadingandtestingtheproceduresinthisarticle.
Donate
Haveyoufoundthistutorialhelpful?
Ifso,considerchippinginwhateveryoufeelit'sworthsoIcandedicatemoretimetocreatingfreehighqualitycontenttosharewiththeCGcommunity.
Thanks!Ireallyappreciatethesupport!
PayPalDonation
BitCoinDonation
AllimagesandcontentarecopyrightAkinBilgic
WebsitedesignandHTML5/CSS3codingbyAkinBilgic
http://www.cggallery.com/tutorials/vray_optimization/
13/13