You are on page 1of 35

mentalrayin3dsMaxDesignforAECrenderings 1

TheBasics
Materials
RecommendedMaterialTypes
Theflexibilityofmentalrayandtheevolutionof3dsMaxand3dsMaxDesigncreatedsomeconfusionaroundwhich
materialshouldbeusedwithmentalray.Hereismyadvice:for99%oftheAECrenderingworkflows,youwillwantto
usetheA&DmaterialortheProMaterials(ProMaterialsaresimplifiedinterfacesdrivingtheA&Dmaterialunderthe
hood).
Theothermaterialswillwork,buttheA&Dmaterialcontainsmentalrayspecificoptimizationsthatwillguaranteespeed
andqualityover,forexample,thetraditionalStandardmaterialorthelegacyArchitecturalmaterial.
TheA&DMaterialfunctionalityisdescribedindetailshere:
http://www.mentalimages.com/fileadmin/user_upload/PDF/arch_and_design.pdf

ThehighlightsmaterialsaretherecommendedmaterialstouseforyourAECrenderings..Right:ProMaterialWallPaint,Wood,
ConcreteandCeramicatworks.(Models:MaximilianTarpini)


SubtlereflectionsonWallPaint
automaticallycreatedbythe
ProMaterials
mentalrayin3dsMaxDesignforAECrenderings 2

LightsandShadows
UnitsandScale
Physicallybasedlightingcomputationimpliesthatlightattenuatesusingtheinversesquarefallofflaw,whichsimply
meanstheintensityoflightdeclinesexponentiallywiththedistanceittravels.Therefore,itiscrucialthatthescaleofyour
scenecorrespondstorealworlddataotherwisetheresultswillgetcorrupted.
Acommonmistakeforexample,istoimportanairportatthesizeofashoeboxoraroomatthesizeofastadium.Inone
case,thelightingcomputationwillbetoobright,andintheothercase,itwillbetoodark.
Toverifyyourscalesettings,checktheSystemUnitScalesettingsintheCustomize|UnitsSetup|SystemUnitSetup
dialogbox:

SystemUnitsSetupof3dsMaxDesign
RecommendedLightTypes
TherecommendedlighttypearethePhotometriclightsandthemrSunandmrSky.Theysimulaterealworldvaluesand
playnicewithindirectilluminationcomputationsandcameraexposure.


mentalrayin3dsMaxDesignforAECrenderings 3

RecommendedShadowSettings
Therecommendedshadowtypefortypicalarchitecturalrenderingin3dsMaxDesignistheRayTracedShadowtype.
Whilethismightnothavebeentrueinthepast,raytracedshadowsarefastertocomputethanshadowmaps,less
memoryintensiveandhandletransparencybetter.Thisisusedbydefaultin3dsMaxDesign2010butnotin3dsMax
2010.

ExposureControl
RecommendedExposureControlSettings:
TherecommendedExposureControlplugintouseisthemrPhotographicExposureControl.Itisdesignedtomimicreal
worldcamerasettingsandassumesthatthesceneenvironmentisphysicallybasedaswell(Sun,Sky,Photometriclights,
properscaleetc.).

ThemrPhotographicExposureControlisrecommended.
Conclusions/RecapontheBasics:
1. UseanA&DMaterialorProMaterialsonallobjects.
2. UsemrSunandmrSky,PhotometricLightsandRaytracedShadows.
3. UsethemrPhotographicExposureControl.
mentalrayin3dsMaxDesignforAECrenderings 4

Simplifiedmentalrayrenderpanel
Scene:00_global.knobs.basics.max
ThesimplifiedmentalrayrenderpanelismeanttoreducethelearningcurveforRevitusersandacceleratetestrenders
byprovidingyoufinetuningknobsforShadows,ReflectionsandRefractions:

GlossyRefraction
GlossyReflection
SoftShadow
EdgeAntialiasing
LaunchtheExposureControlPanel
Enable/DisableIndirectIllumination
CacheIndirectIlluminationtoDisk
mentalrayin3dsMaxDesignforAECrenderings 5

ExteriorDaytimeRendering
Scene:01_exterior_rendering.max
DaylightSystem
TheDaylightSystemof3dsMaxDesignregroups2lightsourcesinthesameuserinterface:theSunandtheSky.Their
intensityandcolorsareruledbytheirorientationinthe3Dspace,whichisaffectedbytheTimeandPositiononEarth.
ThebluebackgroundishandledbyaspecialshaderthatmustbeassignedintheEnvironmentmap:
1. CreateaDaylightSystem;makesureitusesthemrSunandmrSkypluginsandsettheTimeandDate.
2. EnablethemrPhotographicExposureControlandusetheExteriorDaytimepreset.
3. AssignamrPhysicalSkyshaderintheenvironmentMapslot:thiswilladdthenicebluebackground:

4. TurnONfinalgather:thiswillcreatetheindirectilluminationeffectandbecometheSkylight.
5. Render:youshouldgetsomethinglikethisalready:

(AllModelsinthisdocumentbasedonanoriginalfilefrom:(c)2007ElectricGobo/Karcher,www.electricgobo.com)

DirectilluminationfromthemrSunlightobject
SkydomecontributioncomesfromthemrSky
lightobject+FinalGather
BackgroundskycomesfromthemrPhysicalSky
environmentshader.
mentalrayin3dsMaxDesignforAECrenderings 6

Addingcloudsinthesky
ThemrPhysicalSkyshaderhastheabilitytochangecolorandaffecttheappearanceoftheSunDiskwiththehaze
parameter.Thisparameterismapablesoitmakesanexcellenthomeforcloudmaps:
1. AddaskyimageintheHazemapofthemrPhysicalSky.Dontforgettousetheproperprojection(Screen
orSphericalforexample)
2. IncreasetheOutputValueto~8toseetheeffect:thiswilldrivethehazevalueoftheSkybasedonthe
image.
3. Render:thecloudsnowappearontopofthecloud.Theyalsochangecolorbasedonthetimeoftheday.



AHazemapmustprovidevaluesfromarangeto0to~8tobe
effective,hencetheboostdonewiththeOutputAmount.
Acloudimage(asimplephoto)modulatesthevalueofthe
HazeparameteroftheproceduralmrPhysicalSky
mentalrayin3dsMaxDesignforAECrenderings 7

GlareShader(Bloom)
TheGlareShaderiswhatweknowasanOutputShader.Outputshadersareprocessedontopofthefinalimage,asa
postprocessingstep.TheycanbeassignedintheRenderSetupdialog.
1. AddaGlareshaderintheCameraEffects|OutputslotoftheRendererTab(RenderSetupdialog)and
instanceitintheMaterialEditor:


2. IncreasethecontrastintheExposurecontroltolettheGlareshaderfindingthehotspots.
3. TheSpreadparameteristheonethataffectsthemosttheimage.
4. Render:youshouldseesomethinglikethis:

TheGlareShaderaddsthesmallsparktotheimage.

Glareshadereffect.Thestreakcomesfrom
theStreakimage.
mentalrayin3dsMaxDesignforAECrenderings 8

ExteriorDayTimeRenderingTipsandTricks
1. TheilluminationonthesurfacesisprovidedbytheSunandFinalGatherandnottheEnvironmentMap!
2. YoudonotneedmanyFinalGatherBouncestohaveameaningfuleffect:FinalGatherbouncesareusually
usefulforinteriors.
3. Thegroundhasaneffectonindirectillumination:ifyouuseaverybrightgreengrass,yourbuildingwill
probablyturngreenishaswell.
4. TogettheGlareshaderworking,youneedahighcontrastimage:theGlareshaderanalyzestherendered
imageandaddsthesparklestoit.Iftheimageistoofaint,boostitscontrastwiththeBurnparameter
oftheExposurecontrol.
5. UsetheExposurePreviewtoquicklypreviewtheimagesbrightness.


mentalrayin3dsMaxDesignforAECrenderings 9

InteriorDaytimeRendering
Scene:02_interior_rendering.max
SkyPortals+FinalGather&MultipleDiffuseBounces
Thestrategydoadoptwithinteriorrenderingsistoidentifywindowsandopeningswithaspeciallightobjectthatiscalled
aSkyPortal.Itsjobistofocusraysfromtheenvironmentthroughthewindowsandholesandavoidwastingalotof
renderingtimewithtraditionalFinalGathercomputation.
ThemrSkyPortalfunctionalityisdescribedindetailshere:
http://www.mentalimages.com/fileadmin/user_upload/PDF/arch_and_design.pdf

mrSkyPortalLightobjectpositionedinfrontofawindow,pointinginsidetheroom
1. OnceyouaresatisfiedwithanExteriorrendering,addaSkyportalinfrontofthewindowsofthebuilding.
2. Makesuretheirarrowpointinsidethespaceasillustrated:thisindicatesthedirectionofthelightflux.
3. Moveyourcamerainside.
4. ChangetheExposurecontroltoanInteriorRenderingpreset:thiswilladjusttheapertureofthecamera
tointeriorlightingconditions,whicharedarkerthanexteriorspaces.
5. IncreasetheFinalGatherdiffusebouncesto~34:thiswillbouncethelightaroundinsidethespace.

