Вы находитесь на странице: 1из 17

VrayMaterials

PostedonDecember9,2012byAustris/ThisentrywaspostedinVRayTutorials.Bookmarkthe
permalink.
Tobegincreatingbeautifulmaterials,wemustfirstunderstandhowtheVRaymaterialworks.Lets
takeacloserlookattheVRayMtl,VRayFastSSS2,andVRayBlendMtl.These3arethemainmaterial
typesthatareessentialforrealisticresults,youcanachievealmostanythingwiththem.VRayoffers
evenmorematerialtypes,butthosearemeantforprettyspecifictasksandwillnotbecoveredinthis
guide.
ForgetaboutusingMAXStandardmaterials,theywillgiveyouslow,noisyandnonrealisticresults.
VRayisdesignedtobeusedwithitsnativeshaders,sothatiswhatwearegoingtodo.
Letsgetstarted.
(Youcanclickontheimagestoenlargethem.)
VRayMtlisthebasic,mostused,universalmaterialthatVRayoffers.Youwillfindthatmostofthe
materialsyouwishtocreatecanbemadefromaVRayMtl.
Thishowthebasic,unchangedmateriallooks.

NowletslookatthefirstsectionDiffuse.

ThinkofDiffuseasthebasecoloroftheobject.Ifyouseeatomato,youcaninstantlytellitsred.This
meansthatredistheDiffusecolor.Itisabitmorecomplicatedforveryreflectiveorveryrefractive
objects,butwewilllookatthoselater.
1|P a g e

VRayMtlallowsyoutochooseasimplecolorastheDiffuseoruseaMap.YoucanuseanyBitmapor
ProceduralMapintheMapslot.
Hereisanexample.

TheRoughnessparametercanflattenthecolortransitions.Youcanuseittomakeyourmaterial
appeardustyandflat.Hereisanexamplewiththesamegreenmaterialat0,0.5and1.0Roughness.

NextsectionisReflection

Asthenamesuggests,thissectiondealswiththereflectivepropertiesofthematerial.Mostreal
worldobjectsarereflective.Lookatthesephotosofchromeandbrickforexample.

2|P a g e

Thereflectionsofthechromeareverystrongandsharp,youcaninstantlyrecognizeitasareflective
surface.Butwhataboutthebrick?Itmightlookthatitsnotreflectiveatall,butinfactthereflections
arejustweakandveryveryblurred.Theonlyobjectsthatdontreflectanylightaretheblackholes:)
Keepthisinmindwhencreatingthematerials.
Letslookattheparametersnow.
FirstistheReflectioncolor.

Blackcolormakesthematerialnonreflective,whitecolormakesitfullyreflective.Allthegrayscale
valuesbetweenincreaseordecreasethereflectionstrength.Thecolorslidersin3DsMaxgofrom0
to255,thismeansthatifyouwanttomakeamaterialthatreflects50%ofthelightthathitsit,you
needtosetthevalueofthereflectionsto128.Hereisanexampleat0,128and255.Noticehowthe
thirdimagehaslostalltheDiffusecolorandisonlyshowingthereflections.Reflectionsmakethe
basecolorweakerastheygetstronger.TheEnergyPreservationlawdoesntallowrealisticmaterials
toreflectmorelightthantheyreceive.ThismeansthatIfthematerialhas0%reflections,itshows
100%oftheDiffusecolor.Ifthematerialhas30%reflections,theDiffusecolorisweakenedtojust
70%,andsoon.ThinkofthereflectionsasalayerontopoftheDiffuse,togethertheycreatethefinal
image.

JustlikewiththeDiffuse,youcanuseColor,BitmaporProceduralmapintheReflectslot.Hereisan
examplewithallthree.

TheDiffusecolorforalltheexamplesis128gray.NoticehowtheReflectcolorchangesthelookof
theDiffuse.ThiscolorchangehappensbecauseVRayadherestotheEnergyPreservationrule.Ifthe
3|P a g e

