Sei sulla pagina 1di 1

Mental ray rendering optimisation

by Christoph Schinko

What is rendering? Rendering is the calculation of your scene in Softimages internal 3-dimensional space. For this procedure the render engine sends out rays from where the camera is positioned. The rays tra el straight from the camera centre into soft space until they hit a triangle !ob"ects get di ided into triangles -# tessellation$. %f there is no ob"ect in that direction& the ray would keep going fore er and Softimage would end up with infinite recursion. To pre ent that& a process called subdividing is started in which the renderer sets borders around your scene& in the form of a bo'. This bo' will be cut in half& first in '& then in y and (. Those ) bo'es get cut in half again in the same order. Softimage continues subdi iding until certain alues are reached. Those alues are specified in the BSP tree !binary space partitioning$ and determine when Softimage has to stop subdi iding. %n mental ray there are two alues called *Max depth+ and *Max size+. Max depth is the maximum amount of subdivisions before Softimage stops splitting a bo' and mo es on to the ne't one. Max size sets the maximum size of a leaf that is in a bo'. %f the leaf is smaller than the alue& this bo' wont be subdi ided anymore. ,e can manipulate the -S. tree settings in Render -> Options to decrease the rendering time& because the bo'es dont ha e to be ery small when theres nothing in them. This is the last fine tuning for mental ray !mr$ / rendering optimisation. 0owe er& there are many things to do before you get acceptable rendering times !theyre ne er *great+& they always could be faster$.

How to optimise a scene


1eometry
Cutting down on geometry is the most important part of optimising a scene. %f ob"ects are modelled in more detail than necessary& go in and delete rows in 2 and 3 !Edit -> Delete Point$& but make sure that the 4uality of the render is still good. 1o into Info -> Selection for e ery ob"ect and cut down the steps as far as possible. %f an ob"ect does not cast shadows& turn off Shadow under Info -> Selection -> Render Setup and is it not reflecti e or refracti e& also turn off Secondary rays. %f you take off Primary rays& the ob"ect does not show up when rendering& because it does not get hit by the !primary$ ray from the camera.

Schematics

Clean your schematics window5 % know its a pain& but go in and delete all the stuff that you dont need anymore. 6ld splines& paths& ob"ects& hidden stuff& materials& te'tures& lights&7 e erything that wont affect your rendering. 8ake sure you show all relations !light& model& motion& matter$ in the schematics iew in order to see what is connected to an ob"ect that you might still need. Remember that lots of constraints& e'pressions and so on slow down the pre-processing stage.

8aterials
Try to a oid a lot of reflecti e and refracti e materials. 9 reflection faked by a reflection map looks pretty much the same and brings down rendering time. 0it Mat Oper -> Optimise all to pre ent materials with the same settings from e'isting more than once !watch for local te'tures5$

Te'tures

Te'tures& :; and 3;& slow down rendering a lot. 1o into .hotoshop and cut down the image size of your te'ture images< always test render to check if you still ha e the same 4uality. -e careful with bump-& reflection-& transparency- and especially displacement mapping. They can destroy your rendering dreams "ust like that5 9lso before you render& delete all the temp files on your machine. 2nder c !temp& throw away all= Temporary files !>.tmp$ .re iew-picture files !C?@A.B@@.pic& C?C.3A@.pic&7$ and Crash-backup folders !siD6-E& siD6-:&7$. %f you ha e access& clean up your hard dri e to get more room. ?mpty your recycling bin and defragment your hard drive. %t takes a while longer to read the te'ture pic-files when they are fragmented all o er the hard disk. Then restart Softimage !and e en your computer$ and render your scene.

Fights
%f a light doesnt reach all ob"ects in the scene make it selective& so the light is not being calculated where it is black anyway. Try to a oid area lights. The gi e ery nice results& but take fore er to render. 9lso use ray trace on a minimum amount of lights to get faster renders.

Camera

2nder Camera -> Settings you can specify the near" and far plane of the camera. That gi es you control o er where Softimage starts and stops ray tracing. The near plane is the distance from the camera to where the scene starts being isible& measured in Softimage units. The far plane specifies how far away to kill the Gshot-out ray. That way ob"ects in the back& that would not be isible anyways are not being rendered at all. Hou can measure the desired distances with Info -> Distance. %n the status line !where you can also access the status file$& Softimage tells you how to use this tool. 8iddle click on the start point !camera&7$ then middle click and hold down the mouse button to see the distance in Softimage units on the bottom of the screen.

Rendering in Fayers
%f you ha e a volumetric light in your scene& render in layers. Set up a separate scene only with the olumetric light and the ob"ects that are interacting with it& and composite that into your scene. Same goes for shadows. Set up a shadow pass& so you can render your scene without them. ,orks really well and gi es a lot more control o er the intensity of the shadows. Rendering in different layers is also the way the Gbig boys and their companies are going. For how to set up a shadow pass& ask for the *0ow to render a shadow pass for Composer+ tutorial by Ioel ,right.