mentalrayin3dsMaxDesignforAECrenderings 10

6. Render:youshouldseesomethinglikethis:


FGbouncesdeterminesthenumberoftimelightwillbounceinsideyour
space.Avaluefrom3to5istypicallyrecommendedforinteriorspaces.
Lightingisonlyfromindirectillumination
bounces.
Exterioriswashedoutbecauseourexposure
controlisadjustedforinteriors.
Softandsubtledirectshadowsfrom
theskydomecomefromthemr
SkyPortallight
mentalrayin3dsMaxDesignforAECrenderings 11

InteriorDayTimeRenderingTipsandTricks
1. UsetheMaterialOverridefromtheRenderSetup|Processingtabtounderstandthelightingdistribution
ofyourspace.Thiswillallowyoutoseethelightingeffectsonaneutralcolorasopposedtobedistracted
byreflections,refractionsandtextures

Note,however,thatyouneedtotemporarilyhidetheglasspanesinyourwindows,asthismaterial
overridewillturnthemopaqueaswell,whichwillpreventthelightfromoutsidecominginside:

Aninteriorrenderingwiththematerialsoverriddenbyaneutraldiffusewhitematerial
2. CachetheFinalGathercomputationtodisk:onceitisbakedtodisk,youcanrerenderwithout
recalculatingindirectlighting(whichcanbetimeconsuming)duringmaterialtweaks.
3. Useverylowqualitysettingstotuneyourmaterials:therenderedimagewillbecompletedfaster.

Globaltuningknobsallowsforfastercontrolonallthescenematerialsandlightsforfastertuning.
4. TheShadowSamplesaffectsthequality(graininess)oftheshadowsfromtheSkyPortals.Itisalso
controlledbytheGlobalSoftShadowsPrecisionssliderintheRenderingpanel:


mentalrayin3dsMaxDesignforAECrenderings 12

AmbientOcclusion
Scene:03_ambient.occlusion.max
Ambientocclusionhasthebenefitofenhancingthesmalldetailsandcreateswhatwecommonlycallcontactshadows.
AmbientocclusionisenableddirectlyintheA&DandProMaterials.Typicallyyouwillwanttoenableitforfloors,door
framesandotherareaswithfinegeometricdetails.

WithoutAmbientOcclusion

WithAmbientOcclusion

Typically,lightleakagearisesduetolowdensityofFG
calculation.Objectsappeartobefloating.Ambient
Occlusionwillhelpsolvingthisissue.
WithAmbientOcclusion,edgesare visuallyenhanced.
Thelargerthedistanceis,themorepronouncedtheeffectwillbe.
Usually,youwanttouseadistanceof~10cm.
mentalrayin3dsMaxDesignforAECrenderings 13

InteriorNighttimeRendering
Scene:04_interior.rendering.photometric.lights.max
Photometriclights
WerecommendusingPhotometriclightsforinteriorrenderingsbecausetheirenergycomputationisphysicallybased,
whichmakesthemidealsourcesforindirectilluminationcalculations.Themainreasonforthisisthattheenergyusedin
theindirectilluminationprocesswillalwaysbeinbalancewiththeenergyusedforthedirectillumination.
1. StartwithanExposureControlpresetsetasfollow.Youwillreadjustlaterbutitsagoodstartingpoint:

2. CreatePhotometricLightsinthespace.Asareferenceherearetypicalintensitiescorrespondingtoreal
worldlightingvalues:
Class Wattage Type Intensity BeamAngle FieldAngle
Narrow 20W Spotlight 3300cd 6 12
Narrow 20W Spotlight 9150cd 12 25
Medium 50W Spotlight 3000cd 25 50
Wide 20W Spotlight 460cd 38 75
Wide 50W Spotlight 1500cd 38 75
3. TurnOFFFinalGatherandRender:youshouldgetsomethinglikethiswhereonlythedirectilluminationis
calculated:


Directlightingonly
mentalrayin3dsMaxDesignforAECrenderings 14

4. EnableFinalGather,with34Diffusebounces:

Indirectlightingwasbouncedfromthe
contributionofthedirectlights.
Thesplotchesarecausedbylow
qualityfinalgathersettings.Seethe
FineTuningIndirectlightingsection
formoretipsonhowtosolvethis.
WithabetterFGsolutionsplotches
disappear.SeetheFineTuning
Indirectlightingsectionformoretips
onhowtoachievethis.
mentalrayin3dsMaxDesignforAECrenderings 15