materialreflectstheredcoloredlight,theredcolorissubtractedfromtheDiffuseandonlygreenand
blueareleft.Thisbehaviorcansometimesmakeitdifficulttopredictthefinalresult,thisiswhyyou
canchangetheEnergyPreservationmodeinthematerialoptions.IfyouchooseMonochrome,only
thereflectionswillbecoloredandtheDiffusecolorwillbeleftunchanged.

NextupisReflectionGlossiness.Thisistheparameterthatcontrolshowsharp/blurredarethe
reflections.Somerealworldobjects,likepolishedmetal,mirror,chrome,haveverysharpreflections,
whileothermaterials,suchaswood,concrete,plastic,etc.,haveblurredreflections.Youcanadjust
theReflectionglossinessfrom0to1(completelyblurredtoperfectlysharp).Formostmaterialsyou
willnotneedtolowertheglossinessbelow0.3.Youshouldalwaysuseblurredreflectionswith
caution,donotlowertheglossinessmorethannecessary,asthiswillcausemorenoiseinyourimage,
youcangetridofitbyincreasingtheSubdivs,butitwilltakeatollontherendertime.Herearesome
basicexamplesofhowtheglossinessworks.

Noticethenoiseintroducedintotheimage.YoucancleanitupwiththeSubdivsparameter,
increasingitwillmakereflectionssmootheratthecostofrendertime.Noticehowtherendertime
hasincreased3.5timesifyoucomparethethirdandfirstimages.16isagoodchoicefordecent
resultwithouttoomuchwaiting.Youcanusethesubdivsparametertofindabalancebetweentime
andquality.
4|P a g e

IdonotrecommendunlockingHighlightglossinessandchangingit,ifyourgoalisrealisticmaterials.
Thisparameterallowsyoutofaketheblurredreflectionswithoutactuallycalculatingthem.Itcan
sometimesbeusedforquickerrendersifdeadlinesaretight.
NextupistheFresnelparameter.YoumighthaveheardthatallrealworldmaterialsfeatureFresnel
reflections,butwhatdoesitactuallymean?Fresnelchangesthereflectionstrengthdependingonthe
viewingangle.Generalruleisthatreflectionsareweakerifthesurfaceisfacingyouperpendicularly
andincreaseinstrengthasthesurfaceapproachesparallelpositionrelativetoyourviewingangle.
Herearesomerealworldexampleswhereyoucanseethiseffectinaction.Themarble,carandwall
surfacesaremuchmorereflectivewhentheyaremoreparalleltotheviewingangle.

AndhereishowtheFresnelIORorIndexofRefractionworks.Useonlyvaluesfrom1.01up,lower
valuesarenotphysicallycorrectfornormalmaterials.IncreasingtheIORchangestherelationship
betweentheangleofthesurfaceandreflectionstrength,lookattheexamples.

Asageneralguideline,herearetheReflectIORvaluesforsomecommonobjecttypes:
water1.33
plastic1.45
glass1.51.8
diamond2.4
compoundmaterialslikewood,stone,concreteetc36
metals20100
Exactvaluesneedtobefinetunedforeachmaterialtoachievetherightlook.
5|P a g e

NextparameterisReflectionDepth.Thisisthenumberoftimesalightrayisreflectedbefore
stoppingthecalculations.Whenthesetnumberofreflectionshasbeencalculated,therestare
simplydisplayedastheExitcolor.YoucantrysettingabrightcolorastheExitcolortoseehowmuch
informationyoulose.Lookattheexample,thegreenpartsshowtheareaswhichwouldbenefitfrom
alargernumberofreflections.Asyoucansee,6reflectionsareplentyforthisscene.Otherscenes
withmorereflectivesurfacesmightneedalargervalue.

