Archive for April, 2009

Mental Ray Memory Management

Saturday, April 18th, 2009

Memory management is often forgotten in today’s high speed multi core & high RAM systems, but it still plays a crucial role in the optimization of rendering 3D animations. It is a very important factor in the process of animation, especially with more complex lighting, material solutions and high poly scenes (inc. bump/displacement maps). Its something that isn’t easily approached by the casual 3d modeler/animator, but luckily, the Gnomon Maya Mental Ray Fundamentals educational DVD shed some light on some memory management methods and techniques, and now I’ll record them here for my own memory (and potentially your education! :D ).

What is BSP and how do I find out how it affects my scene?

The controls for Mental Ray’s memory management fall under something called BSP – Binary Space Partition. Basic explanation of BSP is the breaking up of the models polygons to be managed more efficiently by Maya’s render engine to optimize the RAM usage, therefore increasing efficiency on rendering and therefore SPEED. This alone is worth the effort to learn how to use the BSP settings to your advantage… Before you start tweaking with the BSP settings, you need to see how efficient your scene file is in the first place.

To do a diagnosis, jump into the mental ray settings in the render settings window, expand “Diagnostics” and change the dropdown box “Diagnose Bsp” from Off to Depth. Open up the Mental Ray Globals tab (type ‘select mentalrayGlobals;openAEWindow‘ in script editor and run the script), and change “Render Verbosity” dropdown to Progress Messages. This just ensures you get the correct feedback in the Output Window. Keep in mind that all of your output information will be displayed in the Output Window – for some reason I thought everything was displayed in the script editor, so be aware of this. You need to look for what is displayed below in the Output Window…

RCI 0.3 info : main bsp tree statistics:
RCI 0.3 info : max depth : 35
RCI 0.3 info : max leaf size : 7583
RCI 0.3 info : average depth : 21
RCI 0.3 info : average leaf size : 111
RCI 0.3 info : leafnodes : 3284
RCI 0.3 info : bsp size (Kb) : 865

This information will be what you will be basing your decisions and tweaks on. So now you know how to access your BSP statistics to tweak the settings, we can start tweaking and optimizing the memory usage for the scene. Just before we move on, the parts of the statistics shown that we will be focusing on with our tweaking is the average depth and average leaf size, this will be explained more in the next coming paragraphs.

Tweaking BSP Settings to decrease render times

You may ask: ‘how do I know if I need to tweak the BSP settings?’. My response is, it doesn’t harm to have a look at the settings already. The settings of the BSP can be found in the mental ray tab of the render settings under > Raytracing > Acceleration. To answer the question anyway, generally if the ‘average leaf size’ in the render output (as shown above) is much higher than the leaf size specified in the Acceleration (BSP settings) section, then tweaking will most likely be needed.

Generally, the lower the value of the BSP Size (leaf size), the faster the render will go. Although, this will mean that there is more memory usage, and it works vice versa (higher BSP size, slower render but less RAM use). If the average leaf size in the output window is relatively large, this is an indicator that the BSP depth in the render settings is too low. If the BSP depth value is too low, it will SLOW the render down. Be aware of this – try and increase the BSP depth and lower the BSP size (leaf size), for example if you were on 15 & 30, try 10 & 40 in the boxes and run the render again.

Be aware you will not notice any big differences on simple scenes!!

Keep playing with these settings and keep an eye on the render time displayed. There will come a point where there is no major change in render time taken, or that you are actually INCREASING render time. This is your indicator that you have reached the correct values, so revert back to the lowest render time values if the time does increase after new settings. Rough rule is: For small scenes, use BSP Depth of 30, medium scenes use BSP Depth of 40, and for large scenes use BSP Depth of 50-60. Example outputs which look better than previous outputs:

RCI 0.3 info : main bsp tree statistics:
RCI 0.3 info : max depth : 45
RCI 0.3 info : max leaf size : 3376
RCI 0.3 info : average depth : 40
RCI 0.3 info : average leaf size : 28
RCI 0.3 info : leafnodes : 29807
RCI 0.3 info : bsp size (Kb) : 311

The average leaf size is much smaller than before, therefore render speed is increased as the memory management is more efficient. This post may sound a little confusing but have a play with the settings, and watch the changes. Don’t forget once you have optimised the render times to turn off Diagnose BSP in Diagnostics in MR render settings. PLEASE MAKE SURE YOU CHECK THE RENDER TIMES OF THE ACTUAL FRAME. You may notice your BSP tweaks aren’t reflecting the render time of the actual image, so make sure you check all of the render times.

Last note – in the “Acceleration Method” in the Acceleration section of MR render settings, Regular BSP is used mostly for normal scenes, if you have intense scenes use Large BSP, it creates a larger BSP tree but will allow you to render extremely complex scenes.

Last tip is to make sure your Mental Ray is taking advantage of the most memory you can – Open mental ray globals (script editor code as before), expand Memory and Performance, and Memory Limits. Have a look at the physical memory in the box, and make sure it is taking advantage of the memory you have installed on your system. If you change the value to a higher value, make sure you leave at least 1 gig of RAM for the operating system. I have 8gb in my system, and the Physical Memory value written is 5821 – I’ll leave it as this as I do like to use other programs while rendering…