Glowandselfillumination
Scene:05_interior.rendering.photometric.lights_self.luminous.max
TheA&DmaterialexposesaSelfIlluminationfeaturethatallowsturningmaterialsintoalightsource.Thelighttransport
isdoneviaFinalGathersothequalityofitsshadowsdirectlydependsontheFinalGatheraccuracy.
1. EnableSelfIlluminationinagivenA&DMaterial.YoucandecideifthiscontributestoReflectionsand/or
IlluminationattheMateriallevel.IfyouuseatextureMap,thetexturewillmodulatethecolorofthe
emissivity:

2. TurnOffallthelightstoseeitseffectisolated.
3. Render:Youshouldgetsomethinglikethis:

SelfilluminatedmaterialwithcontributiontoFinalGatherrays.Nolightsusedinthescene.

AmapcanbeusedtosimulatevideowallsofLED
walls
Theintensityruleshowbrightitis.KeepinmindthatwithExposure
Controlenabled,youmayfindyourselfhavingtogotorelatively
highvalues.
Thisiswhereyoudecidetocontributetothescenelightingorto
reflections.
Finalgatherseestheluminoussurfaces.
mentalrayin3dsMaxDesignforAECrenderings 16

Photometriclightsturnedbackonwithacolorfilter.

mentalrayin3dsMaxDesignforAECrenderings 17

FineTuningIndirectlighting
Basicstrategy
TofinetuneaFinalGathersolutionwerecommendadoptingthefollowingstrategy:
1. BaketheFinalGathersolutiontodiskusingyournormallightingconditionssoyoucanreuseitlaterand
lockitinaReadOnlymode.
2. UseaMaterialOverridewithaDiffuseWhiteMaterial:lightingiseasiertovisualizeonaflatwhite
surface.SinceyoulockedtheFinalGathersolution,youdonthavetobotherabouttransparentobjects
anymore,exceptforthelightcomingfromoutsideyourbuilding(i/e/theSun).
3. RenderwiththeFinalGatherDiagnosticsMode(RenderSetupDialog|ProcessingTab)tovisualizethe
locationoftheFinalGatherpointscontainedintheFGMfile:

4. Finetunetheinterpolationsettings:theycanbechangedevenifyourFinalGathersolutionhasbeen
locked.

mentalrayin3dsMaxDesignforAECrenderings 18

Examples
TestA:LowDensity,LowInterpolation


Observations:
WecanseethatthedensityoftheFinalGatherpointsisrelativelylow.Thenoticeablecloudinessisvisiblemainlywhere
theFinalGatherpointsareseparatedeachotherbyalargedistance(wherethedensityislow).SincetheInterpolationis
alsolow,theresultisthecloudinesseffect.
Cloudyindirectlighting
Densityrelativelylow
mentalrayin3dsMaxDesignforAECrenderings 19

TestB:IncreasedInterpolation


Observations:
Here,wesimplyincreasedtheInterpolation.WeendupblendingmoreFinalGatherpointstogether,alittlebitlikea
Blurinanimage.TheFinalGatherpointsdensityisstillrelativelylowwhichdidnotincreasethecomputationtime.
Tip:
WhenaFinalGathersolutionislockedandreadfromdisk,youcanchangetheinterpolationbetweeneachrendering
withouthavingtorecalculatetheFinalGathersolution.
Byincreasingtheinterpolation,weblendmorepointstogether,
softeningthesolution.
Densitystillrelativelylow:noadditional
computationtime.
mentalrayin3dsMaxDesignforAECrenderings 20

TestC:IncreasedDensity

Observations:
IfwewheretoincreasethedensityofFinalGatherpointstocapturemoresubtlelighteffectsanddetails,the
Interpolationrequiredisnowlarger:aswehavemorepoints,weneedtoblendmorepointstogethertoreachasmooth
effect.NoticethecloudinesseffectappearingagainwhenweusedanInterpolationvalueof150.Tofixit,weneedto
increaseitupto450!
Note:
Thereasonforthenoiseisusuallycausedbythestochasticnature(randomness)ofFinalGather.Tosolveityoueither
havetocastmoreraysperFGpointsorincreasetheInterpolation.NotethattheInterpolationparameterisessentiallya
blurwhichcanremoveorreducetheeffectofsubtleshadows.


AnInterpolationvalueof~450isbetter:themoreFG
pointsyouhave,thelargertheinterpolationneedsto
be.
WithaverylargedensityofFGpoints,an
Interpolationvalueof150isnotenoughhere.A
largerInterpolationvalueisrequiredtosmoothout
theresults.
mentalrayin3dsMaxDesignforAECrenderings 21