LetsmoveontothenextsectionRefractions
Thesesettingscontrolifandhowthematerialletsthelightthroughit.Commonmaterialsthathave
refractivepropertiesareglass,water,gems,transparentplastics,etc.
FirstparameterthatcontrolstherefractionsisRefractcolor.Asbefore,itgoesfromblack(no
refractions)towhite(fullrefractions)andeverythinginbetweenisamixbetweenDiffuseand
Refraction.
Herearesomeexampleswithablackmaterial.Irecommendusingblackdiffusecolor[1;1;1]formost
ofthetransparentmaterialsandadjusttheoverallcolorwithRefractcolorandFogcolor.

Youcanuseacolor,bitmaporproceduralmapinthisslotaswell.

Refractionglossiness.Justlikewiththereflections,youcanchangehowblurryaretherefractions.
Thiseffectisgreatforfrostedglassoranyotherroughsurfacethatletsthroughthelightbutdistorts
italongtheway.
6|P a g e

Thisoneincreasesrendertimesandnoisealotsobecarefulwithit.Noneedtogolowerthan0.6for
mostmaterials.

Tocleanupthenoise,weneedtoincreaseSubdivsparameter.Asyoucansee,gettingacleanresult
comeswithahugecost.Therendertimeforthelastimageisalmost7timeslongerthanwiththe
defaultvalue.Itisalso15timeslongerthannotusingblurredrefractionsatall!Sotrytominimizethe
blurredrefractionsifyouneedfastrenders.

Intherealworldlightchangesitsangleasittravelsbetweenobjectsofdifferentdensity,thusthe
surfacerefractsthelight.IORvalueof1letsthelightthroughwithoutbendingit,astheIORvalue
increases,sodoestheangleatwhichlightisrefracted.Lookattheseexamples.

IndexofRefractionhasbeencalculatedformanymaterials,soyoudontneedtoguess.Youcanfind
variousIORtablesontheinternet.Hereisoneofthem:
Acetone1.36
Actinolite1.618
Agalmatoite1.550
Agate1.544
Agate,Moss1.540
Air1.0002926
Alcohol1.329
Amber1.546
Amethyst1.544
Crystal2.00
7|P a g e

8|P a g e

Diamond2.417
Emerald1.576
Ethanol1.36
EthylAlcohol1.36
Glass1.51714
Glass,Albite1.4890
Glass,Crown1.520
Glass,Crown,Zinc1.517
Glass,Flint,Dense1.66
Glass,Flint,Heaviest1.89
Glass,Flint,Heavy1.65548
Glass,Flint,Lanthanum1.80
Glass,Flint,Light1.58038
Glass,Flint,Medium1.62725
Gold0.47
Ice1.309
Ivory1.540
Jade,Nephrite1.610
Jadeite1.665
Lead2.01
Malachite1.655
Methanol1.329
Moonstone,Albite1.535
Nylon1.53
Onyx1.486
Opal1.450
Oxygen(gas)1.000276
Oxygen(liq)1.221
Pearl1.530
Plastic1.460
Plexiglas1.50
Polystyrene1.55
Quartz1.544
Quartz,Fused1.45843
RockSalt1.544
Rubber,Natural1.5191
Ruby1.760
Sapphire1.760
Silicon4.24
Steel2.50
Tigereye1.544
Topaz1.620
Tourmaline1.624
Turpentine1.472
Turquoise1.610
Water(gas)1.000261
Water35C(Roomtemp)1.33157
Zirconia,Cubic2.170
Maxdepthworksjustlikewiththereflections.Thedefaultvalueisusuallyfine,butforsceneswith
largeamountofrefractions,youshouldincreaseit.
NextparameterisFogColor.Itisgreatifyouwanttotinttheglassinarealisticway.UsingtheFog
colormakesthinnerpartslighterandthickerpartsdarker.YoucanusetheFogmultipliervalueto
adjusthowstrongisthetint.Isuggestusingcolorswithlessthan255lightnessandsaturationfor
realisticresults.

YoucancontroltherelationshipbetweenobjectthicknessandFogintensitybyusingtheFogBias
value.Lookattheexamplestoseehowitworks.Negativevaluesmakethetintingstrongerandcolor
transitionsmoreextreme,whilepositivevaluesmakethefogsmootherandweaker.Useittogether
withfogmultipliertogettheeffectyouneed.