#ender settings

ig! "# Render Setup @. Se4uence Hou know what to do. Set start& end frame and the steps the se4uence shall be rendered in. :. 1lobal switches 8ake sure your $lo%al Switches are set properly5 Try to render your main scene without reflections& refractions or shadows and composite them on later from different passes.

ig! &# $lo%al switches 3. Render Sub region allows you to render only a certain area of your camera iew. Hou dont need that now. J. Resolution The simplest way of cutting down rendering time is make the picture smaller. %f you change the aspect ratio under Camera -> Picture ormat& you can sa e o er :AA lines per frame to render5 9nd you get professional looking Gwide screen-bars on the top and bottom of your screen. %ts easy to do and it looks cool. % am working with resolutions like C:A'3)E or C:A'3J:. %f your camera angle is already set& that might not be a good idea& because stuff on top and bottom of the screen gets cut off and more stuff on the left and right is shown. B. Settings B.@. 9nti-aliasing 9nother ery important step to the final render is to decide which anti-aliasing settings to use. 9 final render should ne er be rendered without anti-aliasing& it "ust adds so much to the look. 6f course it can make rendering hell& but with the right settings you can get a pretty good 4uality-time deal. %t really depends on the scene but for most % would suggest to go with minKma' samples of /: and :& a gaussian filter with : and : and adapti e super sampling of A.:& A.: and A.:. %f you are interested in the different filters and their settings& please refer to the Softimage 3; Rendering 8anual or ask ;on ,ilder for the statistics he wrote.

ig! '# mental ray anti-aliasing B.:. Field rendering is used to eliminate strobing in fast motions. Renders two images per frame. 9n odd and an e(en picture. Softimage needs you to specify with which one to start with& because that depends on the T3-picture system !.9F& ITSC$. Starts with $%% for &'S(5 B.3. ;ithering ;oesnt really add rendering time and gi es a ery settle but neat effect. % always ha e it on. B.J. 8otion blur %f you are using motion blur !mb$& blur it from the command prompt. The mb-standalone is only two dimensional& it does not blur rotations or complicated mo ement. %f that is not enough for your pro"ect& consider compositing the blurred ob"ects into your scene in post production. 8otion blur in Softimage is so sloooww. L. Scripts 9llows you to run c-shell scripts either before or after rendering. C. 6utput %mage Specify the database you want to render in& the se4uence name and the file format !usually pic$.

#ender ") $ptions


1etting closer to the end.

ig! )# mental ray options