NonPhotoRealRenderings(NPR)
Ink&PaintMaterial
Scene:06_NPR_InkPaint.max
TheInk&Paintmaterialgivesatoonlooktoobjects.Itcanrespondtolightingandshadowsorgiveacompletelyflat
appearance:

Ink&Paintmaterial
Tips:
1. ThePaintLevelsparameteroftheInk&PaintMaterialdeterminesthenumbersofgradientsyouwillget
onthematerialwithlightingandshadows.
2. Fortypicalcartoonlooks,disableExposureControl,FinalGatheranduseStandardLights.Physically
Basedfeaturesgenerallydontplaynicelywiththistypeofmaterial
3. ThequalityoftheInkwillimprovewithhigherantialiasing.
4. YoucanuseaFalloffMaptodrivethecoloroftheInkbasedondistance,directionetc.


mentalrayin3dsMaxDesignforAECrenderings 22

AmbientOcclusion&NPR
Scene:07_NPR_AmbientOcclusion.max
Often,itisusefultoquicklyrenderaseriesofdraftviewsofinteriorshotswithnomaterialssimplytoexplorecamera
views.ToaccomplishthisonetechniqueconsistsintousingAmbientOcclusionasawaytoilluminateascenetogeta
feelfortheoveralldepthofthespace:

SingleA&DMaterialwithanAmbientOcclusionShaderintheDiffuseColor

SingleInk&PaintMaterialwithanAmbientOcclusionShaderinthePaintColor
Tips:
1. AnAmbientOcclusionshaderdoesnotalwayshavetoreturnblackorwhite.Thelookabovewasachieved
byreturningadarkblueandpalebluecolor.

2. ThedistanceamountdetermineshowmuchAmbientOcclusionwilloccurattheedges.Trytokeepa
valuerelativelylow(i.e.~10centimetres)andincreaseasneeded.
3. CombineFalloffMapsandAmbientOcclusiontodevelopinterestinglooks:

OneoftheAmbientOcclusionscolorismodulatedbyaFalloffMap
mentalrayin3dsMaxDesignforAECrenderings 23

EliminatingIndirectIlluminationFlickering
Reference:3dsmax.2010.mental.ray.animation.flickering.explanation.movvideo
Scene:08.flickering.animation.reduction.max
Priorto3dsMaxDesign2010,animationflickeringwascausedbytwomainfactors:
WhentheFinalGatherpointsarenotlockedonthegeometry:theyslidealongthesurfacesastheCamera
move.
MovingobjectscreateFinalGatherpointsthatarefloatingorghostinginthe3Dspace,introducingrendering
glitches.
In3dsMaxDesign2010,indirectilluminationanimationflickeringiseliminatedbytwomaintechniques:
TohandleCameramovements,FinalGatherpointsareshotfromseverallocationsalongtheCamerapath.Final
Gatherbecomelockedonthegeometry,thusremovingtheslidingeffectofthosepointsacrossframes.This
iswhatwereferastheFGProjectionMode.
Tohandlemovingobjects,oneFinalGatherfileperframeisprocessedinafirstpass.Whenthebeautypassis
rendered,FinalGatherpointsareinterpolatedacrossmultipleframestosmoothoutthesolution.Thisiswhat
wereferastheFrameinterpolationforFinalGatherMaps.
FGProjectionModeTips:

1. TobeusedifyourCameraisanimated.Ifyourcameraisstatic,itwillnothelpatall.
2. WorksfortypicalheroshotswheretheCamerahasarelativelyslowmovement(apan,adollyin).Itwill
belesseffectivewithlongCameraFlythroughorfastcameramovements.

mentalrayin3dsMaxDesignforAECrenderings 24

FrameinterpolationforFinalGathermapsTips:
1. WorksonlyifyoubakeauniqueFinalGathermaptodiskperframeasafirstpass,whicharethenreadas
readonlymodeinasecondpass.
2. ThefirstfewframesandlastfewframesofyouranimationwillnotbeabletointerpolatetoFGfilesthat
aremissing(ex:frame0willexpectframes2and1tobepresent).Thereforeplantopadyourshots
withafewextraframesinthebeginningandintheend.
3. ThementalraymessagewindowwilldisplaywarningsaboutmissingFGmapsifany.
4. AsyouloadseveralFGmapsinmemory(oneperframetointerpolateacross),keepinmindthatyoualso
loadalotmoreFGpointstointerpolateacross.YouwillneedtoincreasetheInterpolationvaluebya
factorofmaybe3or5toreducethecloudinessthatmayappear.
5. YoucandefineabakeFGMapjobonanetworkfarmbyusingthefollowingcombinationofPassesor
Jobs:


Pass1:enablethistopreventthe
beautypassfrombeingrendered.
Youcanthensubmitthisasa
Backburnerjobandgetyournetwork
nodesbakingtodiskoneFGfileper
frame.
Pass1:enablethistosetFGtobein
writemode.
Pass2:turnthisofftogetthebeauty
passrendered.
Pass2:UsethisoptiontoturnFGina
ReadOnlymode.
mentalrayin3dsMaxDesignforAECrenderings 25

mrProxies
Proxiesarespecialobjectsthataredesignedtominimizetheloadontheviewporttomaintaininteractivityandaccelerate
thescenetranslationtomentalray.Theyarealsooptimizedtoreducetheoverallmemoryfootprintrequiredtorender
largescenescontainingmanyrepetitiveobjectswithmillionsofpolygons.Proxiesarebakedtodiskpriortobeusedby
mentalray.

Scenecapture:thetreesandthegrassareprebakedasproxies(imagecourtesyofDeltaTracing)

Finalimage(imagecourtesyofDeltaTracing)
ProxyWorkflow:
1. Youneedageometricobjectalreadyinthescene.
2. CreateanmrProxyprimitiveobject.
3. Assignittheobjectyouwanttobaketodiskandbakeit.
4. AssignamaterialtotheProxyobject(thematerialfromthebakedobjectwillnotcarrythrough).
ProxyTips:
1. Proxiesareworkingonasingleobjectbasisatatime.Ifyougroupedobjects,youwillstillneeda
differentproxyperobjectinsidetheGroup.
2. Usethemonhighpolycountobjects,typicallyentourageelementsthatyoudontneedtotouchsuchas
trees,cars,grass.
3. Forgrass,create23variationsofgrassclusters,bakethemtoproxiesandscatterthemrandomlyas
instances:fromthevisualpointofview,youwillperceivealargegrassfield.Fromtherendererpointof
view,itwillstillmean23objects...
4. UseaMultiMapmaptointroduceslightrandomvariationonrepetitiveobjects.
5. Manyproxiesinstancedinthescenecanhavetheirownmaterialformorevariations
6. Animatedobjects(deformingmeshes)canbebakedasaproxytoo!
mentalrayin3dsMaxDesignforAECrenderings 26

LinearColorWorkflow(Gamma)
Reference:3dsmax.2010.linear.workflow.movvideo
WhileGammaisnotthetopicofthispaper,knowingthatamaterialexpectslinearcolorsasinputmeansthatyouneed
tohandleGammapropertieswhichareusuallyembeddedinimagefiles.Itisimportantthatyoulinearizeorde
gammatexturesasinput.
GammaPipelineforTextureInput:
Typically,theGammapipelinefortextureinputworksasfollow:

ALowDynamicRangeImageisloadedfromdisk,Gammacorrected(linearized)priortobepassedtotheMaterial
GammaPipelineforRenderingOutput:
KnowingthattheRendereroperatesinlinearspace(Gamma1.0),therenderedimageneedstobeGammacorrected
(again)attheendpriortobesavedondiskordisplayedonscreen:

AnimageisrenderedinLinearSpace.Dependingonthetargetoutput,itisthenGammacorrected(LowDynamicRangeImages)or
not(HighDynamicRangeImages).

ImageFile(*.jpg)
(Gamma:2.2)
ImageisGamma
corrected
(DeGamma2.2)
BitmapMap
Material
(Materialseepixelsin
LinearSapce)
Renderer
(OperatesinLinear
Space)
FrameBuffer
(StillinLinearSpace)
ImageisGamma
corrected
(Gamma2.2)
DisplayDevice
(Gamma2.2)
LDRImagesavedtodisk
(Gamma2.2)
HDRImagesavedtodisk
directlywithout
corrections
(Gamma1.0)
mentalrayin3dsMaxDesignforAECrenderings 27

Gammaworkflowtips:
1. IfyousaveyourtexturesoutofPhotoshopwithasRGBcolorprofile,theclosestmatchingGammavalueis
2.2:sticktothisvalue.
2. Lowdynamicrangeimagessuchas*.jpgfilesneedtobeGammacorrectedoninputandoutput:when
loadingorsavingthemwith3dsMax,makesurethatyouloadthemwithaGammacorrectionof2.2as
well:

3. HighDynamicRangeImagesshouldalwaysbeloadedandsavedwithaGammaValueof1.0.Sincethey
areHDR,theconventionistoassumeisthattheyarealwaysinLinearSpace(Gamma1.0).