ThebiggestdrawbackoftheFogcoloristhatyoucannotuseamapinthisslot,thismeansyoucan
onlyuseasinglecolor.Ifyouwanttocreateastainedglassmaterialorglasswithmultiplecolors,you
willhavetodothatbyusingtheRefractcolorandnottheFog.Itis,however,greatforthosesingle
coloredmaterialsandmuchmorerealisticthansimplychangingtheRefractcolor.
VRay2.0introducedthelongawaitedDispersionfeatureforrefractivematerials,until2.0youhadto
useafakemethodofblendingmultiplematerialswithdifferentRefractcolorsandIOR.Nowyoucan
simpleactivatetheDispersionandchangethestrengthwithAbbenumber.Smallervaluesmakesthe
dispersionsstronger,whilelargernumbersmakesthemmoresubtle.Useyourownartisticeyeto
figureouthowmuchdispersionsyouneed.YouwillhavetoincreasetheRefractSubdivsforanice
result(withthedefaultvaluematerialshaveagreentint),evenifyouarenotusingglossyrefractions.
Dispersionalsoincreasestherendertime.

9|P a g e

NextsectionisTranslucency,butwearegoingtoskipit,asIprefertouseVRayFastSSS2materialfor
translucentobjects.Itoffersmuchgreaterspeedandflexibility.
LetslookattheBRDFsection.

FirstistheBRDFmodel.Thisparameteraffectshowthespecularhighlightsofthematerialare
calculated.VRayoffers3options:Phong,BlinnandWard.Phonghasthesharpesthighlights,Blinnisa
bitmoreblurredandWardisevensofter.Blinnisthedefaultvalueanditisfineformostmaterials,
formetalsyouwillwanttousetheWardmodel.

Anisotropyallowsyoutocreatestretchedhighlights.Inrealworldthesearemostcommonlyseenon
brushedmetalsurfaceswithlong,parallelscratches.Anisotropyallowsyoutofakethisbystretching
androtatingthehighlightsasyoulike.
ThisexampleshowshowchangingtheAnisotropyvaluechangesthespeculars.Negativevalues
stretchthemhighlightshorizontallywhilepositivevaluesstretchthemvertically.

Youcanalsochangetheanglemanuallytoanyvalueyouneed.Hereisanexamplewithstretching
rotatedat45degrees.
10|P a g e

Andfinallyyoucanchangethereferenceaxisforevenmorecontrol.

NextcomestheMapssectionofthematerial.Thisisaconvenientlistofalltheslotsyoucanassign
bitmapsorproceduralmapsto.

Therearesomeimportantpropertiesofthematerialthatcanonlybeaccessedthroughthissection.
TheseareBump,DisplaceandOpacity.
LetslookattheBumpandDisplaceslotsfirst.
11|P a g e

Bothoftheseslotsallowyoutoassignabitmaporproceduralmaptosimulateunevennessand
deformationoftheobjectssurface.Bumpdoessowithoutchangingtheoverallgeometryofthe
object,butDisplaceactuallysubdividesanddeformstheobjectduringrendering.Thedeformations
worklikethismiddlegrey[128;128;128]ofthemapdoesnotchangeanythingontheobject,darker
valuespushthesurfaceinwardswhilelightervaluespullitout.Thefurtherthisvalueisfrommedium
gray,thestrongeristheeffect.Colorofthemapisnottakenintoaccountandonlythelightness
valueisused.
BumpisfastandDisplaceisslow.
Ifyouneedlarge,realisticdeformations,youshouldusedisplacement,whilebumpisperfectfor
smallerthingsthatdontchangetheobjectsoutline.Lookattheexamplestoseethedifference.

LastmapwearegoingtolookatistheOpacitymap.Itworksverysimple.Purewhitevalueisusedfor
thenontransparentpartsofthematerialandpureblackisforcompletelyinvisiblepartsofthe
material,everythinginbetweenismoreorlesshalftransparent.Itisgreatifyouneedtosimulate
stuffliketreeleavesorlacefabricwithoutusingalargeamountofpolygons.Hereisanexample
usingthesamemapasintheBumpsamples.