I will revisit this post with an extra couple of tips for memory management including the use of .map texture files. For now I’ll leave it here!!!

Good luck!

- Jarrad

Resources to enhance – explains graphically the job of BSP
http://toi.bk.tudelft.nl/toi-pedia/index.php?title=MR_Using_BSP_Diagnostics
http://www.animationxpress.com/anex/y2k8/headlines/anex3941.htm

Links, Inspiration and Ideas Part 2

Sunday, April 12th, 2009

More links that I have open on my firefox. Both inspiring and amazing in their own rights…

Videos

Whats in the Box?

The first video is a video by a student in a ‘half-life’ style theme. It is said the film test was done 100% from him, using a combination of 3d Studio Max, After FX, a Camera and a budget of 150 €. Time will tell if this is just a form of viral advertising for an upcomming game or something along these lines, but either way its a really impressive and inspiring piece of film work. The name of it is “Whats in the box?” and revolves around a box, and a world that appears to be affected by some extra terrestrial activity. Anyway, check it out good montage of awesome camera work, special effects, good storyline and good composition.



Steel Life

This is another student project – this time a Masters student study on visual effects mainly. Its very subjective about the meaning of the film, so I will not preach to you what it is about… It has some impressive effects, and montage to create an interesting array of visuals…


Steel Life from Mathieu Gérard on Vimeo.



No Fat Clips!!!

This final link is an aggregation of a lot of movies, short films and visual entertainment. Have yet to look at many movies on this website but it will sure be a good source of reference and inspiration.The no fat clips website can be found at: http://dekku.blogspot.com/

I’ll leave it there, as there is so much more to post (useless or helpful, its all to jog my memory later when I get too senile to remember anyway…).

Ciao!!

- Jarrad

Home Renderfarm Research.

Friday, April 3rd, 2009

Now, i’m nowhere near a computer hardware nerd, but I know how to build a computer so i’m ready to tackle this task head on. I’ve done some research trying to build a system as cheap as I can from all new components (some being incredibly limited only to local sources) – I don’t mind spending the money as its all for work and is tax deductable… Anyway the plan is to build a custom case, network all the computers together in one box, and hopefully distribute jobs wirelessly… See how we go with that. Anyway I did some quick price checking on components to build a basic system… Here are some that I’ve decided to chase due to low costings.

Intel Dual Core E1400 2.0G CPU – 2 cores 2.0Ghz = $69.00

ASUS P5KPL-CM Motherboard – Max 4GB RAM = $89.00

2048 DDR2 800 HYNIX Hyundai generic ram stick = $26.90 x 2 == $53.80

Basic 400W Power Supply = $49.00

160gb HDD Western Digital = $60.00

TOTAL = $$320.80 for the core basics for the system. In summary, this is a Dual Core celeron 2ghz, 4gb 800 RAM system with on board graphics. I’m open to feedback on this rig, I have yet to do detailed research to see if it will all work together but I don’t see any problems as both the processor and motherboard chipset are LGA775. If I build this, depending on how many boards I can fit in a custom tower, I may range from 5 computer tower to potentially 10, so upwards of $3,200 for all of them, 5 = 10 cores 10ghz 20gb RAM, 10 is double that obviously…

I’m in need of this setup to be able to be made instantly, so if you know anywhere thats cheaper and has stock and can express post while still being cheaper, i’m all ears. I’m in Perth, Western Australia so postage may be a killer – let me know!

Off to research render distribution programs and linux setups to be used on each node…

To google!!!

- Jarrad

Links, inspiration and extras.

Friday, April 3rd, 2009

This post is intended to be a way of saving those tabs ive had open in my firefox browser for days. Hopefully by writing this blog, I will be able to restart my macbook pro haha. Anyway I’ll leap right into it. First thing – animation links that are inspiring…

Videos:

Meindbender Studio Showreel – inspiring and unique animation, awesome rendering/lighting, and good attention to detail especially when it comes to camera movement. Good inspiration for how an appealing showreel should be put together.


Adrenaline Lemmings CGI test from Alex Orrelle on Vimeo.

Inspiring animation, composite of character animation and clever video footage to put together a short but incredible display of animation and production skills. I hope one day I can collaborate with some people to produce some good showreel material.

Twitter/General Links:

AnimationXpress on Twitter – A lot of links to animation related information which I intend to have a more detailed look through – other things to look at are…

Animation Mentor blogs which I’ve missed out on andddd…. watch the stack of e-critiques from the 11 second club, they have a LOT of tips and tricks in there for fellow animators: 11 Second Club Feedback

Tutorial links:

1001 Adobe After FX tutorials shared by someone over twitter (apologies I forgot who actually linked it so im sorry if im not giving you credit). Id suggest download as many tutorials as you can because the internet being the internet, they wont all stay around for long.

Modelling Technique – modelling techniques using the Iron Man helmet… This is the EXACT modelling technique I use, especially the closer edges to carve in details after smoothing – I recommend it, creates incredibly efficient and easy models.

I think thats the majority of links that I had open which were noteworthy, so that saves me from having them all open. On another note, I may have some big contracts coming through which require more rendering grunt, so I’m off to do some research about mini-rendering farms and will most likely be posting links here if I deem them useful and informative. Most likely try and base them off the ikea helmer render farm.

Will keep this updated for my crazy thoughts!

- Jarrad