UsingtheSystemDefaultGammaoptionwilltake
thevaluefromthepreferencesdialog.The
recommendeddefaultvalueis2.2
mentalrayin3dsMaxDesignforAECrenderings 28

Additionaldocumentation
Thepresentdocumentisfarfrombeingacompletementalrayreference.However,Ihavecollectedafewinteresting
linksforyoutolookat..
AutodeskWhitePapersandFeatureVideos
RevittoMax,DaylightSimulationandAnalysisandmore
http://www.autodesk.com/3dsmaxdesignwhitepapers
Onlinefeaturevideos:
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=10371032
Mentalimagesdocumentation
A&Dmaterial,SunandSkyandmore
http://www.mentalimages.com/products/mentalray/documents.html
mentalrayblogs
http://mentalraytips.blogspot.com/
http://mrmaterials.com/jeffsblog.html


mentalrayin3dsMaxDesignforAECrenderings 29

Appendix
ExposureControl
WhatisExposureControl?
Physicallybasedrenderingrequiresexposurecontrol,alsocalledtonemapping.Tonemappingistheprocedureof
mappinganumericlightingintensityinHighDynamicRange(HDR)fromthesceneintoanRGBvalueofthepixelsinthe
renderedframe.
Physicallightintensitiesrangefromzerotonumbersapproachinginfinityinbrightsunlight.Therangeofcontrast
availableondisplaymonitorsislimitedcomparedtothisdynamicrange,andcommonimageformatsareevenmore
limited:JPEGimagesareeightbitimages,rangingfromavalueofzeroforblackto255forwhite.Inthesefiles,whitecan
onlybe255timesbrighterthanblack,afractionoftherangeintherealworld.Tonemappinghelpscompensateforthe
differenceinrange.
Hereareafewexamplesofreallifescenesmeasuredwithaluminancemeter:

Skyluminanceathorizonandzenith:2600cd/360cd/m2.Luminanceontheleaves:500cd/m2.

Moonlitbackyard,luminanceontheroofofthegarage:0.22cd/m2.Kidsplaysetluminance(brightest):0.1cd/m2.
mentalrayin3dsMaxDesignforAECrenderings 30

Assumingthattherenderingenginecanuserealworldunitsforlightsources(lumens,candela,orluxatdistance)and
realworldunitsformaterials(reflectance),theresultingimageswillbebeyondtherangeofwhatamonitorcandisplay.
Therefore,itsnecessarytocompressthecalculatedimage(rangingfromzerotoinfinity)intoadisplayableimage(ranging
fromzeroto255).Thisprocessiscalledtonemappingorexposure.
Toenableexposurecontrolin3dsMaxDesign,usetheEnvironmentandEffectsdialogbox:

ExposureControlRolloutin3dsmaxDesign
Whenyouchangethebrightnessandcontrastcontrols,thelightlevelsofyourscenedontchange;onlythesensitivityof
yourcameradoes.Thisisfarbetterthanadjustingeachlightsourceinasceneonebyone.Ifyouwanttoshootaphoto,
youwouldbemorelikelytoadjustyourcamerasapertureorshutterspeedthanwaitforthesuntoset.Theexposure
controlscontrollightinthesameway.

Thetopimageisexposedtowardtheinsideoftheroom,andthebottomimageisexposedtowardtheoutercourtyard.Bothare
correctthelightlevelsinthescenedidnotchanged;thedirectionoftheexposureisuptoyou.(c)2007ElectricGobo/Karcher,
www.electricgobo.com

mentalrayin3dsMaxDesignforAECrenderings 31

Guidelinesforyourscenegeometry
Airtightmodels
Sometimes,youcanfindmodelswherewallsandwindowsorroofsdonttoucheachotherproperly.Thiscancause
lightingfromtheexteriorofyourbuildingtopenetratewithoutattenuation(fromglazingforexample)andintroduce
errorsinthelightinganalysisresults.

Windowspanesnottouchingthecurtainwallframe,lettingdirectsunraysinsidethemodelwillfalsifylightinganalysisresults.

Thisbuildingisnotairtight.Wecanclearlyseeaholeabovethewindowsundertheceiling.

mentalrayin3dsMaxDesignforAECrenderings 32

SmoothingAngles
All3Dgeometryincludingbothedgedobjectsandroundedformsismadeupofpolygons.Todisplaythemsmoothly,
3dsMaxinterpolatesbetweenthesurfacenormalstosimulatearoundedformandnotafacetedone.Whenimportinga
filefromanothercomputeraideddesign(CAD)or3DapplicationorwhenworkingwiththeEditPolymodifier,youmay
findthattheinformationaboutwhichnormalstosmoothbyinterpolationandwhichtokeepsharpedgedwithno
interpolationcansometimesgetlostorcorrupted.Insteadofreimportingafileoraskingyourclienttoresendit,trythe
Smoothmodifier.Inmostcases,theproblemsdisappear.