ThetwonextsegmentsofVRayMtlareReflectInterpolationandRefractInterpolation.Theyare
supposedtobeaquickerwayforcalculatingblurredreflectionsandrefractions,butIwillnotbe
coveringthose,asIhaveoftenfoundtroubleshootingtheissues/glitchesthatcanappearfromthem
takelongertimethanrenderingnoninterpolatedmaterials.
12|P a g e

ThiswrapsupthebasicVRayMtl,italreadyallowsyoutocreate90%ofthematerialsyouwill
encounterinyourwork.Thereare,however,somespecialcaseswhereothermaterialsarebetter
suited.
LetslookattheVRayBlendMtl.Itistheperfecttoolformakingcompoundmaterials.Forexample,if
youneedtocreateablack,shinysurfacewithblurredgoldspots,itiswayeasiertocreatetwo
materialsandblendthemtogetherthanhandpaintingallthedifferentmapsyouwouldneedto
achievethiseffectinasingleVRayMtl.
TheVRayBlendMtlworkswithalayerlikesystem.
ThereisaBasematerialtowhichyoucanapplymultipleCoatmaterials.Youcancontrolhowmuchof
thecoatmaterialisappliedbyusingBlendAmountcolor,BitmaporProceduralmap.Purewhite
blendcolorshowsonlythecoatmaterial,mediumgrayshows50%ofthecoatmaterialand50%of
thebasematerialandfinallypureblackdoesntshowanycoatmaterialatall.

HereisthesameblendmaterialwithblackandwhitecheckermapintheBlendAmountslot.

Eachnextcoatlayertreatseverythingaboveitasasinglematerial,ifyouhaveabasematerialand2
coatmaterialsat50%,theresultis0.5(0.5base+0.5_1st_coat)+0.5_2nd_coat.
InthisexampleIveaddedasecondcoatlayerwithpuregreendiffusecolor,ifall3partswouldbe
usedequally,theresultingcolorshouldbewhite(RGBatequalvaluesresultingrayscalecolor),butit
isinsteada50/50mixofpurpleandgreen.
13|P a g e

Youcanuseupto10materialinablend(ifyouthencreateanewVRayBlendMtlandkeepthefilled
oneassubmaterial,youcanadd9morematerials,repeatingthisproceduregivesyouunlimited
amountofslots).Hereisasomewhatmorecomplexexampleofa4materialblend.

IamsureyounowseethepotentialofVRayBlendMtl.Iwillshowyousomepracticalexampleson
howtouseitinthevideos.
LetsmoveontothenextmaterialtypeVRayFastSSS2.ThelettersSSSstandforSubSurface
Scattering,anothercommonnameisTranslucency.Thiseffecthappenswhenlightraysdontgo
straightthroughtheobject,butarescatteredinmultipledirectionswheninside,thisdoesnotallow
youtoseethroughtheobject,butyoucanseethelightinsideit.Unlikerefractionglossinesswhich
scatterslightraysatthesurface,SSSdoesthisinsidetheobject.Thismakessomeinterestinglighting
effects,thelightpenetratestheobjectandlightsitfromwithin.Somerealworldexamplesare:flesh,
milk,marble,jade,fruit,waxetc.LookatthesephotostoseewhatImtalkingabout.

VRayfastSSS2isperfectforthistypeofmaterials.
14|P a g e

Myexamplesceneforthissectionhasjustonelightbehindheobjecttoillustratethessseffects
better.
ComparetheVRaymtlandVRayfastSSS2.Noticehowtheregularmaterialdoesntletanylightin,only
bouncesitoffthesurfacewhileVRayfastSSS2ismoreilluminated.Theeffectisverysubtlethough.

Theeasiestwaytoincreasethetranslucencyeffect,isbyincreasingtheScalesetting.Thelargerthe
Scale,thedeeperlightgoesintotheobject.