$ptimisation
@. Face Check front if you want to render only the triangles that face towards the camera& back if triangle normals face away from the camera and you want to render only those& or both if you want all sides of triangles to be calculated. :. Render .arameters *race turns ray tracing on and off. %f you do not ha e any reflections& refractions&7 in your scene& take off ray tracing to render really fast. %n order to calculate shadows *race has to be turned on< shadows are ray traced. !Transparency is not55$ 3. Ray depth The standard settings are usually fine here. Ray ;epth determines how often a ray can get reflected or refracted. %f you ha e two reflecti e spheres opposite to each other& rays would shoot back and forth between them to calculate a reflection of the sphere in the reflection of the sphere in the picture of the sphere. The higher the number& the slower is rendering. J. 9cceleration 8ethod 6k& thats actually the final touch for rendering optimisation5 Iow& there are two different acceleration methods= #ay (lassification and BSP tree -S. tree is default setting and in most cases it works faster than ray classification. 9ccording to 8icrosoft Softimage& ray classification gi es better results for scene hea ier than *++,+++ - *.+,+++ triangles on machines with a low amount of #/M. 3ia ray classification options you can specify how mental ray uses the R98 a ailable to pre ent paging onto the hard dri e& which slows down the process a lot. 0owe er& % tried ray classifications and although my e'ample scene had 3LA.AAA triangles& it was ne er faster than rendering with -S. tree. % suggest to stick with the -S. tree& its complicated enough anyways. BSP tree gi es two settings to ad"ust. Max %epth and Max Size. ,e heard before that those alues tell the mr renderer when to stop subdi iding the scene !splitting it into bo'es$. 8a' depth and 8a' si(e are sort of dependent upon each other& if you change one alue the other alue shifts to somewhere else. That makes it kind of hard to figure out the e'act settings. ,here er you look for information on mr render optimisation& e erybody will tell you that its more of an art than a science. There is no rule or e'act way to get faster rendering times. % read an interesting method of how to get optimum results= Click on erbose in the Render -> Options dialogue bo'. Set your -S. tree to something like LA and L& render a frame. ,hen the render e'its out to the Softimage 2%& click on Mode on the ery bottom of the screen& the status line. This opens up a iewer for the Softimage status file which contains detailed information of effects& error messages& rendering&7 The file soft!status is usually found under C=Mtemp or other temp directories. %f it gets too big and you dont ha e access to delete it& "ust open it up from an IT-?'plorer& cut out all the te't stuff and re-sa e the empty file. That makes it a little bit easier to find what youre looking for back in Softimage. Sometimes& when you scroll down in the status file and you drag the little bo' instead of pushing the arrows& it does not always scroll to the ery bottom of the file. %n order to do that& use the arrows. Ma+ si,e= 6k& now the alue search begins. -efore rendering& in the pre-processing stage& you get a alue for the si(e of the largest leaf node. !write it down$ Then you see percentage alues which show the progression of the render. 9fter that& there is 9 number of candidate triangles per ray. !write it down$ The techni4ue says that if those alues are larger than @A& you ha e to increase the max depth of your -S. tree. Then you can make the max size smaller. That would cause the renderer to di ide the scene up into more bo'es& which increases pre-processing time& but the smaller lea es are faster to render. So you already see& that it is tough. Ma+ depth= Set ma' tree depth to a large number& like BA. Start rendering a frame& but cancel as soon as Soft is rendering on the screen. 1o into the status file and Check out the num%er of lea(es. !write it down$ Set ma' depth to a smaller alue and do the same thing again. Deep doing that& and at a certain ma' tree depth the number of lea es should decrease drastically. Take that alue you used N@ to get the optimum setting for ma' depth. Thats the theory. %t unfortunately didnt work for me. The si,e of the largest leaf node and num%er of candidate triangles per ray stayed the same or increased and were nowhere near @A !see fig. B$. 9nd the number of lea es increased instead of decreased. So& thats my method= % used ;a id -la(etichs final pro"ect as e'ample scene. 0eres the Info -> Scene alues "ust for information. 3L3.J3E triangles& LB: models& JJL materials& JE: te'tures& )J pictures& LJ lights global settings= Te'tures :;& Reflections& Shadows resolution= C:A'3J:& no anti-aliasing Render time for one frame when % got the scene= @=JB Render time for one frame now= A=BE ,hen % got the scene& the alues for ma' depth and ma' si(e were LA and L. 9ll % did was render a frame& time it& write down pre-processing and rendering time. Set the depth alue lower and rendered again. 0eres a table of this procedure=

ig! -# ta%le of .SP tree optimisation % simply interpolated the ma' depth until % got the fastest setting. Changing the ma' si(e did not really bring too much. 9nyway& try it out5 .lay around with it& ha e fun and % hope % could help a little. %f something is missing or wrong on these pages& please let me know& this is "ust an o er iew of what % found out. For more confusing information refer to the Softimage 3; Rendering 8anual. Ouestions or suggestionsP .lease e-mail me under stophQchristoph-schinko.com ,ritten AEKE) by Christoph Schinko& teaching assistant at 3ancou er Film School. Iote= the e-mail address has been updated. 9lso& the pictures had to be re-inserted. Therefore the pictures show Softimage 3; 3.E.

0lossary
9rea light - mr feature< light source that emits light from a surface instead of a point< ery nice results& but long rendering times -sp tree - acceleration method ;efragmentation - mo ing clusters !little parts$ on the hard dri e to ha e all clusters of a file in a continuous order ;isplacement mapping - mr feature< takes a bump map and con erts the actual geometry to it Feaf - stuff 8a' depth - the ma'imum amount of how often a bo' can be subdi ided 8a' si(e - the ma'imum amount of lea es in a bo' before mr stops subdi iding 8ental ray - high-end render engine for photo realistic results< thanks to the open architecture mr can communicate with custom written shaders mr - mental ray .re-processing - calculations before the rendering starts< subdi iding scene& loading in pic files for te'tures& starting shader routines&7 Radiosity - render type< each triangle gets alues for how it is affected by all lights& the render is not camera dependent< once the scene is calculated& you can mo e freely in it. -eautiful results& but e'tremely slow rendering Ray classification - acceleration method to render large scenes< good control o er memory usage Ray tracing - render type< shooting out rays from the camera and following their path as they hit ob"ects& bounce off them !reflection$ or pass through then !transparency& refraction$ Renderer - engine that subdi ides and renders the scene Shadow pass - separate sub-scene< containing only ob"ects that cast and recei e shadows -# render only shows shadows -# compositing Subdi iding - pre-processing stage< putting a bo' around the scene and splitting it up into smaller bo'es until -S. tree tells it to stop Tessellation - splitting up surfaces into triangles !with 3 corners$ for rendering 2% - user interface 3olumetric light pass - separate sub-scene< containing only the olumetric light and the ob"ects it affects -# compositing 3olumetric light - mr feature< spot light where the light cone is isible !beams& smoke&7$

Potrebbero piacerti anche