Thecubesfacesaresmoothedwithananglethatstoohigh,thespheresfaceswithananglethatstoolow.

Thisishowthecubeandthesphereshouldlookaccordingtosmoothinggroups.

mentalrayin3dsMaxDesignforAECrenderings 33

FlippedNormal
Renderingthefaceofageometricshaperequiresboththeverticesthatdefineitandinformationaboutitsorientation.
Thiscanbeseenasinformationaboutwhichisthefrontandwhichthebackoftheface,whichisdonebythesurface
normalaswell.Forrenderingandlightinganalysispurposes,thisiscriticalbecauselightenergywillbebouncedinthe
directionofthesurfacenormal.

Lightisbouncedfromthedirectionofsurfacenormals.Thisisacriticalaspecttounderstandforaccuratelightingcomputations.

WhenimportingamodelfromaCADpackage,youmayfindthatdirectioninformationforsomefacenormalsgetslost
orcorrupted.Usually,themodelingpackageinwhichthegeometrywascreatedmaynothaveprovidedthis
informationastheentitieswerecreated.UsethexViewfeaturetodisplaythefaceorientationin3dsMax2010.
Ifthereareonlyafewfaceswiththewrongorientation,youcanaddanEditPolymodifierin3dsMaxDesignanduse
Flipontheaffectedfaces.

Thegeometryisthesameasintheprecedingexample,butsomefacesareflippedsotheyappeartobeinvisible.Orientation
informationcanbelostorcorruptedduringimportbutusually,themodelingprogramdidnottakenthemintoaccount.
mentalrayin3dsMaxDesignforAECrenderings 34

PolygonCount
Itisgoodpracticetothinkabouthowmanypolygonsanobjectshouldconsistofbeforemodelingit.Thisistrueforall
geometricobjects,especiallycurvedandroundones.Eachfaceneedstoberendered,butusingmanypolygonsona
roundobjectcanquicklyadduptoinefficiencies,especiallyifobjectsarecopiedwithinthescene.Ontheotherhand,
usingtoofewpolygonsmakesanobjectappearsegmented.

Pickingapolygoncountthatistoolowforyourmodelgivesunsatisfactoryresultsforarchitecturalrendering.

Inthisexample,thebowlsappearanceisimprovedbecausetheshapeallowsforadditionalfaceswithoutdestroyingthebowlitself;
youcouldsimplyaddaTurboSmoothmodifier.


mentalrayin3dsMaxDesignforAECrenderings 35

UnweldedVertices
Insomecases,amodelmightlookasifitisclosed,butinsteadeachfaceisseparatedandtheverticesofneighbouring
facesareunweldedthatis,notconnected.Unweldedverticescanintroducemanyproblems,includinglargefilesizes
duetothousandsofunnecessaryvertices,damagetotheobjectwhenmovingfacesoralteringthemodel,andeven
problemswithpropersmoothingandnormalinterpolation,sincethefacesappearunconnectedto3dsMax.
IftheSmoothmodifierdoesntcorrectsmoothingproblems,checkforunweldedvertices.Toweldvertices,simplyadd
theWeldVerticesmodifierandchooseanappropriateradius.

Bothsphereslookthesame,buttherightonehasarowofunweldedvertices.Thiswastesmemory(forexample,instancingan
objectmanytimes)andmakesitdifficulttomodifygeometry.ProblemsappearwhenmovinghalfthefaceswithanEditPoly
modifier.Weldingtheverticescorrectsthelooseedges.

Undercertainlightconditionsyoucanevenseeunweldedverticesbystudyingarenderoftheobject.
OverlappingSurfaces
Watchoutforfacesthatoverlapprecisely.Therenderercannotdeterminewhichonetoputinfront,andablackpattern
artefactwillappear.Worse,inthecaseoflightinganalysis,youmayendupbouncingmoreenergythanreceived(double
theenergy)andgetwrongresults.
Overlappingfacescanbeintroducedbycarelessmodelingorbyimportingafile,suchasaCADfilewithversioned
geometryoverlappingpreciselyonseverallayersorbycreatingagroundplaneacrossyourentiremodelatthesamelevel
ofthefloorfinish.UsethexViewfeatureof3dsMax2010tospotthem.

Unlikeunweldedvertices,overlappingsurfacesareeasytospot.

You might also like