Nextparameter,SSSprepass,controlstheaccuracyofthescatteredlight.Lowervaluesgiveblurrier
results,whilehighervaluesgiveamorepreciserendering,theprecisioncomeswithanincreased
rendertime.Forproductionrenders,Isuggestusingvaluesof1to1.

FastSSSallowsyoutosettheIORaswell.Mostwaterbasedmaterialslikeskin,milk,juice,plants
haveIORof~1.3,forstonetypematerials1.51.7ismoresuitable.
Youcanalsousethebuiltinpresetstoquicklycreatesomecommonmaterials,theseare:
Skin(brown)
Skin(pink)
Skin(yellow)
Milk(skimmed)
Milk(whole)
Marble(white)
Ketchup
Cream
Potato
15|P a g e

Spectralon
Water(clear)
Ifnoneofthepresetsfits,youcancreatethematerialyourself.
Letslookatthesettings.
FirstistheOverallcolor.Thiscolorallowsyoutochangethecolorofthewholematerial(thesurface
andtheinside).
LookattheexamplestoseehowthiscolorchangesthelookofthedefaultVRayfastSSS2material.

NextistheDiffusecolorandSubSurfacecolor.Firstonecontrolstheoutersurface,secondone
controlstheinsideoftheobject.ThisworkssomewhatdifferentthanVRaymtl.Bydefault,
VRayfastSSS2onlyusesthesubsurfacecolorandscattercolorasthemainsourcesofpigment.You
canassignadiffusecolorandincreasethediffuseamounttomixitwiththosetwocolors.Itisabit
hardtoexplain,Illshowyouanexample.HereIhaveassignedaRedDiffusecolorandaBluesub
surfacecolor.Withthedefaultsettingof0Diffuseisnotseenatall,whenIincreaseitto0.5itisa
50%mixwiththeblueandfinally,whenIsetitat1,thereisnomoretranslucencyandonlythered
diffusecolorisseen.

Ok,letslookattheScattercolornow.Thelightnessofthiscoloraffectshowstrongisthescattering
effect.Itgetsstrongerfromblacktowhite,asusual.
Imusingasimplegreymaterialwithredsubsurfacecolorinthisexample.

Youcanalsouseasaturatedcolorinthisslottogiveatinttotheobject.Itworksbestifyouusea
colorthatisclosetothesubsurfacecolor.Italsotintsintheoppositedirection,soundsweird,I
know.Whatitmeansisifyoursubsurfacecolorisredandyousetthescattercolorasorange,the
actualtintwillbetotheoppositedirectionofthehuescalepurple.Ifyouusepurple,thetintwillbe
16|P a g e

orange.Lookatthepicturestoseeitinaction.Theeffectissubtle,butsometimesitsjustwhatis
needed!

ScatterRadiusworksjustlikeScale,youcanincreasethedepthoftranslucencybyincreasingthis
value.
LetslookattheSpecularLayernow.
YoucanmaketheVRayfastSSS2materialreflectivebyenablingTraceReflectionsoption.Youcan
controlthelookofthehighlightsjustlikewiththeVRaymtlbychangingtheglossinessvalue.
Allthesesettingsglossiness,subdivs,reflectiondepthworkjustlikeinthebasicVRaymtl.

LetsmoveontotheOptionssection.
ThemainsettinghereyouneedtofocusyourattentionisSingleScattermode.
Thereare3possibilitiesyoushouldusedependingonthematerialyouaretryingtocreate.
Simplemodeisbestformaterialswherethelightdoesntgotoodeep,bestexamplesareskin,
plastic.
Refractivemodeisgreatformaterialsthatareverytranslucentbutatthesametimequiteopaque
(marble,milk)
Refractive(raytraced)modeisformoretransparentmaterials,thisalsocreatesnicerefractionsand
transparentshadows.Useitformaterialslikeglass,water,crystals.

Forthebestresults,turnFrontlighting,BacklightingandScatterGIon.

17|P a g e

Вам также может понравиться