Showing posts with label rendering. Show all posts
Showing posts with label rendering. Show all posts

Saturday, August 30, 2014

PRMan: Installing Pixar's License server on Ubuntu

PRMan price drop


It is a great time in RenderMan land. Pixar will release RMS 19 with the new RIS render technology this fall. That is great news but the real whopper is Pixar's decision to dramatically lower the price of all this sweet candy. That's right, instead of thousands of dollars it has gone down to $495 per license. And the great thing is that there is no differentiation between RenderMan Studio and RenderMan Pro server anymore. A license can drive either product.

This price restructuring brings new opportunities for small VFX studios. But the fun does not end here. Students and hobbyists can now register for a non commercial license for free and there are no limitations in the software or watermarks in the images. There is really no excuse anymore to not try this render engine. The free version will also be available in the fall of 2014.


Pixar licensing


Now that the software is more accessible I like to talk a bit about the licensing system. Paying customers work with floating licenses. Floating licenses have a big advantage. You can install the software on as many machines as you want but it is the license server who dictates how many you can open at any one time.

A quick example: Say you got four people working on their own workstation but you got only two licenses. You can install the software on all four machines but only two people can work with it at any one time. This way nobody has to switch seats when they want to load the RMS for Maya plug-in. Once they finish, the license is released an someone else can work with it. At night, you can also use the free licenses for the render farm.

For this system to work you need to run the license server software. This can be on your workstation or another machine like a fileserver or render farm manager. If you have only one machine on which you use PRMan then it is ok to put the license server software on that specific machine. But when you have more it is better to install it on a dedicated machine that stays on all the time. This doesn't have to be a power house computer. I run mine on a Intel Atom server with 4 GB of RAM running Ubuntu 12.04.4LT which is also my personal web and fileserver.



Installing the license server on Ubuntu


Pixar provides license server software for Windows, Mac OS X and Linux. The linux versions are packaged as rpm. Since Ubuntu does not use rpm packages to install software it seems like Ubuntu is a dead end. But no worries, there is a way to get it all working.

First download the required software from the RenderMan website. I used the RH5 64 bit version which needs at least gcc 4.1. You need to convert this downloaded rpm package to a file type which Ubuntu can read. For this there is a tool called Alien.

To install Alien:
# sudo apt-get install alien
To convert the rpm to deb:
# alien NameOfThePackage.rpm
You should get similar named deb package when the program has finished running. The next step is to install the deb package which can be done with the following command:
# sudo dpkg -i NameOfThePackage.deb
Several files will be installed in /opt/pixar/PixarLicense-versionNumber/

So far, so good. The software is installed but it can't run yet as you need a license file. The documentation states that a program named LicenseApp will be invoked during installation of the license server but this seems only to be working on Windows and Mac OS X and not on Linux. This LicenseApp is used to get a license from Pixar automatically. Since the program does not get installed how is it possible to get a valid license?

You need to go to https://renderman.pixar.com/forum/entitlement.php. Follow the steps on this page and it will generate you a pixar.license file for you. You might need to use pixarhostid which can also be downloaded from the Pixar website. Put the downloaded pixar.license file in the directory above.

The next thing to be done is to start the license server with 
# sudo startPixarLicenseServer.sh
Et voila, your license server is up and running. If you want to make sure if it works, use a web browser to go to http://yourServerName:9010. If it displays your licenses then you're almost good to go.

The last thing you need to do is to put the pixar.license file in the root pixar installation directory of all of your client machines. This way PRMan knows where your server lives.



So where can I buy a license (or a bunch of them)?


If you live in Belgium or the Netherlands then you are in luck. You can contact me and I'll help you get one. You can do this trough Twitter or visit www.refractor.be. Feel free to ask questions too.

If you live elsewhere in the world, simply contact rendermansales@pixar.com

Friday, June 14, 2013

Has the new Mac Pro 2013 the potential to be a good CGI workstation?

Apple sneak previews the new Mac Pro on the first day of  WWDC 2013


On the 10th of June Phil Schiller, the senior vice president of worldwide marketing at Apple Inc., presented the new Mac Pro. This new machine looks nothing like the previous model. In fact, the whole thing is redesigned from the bottom up.

The internals of the new Mac Pro. You can see two memory slots at either side for a total of four.

What's under the cylindrical hood?


The new cylindrical design has already been mocked by the internet community to be a trash can, jet engine or a Darth Vader inspired machine. I agree that it is a strange design but I can see the benefits when keeping the machine cool. All components are cooled by a central cooling element and one large fan which will keep the noise levels down.

It will have up to 12 new Intel Haswell Xeon cores, a dual AMD Fire Pro graphics card, 1866MHz DDR3 memory for a bandwidth of up to 60 GB/s, PCI express flash storage, Thunderbold 2, HDMI 1.4, USB3 and gigabit ethernet. Even the latest wireless technology is incorporated.


So, is it any good as a graphics workstation?


The new Xeon cores will definitely provide plenty of power for local render jobs. The fast memory and flash drive will run 3D software like Maya quickly. On the pictures, released on the Apple web site, you can see that there are only four memory slots. Compared to the current Mac Pro that seems kind of few. It all depends how much you can fit in one of those slots of course.

"So what about the graphics card?" you might ask. The dual professional AMD GPU is not a bad choice but it is not sure if it will be upgradable once the machine leaves the factory. The evolution of graphics cards goes much quicker than the rest of a machine. It usually gets replaced half way the lifetime of the machine itself. There is also the question if nVidia GPUs will become available. A lot of graphics software works with CUDA acceleration. Apple is gambling a bit that software companies will develop more OpenCL applications in the future. That said, Mari, a great painting tool for 3D artists will become available for Mac later this year.

One of the things people believe to be the biggest problem is expandability. There are no expansion slots anymore and there is no space for extra hard drives. Apple believes that all expansion should go trough the Thunderbolt 2 interface. It does show potential though. With 6 ports you can add up to 36 devices (6 daisy chained per port) which I am sure is more than enough. And the Thunderbolt 2 I/O is twice as fast as the current one going up to 20 Gb/s.

I honestly think that hard drive expansion, although external, will not be such a big issue. There are already plenty of Thunderbolt solutions out there. Besides that, most post production facilities have network attached storage. Yes, four internal drives might be neater and less cable clutter but I don' think performance will suffer too much.

A potential bigger problem might be finding solutions that needed a PCIe expansion slot before. Some facilities have invested a lot of money in peripheral hardware which with the new Mac Pro can't be used anymore. There are PCIe expansion racks available but this adds to the cost. And, although I am not 100% sure if this is true, Thunderbolt 2 might not have enough bandwidth for adding an extra GPU in an external rack. Then again, you get 2 professional GPUs fitted when you buy a new Mac Pro which provide already a lot of GPU power.


Am I getting one once it is available?


So am I getting one when it becomes available? Well, that will all depend on the price. The machine looks great on paper and will definitely outperform my 2008 Mac Pro but if the entry model will cost more than 3000 Euro, it will become hard to justify the purchase. The 2008 Mac Pro was one of the cheapest Mac Pros on the market compared to it's competitors. If Apple can repeat this then I will be one of the first ones to get one.

Anyway, I am looking forward for this machine to hit the shelves.

Sunday, February 24, 2013

IBL and Environment Maps for CGI



Image Based Lighting, also known as IBL, has been around for a while now and is a great solution for lighting and integrating your VFX scene into shot footage. In this article I like to show you how I create the photograph needed for this technique.


Low Dynamic range example of an equirectangular image also known as a Lat/long environment map. Keep reading if you like to know how I make this.


The basics

It is perfectly doable to light your scene with CG lights. I have created hundreds of realistically lit shots this way but it can become very time consuming when you want to get the fine details completely right. Thanks to IBL we can gain some time and spend it on other parts of the project. The idea is that a photograph of the place where you shot the footage contains all the needed light information and can be used with your graphics software to simulate the lighting.

There are two problems we have to overcome to be able to use this technique.
  • We need the light information of the whole scene. One photograph won't give us that unless you got a very expensive 360 degrees camera. This means we need to take multiple photographs and stitch those together till we got a complete view of our scene. Each photograph needs some overlap with the previous one. The field of view needs to be big enough otherwise we have to take too many photos which will become a nightmare to organise let alone all the time you spend by taking those pictures.
  • We need to capture all light information, Including the little light there is in the shadows as well as the super bright highlights of the sun. The dynamic range of digital cameras isn't big enough to capture all this information into one photo. The shadows will be crushed and the highlights will be burned, especially when storing the photo into an 8 bit image type like jpeg. The subtlety will be lost and the lighting won't look realistic.

Important remark: Keep in mind that you should have as few as possible moving objects in your scene. You will be taking pictures at different shutter speeds and moving objects will become a blur at slow shutter speeds.

Today I am using a better but slightly more expensive method than a couple of years back. In the first section I will explain in short how I used to do it and in the second section I will explain how I do it today. 

The old way


A mirror ball. Note the scratches and blemishes. Although the map will work for lighting it might be a bit rough for good reflections.

You need at least a camera which can shoot in manual mode. You have to have full control on aperture, shutter speed and ISO. A regular DSLR will do the trick. It even doesn't have to be a very expensive one.

To grab a complete environment with a regular lens you need way too many pictures to stitch together which will be very time consuming. A neat solution is to photograph not your environment directly but to shoot a spherical mirror or better known as a mirror ball. You don't want those facetted disco balls but rather the smooth chrome like balls which give a perfect reflection without breakups. The great thing about a spherical mirror is that the reflection is more than 180 degrees. It is actually almost 360 degrees with the exception of the view directly behind the ball. The drawback is that the edges are extremely distorted and a lot of information will be squeezed into a few pixels. To counter this drawback it is good practice to photograph the sphere from three or more different angles and to stitch those together.

Pros:
  • Cheap, available in garden shops unless you want a perfect chrome ball with no blemishes.
  • Good enough for capturing the general lighting information of your scene.
  • A regular DSLR camera with a regular lens will do the trick although I recommend a long one as you will be less visible in the reflection of the sphere.
Cons:
  • Every blemish on the sphere makes your picture unsharp.
  • You will always be in the picture as you are being reflected as well. You can paint yourself out but it consumes time.
  • Low resolution. Might not be enough for perfect reflections in your CGI image.
  • Measuring the distance between the camera and the sphere is critical. You want all the angles to be taken from the same distance.

Since regular jpegs have a low dynamic range we need to shoot different exposures and join those together into a High Dynamic Range Image or HDRI. This means the camera needs to be on a tripod as long exposures will be unavoidable. You also need to undistort the spherical distortion caused by the mirror ball. There are several programs available to do this for you. I used to use HDR Shop 1.0 but it is old and there is a newer version available.

Check steps 4 to 6 in the next section below to get an idea how to set exposure and how many pictures to take.


The new way


An low dynamic range tone mapped lat/long environment map. It wasn't stitched up properly. Notice the soft edges of the buildings.

Last year I invested in a whole new setup. It is superior to above method and get's better quality environment maps. Instead of working with a mirror ball I use a Fish Eye lens. You know, those funky super wide lenses which capture between 140 and 180 degrees field of view (depending on which lens you buy).

The aim is to take pictures with multiple exposures from six different angles plus a top and bottom shot. You always need a tripod for this.

Let's look at the kit.
  • DSLR: I use a Nikon D7000. This is a good midlevel DSLR. Why Nikon? Because I have already invested quite a bit of money into Nikon lenses over the past decade. Any other brand will do as long as you can shoot in manual mode.
  • The lens: This is the important part. I use a Samyang 8mm f/3.5 Fish Eye lens. This lens has a 180 degrees field when used with a DX camera like the D7000. You have to do a little research to know which lens will be the best choice for your camera. This Samyang is great quality but it is a fully manual lens including the focus. It has no proper chip for EXIF data (Although the new November 2011 model does). This is not a problem as such. You need fixed settings for your pictures anyway. I know this lens is also available for other camera's.
  • Tripod: A regular stable tripod will do.
  • 360 degree rig: Another very essential piece of equipment. This allows you to rotate the camera in fixed intervals around the central Y-axis. A good rig will measure the distances for you. I use the Nodal Ninja 4 for measuring the intervals with the EZ-Leveler II to get the camera perfectly horizontal.
  • A laptop for tethered shooting: A laptop is not necessary but it is always great to save all those images straight to hard drive and to automate the whole process. I use Sofortbild, a free Mac application from Stefan Hafeneger which allows me to take multiple exposures with one mouse click. Sofortbild works only with Nikon camera's. I know Canon has its own software.
  • The HDRI conversion software: I just use photoshop to join my multiple exposure brackets into one HDR image. Sofortbuild can do this on the fly while taking the pictures but I had some trouble with it lately and I didn't bother to figure out yet why.
  • The stitching software: Although you could try to stitch all the images together in photoshop, it is far more convenient to use a HDR panoramic stitcher program. I use PTGui Pro for Mac. you can give indications on where pictures are overlapping and it will try to stitch them together for you. There is also a manual mode if it doesn't manage to stitch them automatically. It also transforms the whole image into a longitude/latitude image format and saves them in a 32bit image format of your choice. I always use the radiance file format which has the .hdr extension. They seem to work flawlessly in Maya.


Now we have to put all this kit into practice.
  • Step 1: Put the whole rig on the spot where you want your light being captured. This is usual the location where you want your CG element to be in the scene.
  • Step 2: Make sure your camera is level. Use a spirit bubble or the build in sensor to measure this. Be as accurate as possible. This becomes relatively easy when using an EZ-leveler II.
  • Step 3: Put the nodal point of the lens right above the nodal point of the rig. If you skip this step your pictures won't align when stitching them. You can check this by taking pictures at different angles. You should get no parallax shift between the two pictures. If you do then you need to adjust the placement of the camera in comparison to the rigs nodal point accordingly.
  • Step 4: We need to take pictures at different exposures. Use the shutter speed to control this. Fix all other settings. Put the ISO to 100 to get noise free images and put the aperture to f22 so you get as much depth of field as possible. It will make everything sharp in the picture and that is exactly what you want.
  • Step 5: make a couple of stills to check the darks and the brights. Use the histogram function in your camera to see when the blacks aren't crushed anymore and the whites not clipped. It will show you what the minimum and the maximum shutter speed should be.
  • Step 6: Start with the slowest shutter speed and take a picture every two stops till you reach the fastest shutter speed. This will usually be between 5 to 8 pictures. A program like Sofortbild will take them all in one go when using tethering.
  • Step 7: Rotate the camera exactly 60 degrees (This can vary with other lenses but is a good benchmark) and repeat step 6. Make sure you take the same amount of pictures.
  • Step 8: Keep doing this till you have a full rotation.
  • Step 9: Take 2 extra sets for zenith and nadir. You could do without but it gives a better result. The cheap rigs won't allow you to do this though.
  • Step 10: You should have 8 sets of images now. Convert each set to an HDR image in photoshop. (For CS6: File>Automate>Merge to HDR Pro).
  • Step 11: Import the images into PTGui Pro and go trough the whole procedure to stitch them together into an equirectangular image.
  • Step 12: Export the results as a new HDR and use it in your 3D software. 

Something extra:
If you don't want to have your rig in the photograph it is possible to paint it out. It will give a nicer result but it can be time consuming.

I realize this article doesn't explain all the intricate details of the process but it should be enough to get you on your way and to try it out for yourself.


Links

Saturday, August 18, 2012

RenderMan Basics




I recently put my old graduation animation online (which you can watch on youtube: A Plug's Life). It was made back in 2001 and it was my first big project working with Maya and Pixar's RenderMan.

The other day I was asked in the video comments if I could write some tutorials on the use of RenderMan. That sounds like a great idea but before I want to come up with some hands on tutorials it is important to learn something about the RenderMan architecture.

I often hear that RenderMan is not suitable for small studios as it is too complex and is for tech heads and not artists. I beg to differ. RenderMan is a very efficient render engine and small studios which do not have a lot of render capacity can really benefit here by lowering render times. The shading tools are quite extensive and can give superb results without the need of any programming.


What is RenderMan?

First I like to define RenderMan. RenderMan is actually an API (application programming interface) and not a render engine. For a long time Pixar was the only one having RenderMan compliant renderer (as they invented the standard) called Photorealistic RenderMan or in short PRMan. People quickly started to call it RenderMan though and it has stuck ever since. Today there are more commercial render engines available which are RenderMan compliant like 3Delight.

Since Pixar's RenderMan is the industry standard (they say so themselves and honestly it is true), I will use their software to explain my examples.


RIB or RenderMan Interface Bytestream

Since PRMan is a renderer and Maya an animation package, there is need of a common language between the two. The API mentioned before is this language. Have a look at the following schematic.

The scene translator converts Maya data into a RIB file which the render engine understands.

The scene information from Maya is translated into a RIB file. This RIB file contains everything from geometry and information on which shaders are used to render resolution and certain render settings like shading rate. Since a RIB file is written in the common RenderMan language every RenderMan compliant renderer can interpret it and render it.

The RIB file can be displayed as an ASCII file, looks a bit like a programming language and is actually quite readable. We often opened up the RIB file to see where things went wrong when the renderer didn't give us the expected results.

In larger studios this RIB file is usually hacked to add in extra elements before the the final render is made.


RSL or RenderMan Shading Language

Shaders are render engine dependent. This means that when you go from one render engine to another you need to redo the shading. To tackle this problem between RenderMan compliant renderers, the standard provides a common shading language called RenderMan Shading Language. This is a simplified programming language to code shaders. These shaders are then compiled and used by the render engine.

Coding shaders is not what most artists want to do but since RenderMan Studio has a visual tool to create shaders called Slim, artists don't have to feel left behind. Understanding how to code shaders can give you a better insight in how shading works in CGI though.


RenderMan Studio

Pixar's RenderMan is available as a package called RenderMan Studio. It contains:
  • RenderMan for Maya (Pro)
  • Slim
  • it
  • Tractor
RenderMan for Maya is the core plug-in. It deals with the scene settings and takes care of translating the scene information into a RIB file. It comes with its own Maya menu and custom shelf.

Slim is the shading management tool. It is an external running program but can be connected to your Maya scene. Custom shading networks can be generated visually as well as trough coding in RSL.

"It" is the image tool. When rendering out your images you can do so to the Maya renderview but also to "it". "It" is much more flexible and allows even simple compositing trough scripting. It also allows the use of Look Up Tables and displays actual pixel values, something the Maya renderview is lacking.

Tractor is the render farm tool which queues and manages your renders. Not only can you manage your RenderMan renders but also other jobs like Nuke composites which you want to be calculated on the render farm.

RenderMan Studio comes with an embedded render license so even small VFX studios can get started straight away.


Links:

Monday, August 06, 2012

CGI Workstations



Because I am a bit of a techie I often get the question what kind of workstation people should get to do their post production and CGI work on. In this article I look into what is useful and what is merely fluff. Since hardware specifications change regularly I will try to be as general as possible so hopefully this article will still be valid in years to come.

The machine

Any computer can be used to do graphics on but I am sure you will get frustrated quickly when things don't move along smoothly. Let's not kid ourselves though, machines get faster every year but scene complexity goes up as well. In the end you always need a good machine to do CGI.

CPU or processor

Let's start with the heart of the workstation. The CPU will take care of most calculations. A fast processor is great to have but there are some things to consider.
  • MHz vs cores: Multicore processors are quite common the last couple of years. These are great for multitasking but also for programs which are multithreaded. Most CGI software is multithreaded and uses more than one core at the time. Having a fast CPU with several MHz will help you along as well as it will execute a thread faster. To find the balance is a bit tricky but I always check these CPU benchmark reports. They give added performance of all cores in a processor. This way you can see if it is better to go for that high MHz quad core processor or for the lower MHz hexa core processor.
  • Price vs performance: Now that you have an idea how each processor performs you have to balance it with how much it costs. Most processor series have a sweet spot where you get the best performance for its price. It is usually a good idea to pick the one which performs a couple of steps better than the sweet spot one. Yes, it is more expensive but these are a bit more future proof. If you got unlimited funds you can pick the fastest one but keep in mind that these are only 20% to 30% faster but more than triple the price.
I am a fan of lot of cores since my main competence lies in lighting and rendering. It used to be that you had to buy a render license for each core but luckily those days are over. Buying a 12 core machine over a 8 core one could be beneficial if your post production software is really expensive.

I also like to suggest to take server rated processors like the Intel Xeon and the AMD Opteron series. They are a bit more expensive but have no trouble running 24/7.

Memory or RAM

Next up is memory. 3D, compositing and render software use tons of memory. The good part is that in comparison to processors memory is rather cheap. Don't skimp on it! I know it is easy to add in more but getting enough memory will help you a long way. It also allows to have multiple programs open at the same time. I often have Maya and Nuke open while rendering a scene in the background with Mental Ray.

When you run out of memory the workstation will start swapping memory to disk. This really grinds it to a halt as disks are death slow in comparison to RAM. Once it starts swapping you will pull your hair out of frustration and it can take literally minutes before your machine becomes responsive again.

So how much should you get you ask? As a rule of thumb take at least twice as much as the market puts in machines by default. For example most good performing machines have 8 GB of RAM at the time of release of this article. I suggest you put in 16 GB. Each year this number will go up so adjust accordingly.

Make sure to choose the right RAM for your motherboard. Some motherboards need the more expensive ECC memory.

Graphics Cards

Graphics cards are probably the most discussed items in a workstation. They are not only important to show your graphics on the screen but also have some calculation capabilities which gives a boost to the performance of the workstation.

  • Game card vs Professional card: This is one of the big questions. Should you get a cheaper good performing game card or a slower very expensive professional card. The reason there is so much discussion about it is that it is a difficult question to answer. Post production software usually claims they are only certified to work with professional cards. In practice we see that most game cards cope quite well though. If you build a dedicated workstation and are willing to spend the money then it might be worth to get the professional card. If you are on a limited budget and also like to use your machine for games, go for good processors first and get a good performance game card. NVIDIA has a document which promotes the Quadro series over their GeForce series for professional work. Look it up and see what is important to you.
  • NVIDIA or ATI (from AMD): The race to make the fastest graphics card is an ongoing process. NVIDIA has the Quadro series and ATI has the FirePro series for professional graphics. In my opinion NVIDIA is the clear winner here. They have developed the very popular CUDA which allows to run calculations on your graphics card which usually are done by the CPU. A lot of programs are already taking advantage of this. Even the game cards support this technology.
At the time of writing this article there is not much choice when you are using a Mac Pro as your workstation and want an NVIDIA card. Only the expensive Quadro 4000 is currently available. I hope this will change in the near future.

Motherboard

Since processors dictate what kind of technology you use, choosing a motherboard becomes slightly less important. Most of the time the hardware manufacturers won't even give you a real choice. If you go for server rated processors then you usually also get a server rated motherboard which is good enough.

Hard drives

Most computers have only one hard drive. If you work in a facility with a server then this one disk will be enough. It just needs to be big enough to store all your post production software. All created content will be stored on the server so multiple people can have easy access to it.

If you have a standalone workstation then it is a good idea to get two extra disks and put them into a RAID 0. This RAID disk will be used for all your data while your main disk will contain the operating system and the installed software. It will increase reading performance quite a bit. There is a caveat with this kind of setup though. Since data is divided over two disks the chance of a hard disk failure is doubled. Make sure to backup your data regularly, preferably onto an external disk (which can be a SAN).

Take server rated drives which run at 7200 rpm or faster. These are manufactured to run 24/7. Cheap green disks just don't have enough performance for this kind of work.

Sound card

Most motherboards have built in audio and if you are not making any music then this will do.

Mouse and keyboard

Just pick a keyboard you feel comfortable with but do pay some attention to the mouse. Most mice are too light and are not comfortable to work with. Keep in mind that the mouse is used a lot while creating graphics and getting Carpal tunnel syndrome because of a bad mouse will kill your VFX career rather quickly. A heavy mouse works more accurately. I use game mice with a good grip on which I can add little weights. Most post production software make heavily use of the middle mouse button. This is usually a scroll wheel so make sure it feels comfortable enough to be used as a button too.

Tablet and pen

This is a bit of an investment but I have a tablet since 2000 and I really can't mis it anymore. I don't use it for Maya but it is incredibly handy when editing, compositing and, last but actually really important, when doing Photoshop paintwork. It has a complete different feel than a mouse and it just works way faster for certain things.

Monitors

Depending on what you do you can get a cheap one (when modeling or animating) or an expensive one (when doing color critical work like painting or lighting). I suggest not to skimp too much on a good monitor. I only use 1920 by 1200 LCD panels nowadays. They have enough pixels to show all important screen assets and can handle full HD. If you do have color critical work make sure to get a monitor which can be calibrated. It will save you a lot of hassle later on. 

I worked for production companies who didn't bother too much to get good monitors and the result was that everything we produced looked different on each monitor. You can imagine that it can become quite frustrating when a director sees your image on his screen and tells you it is too dark or too red while on your own screen it is too light and too green. If you work together with other people and can't afford multiple good monitors, you need to pick a reference monitor on which everyone will judge the color fidelity of the entire project. This way everyone sees the same image with the same color balance.

Other Peripherals

Feel free to add in other peripherals that may ease up your life like a Blu-ray player or an old school floppy drive. Do check that they do not eat too much resources like CPU power and memory.

Conclusion

You might have noticed that building a dedicated workstation can cost quite a bit of money. Yes, it usually surpasses the price of a very expensive gaming rig. If you are a hobbyist it might be enough to use that gaming rig. If you are a professional trying to make money out of VFX work then you better go for a professional workstation. Having a decent system will accelerate your workflow and since time is money you can make the calculations yourself how much money you can save over time by making the the initial investment.

Wednesday, July 18, 2012

Render Farms



Projects range from small one person achievements to huge VFX productions where hundreds of artists contribute to the result. The thing they have in common is that they need computational power to finish certain steps in the process. Rendering is the first one that comes to mind but simulations and compositing take up their own share of CPU cycles.

It is possible to let your workstation chug away on those calculations and eventually it will get done but more often than not a tight deadline does nog give you this luxury.

The speed increase with a Render Farm

Render farms are all about speeding things up. Let's say you have only one workstation and you work 8 hours a day (Ok, you have to be lucky to work only 8 hour days in VFX, usually you need to do more to reach the deadline). That means that you have 16 hours left for rendering your sequence. Even with 10 minutes a frame, which is quite acceptable, it will give you 96 frames which is only 4 seconds of animation (at 24 fps that is) a day. You could try to simplify the scene to speed things up but that is not always possible.

The simplest form of a farm is to have second machine next to your workstation which can do calculations while you continue working. This will more than double your capacity and will get you 10 seconds of animation done per day for the same scene. When you have only one machine it is easy enough to manage the rendering of different scene files manually. No extra management software is needed at this point.

Let's move to a bigger setup where there are 5 artists in the shop and let's say they have a workstation each. With the same 10 minute a frame setup it means that they can render 20 seconds of animation each day when working 8 hour days. You can see that the math behind it is simple enough to make predictions once you got an idea how long a frame will take. I must agree that it can be tricky to predict render times when the contents of the scene and hence the render times per frame change a lot. But of course, an indication is better than nothing.

It becomes obvious: the more machines you get, the more complicated the managing of the jobs will become. In these circumstances it is wise to introduce a render manager into the pipeline.

The render manager

The render manager is a piece of software which automates the distribution of jobs to your render farm. It consists out of two parts. The server side program which is the actual manager and the client side program which activates the right renderer for the job. The server side program usually runs on a dedicated machine, very often the same machine as the license server for your software. The client program is installed on each machine which can handle a render job.

Instead of launching the job manually on the client machines it will be submitted to the render manager. When a job is accepted, the render manager has several tasks to do. First it checks the availability of the clients. It then will send a chunk of the job towards a client. The chunk size can be dictated by the user. It can go from part of a frame to a full frame to even a group of frames. If your frames render fast then it is usually better the group them otherwise one frame per client will do fine.

The render manager will now divide all the chunks between the clients. When a client is finished it will report back to the manager and a new job will be given automatically.

Another task of the render manager is to queue the jobs from the users. It allows several people to submit jobs without the fear that they will fail because the render farm might be too busy. The render managers usually have the option to prioritize jobs according to preset rules.

A good render manager will tell you when things go wrong. When a render fails it usually generates an error message which is passed on to the manager. It will then show you which jobs didn't render properly.

What is needed for running a render farm

  • Computers: Ok, that is pretty obvious. Fast CPUs and a lot of memory are preferred. You do not want them to start swapping memory to disk. It will grind the render to a halt. Big hard drives are not important, do get server grade ones though. Rack machines are the preferred choice when not using workstations. They are space efficient and are usually server grade so they are made to run 24/7 at full capacity. Do not use the render manager server as a render box so you need one machine dedicated for the manager to run on.
  • Operating system: A good rendering manager works cross platform. It doesn't matter if Maya was installed under Windows, MacOSX or Linux. Most render farms run Linux as you can install it without a GUI. This saves memory and makes the machine more efficient (oh, and Linux is free!). Some software packages do not have a Linux or Mac version and then the choice of OS becomes obvious.
  • A render manager: If you are serious about rendering you need a render manager. It will automate everything, speed things up and take a lot of worry out of your hands. It will also make your farm very scalable. There are many different ones out there and all come at different prices so it is hard to recommend any of them.
  • Software Licenses: That's right, software is usually not free and you need to buy the right amount of licenses. Most VFX packages have separate render licenses. They tend to be cheaper and are sometimes sold in bundles. For example Maya comes with 5 render licenses when you buy a floating license. Take note that you can only use packages which have a command line render options. A render manager can not start GUIs.
  • Network: A fast network is a must. The bigger your farm becomes the more data you have to pull trough those wires. Yes, wires. Running a farm on WiFi is a bad idea.
  • A storage server: Rendering images or baking out data can fill up disks pretty quick. A good server with a RAID system for redundancy and continuity will be ideal for storing data. You do not want to loose all that render time because a disk went bad. Remember: a RAID is not a backup system, it was designed to let you keep on working even when a disk dies on you. If you want to be sure that your render data is safe, copy it to a second server after the render job finishes.

Scalability

One of the things we notice in VFX is that render and simulation times never seem to go down. We would assume that with faster processors our render times would go down but instead we see another evolution where the render times stay the same but the complexity of the scene goes up. 

Lucky for us, render farms are to a point very scalable. Just add in more machines and licenses when needed. It only becomes a problem when the server or the network can not handle the traffic anymore. You can imagine that a farm at ILM or Pixar is a complex matter to maintain.

If you you need a quick boost in render capacity but don't have the cash to expand the farm,  you can always hire the services of online render farms. You could say that it is rendering in the cloud. It works very similar as your local render farm with the main difference that you need to upload your data to the cloud first. With a slow internet connection this may take a while but once in the cloud the renders go really fast.

Friday, April 27, 2012

VFX Back to Basics Series: 6. What is lighting and rendering?


This is part of a series on the basic elements of Visual Effects. Each post will talk about a certain element which is one of the basic bricks used for building VFX shots.

In this sixth post I will talk about lighting and rendering.

A ray traced image with a directional light and a sky dome which is used for the image based lighting.

The reason why lighting and rendering usually goes together is because lighting technical directors handle both of them and certain render techniques influence directly how the scene is lit.

Rendering in a nutshell

Let's start this post with rendering and more specific with render engines. A render engine is a piece of software which translates scene data, like models, shaders and lights into a final viewable image. These calculations can go from mere seconds for a simple scene to hours for a complex scene just for one frame. Keep in mind that a movie in the theater needs 24 frames a second so you can imagine that movies packed with VFX are taking years to render, if it was done by a single CPU that is. Tackling a large number of frames is solved by using many CPU's at once. A room full of computers set up for this purpose is called a render farm.

The render engine can be seen as a separate entity and is not really part of the animation and modeling package although it might seem so. Most packages come with a built in renderer but external render engines usually are chosen when working on bigger projects. Photorealistic RenderMan, 3Delight, Mental Ray and V-Ray are only a few examples. There are plenty of good renderers out there. Just choose the one which works for you.

Diagram which shows the relationship between 3D packages and render engines.

The above diagram shows how the software packages like Maya and 3D Studio Max talk with the help of a translator to the rendering packages. Each render engine has its own "language" so the translator gets provided by the render engine.

There is one family of renderers which talks the same language which is the RenderMan standard. This standard was created by Pixar and for a long time Pixar was the only company which had a RenderMan compliant renderer. Now there are other commercial renderers availabe. The scene file from the 3D program gets translated to a RIB file which any RenderMan compliant renderer should be able to read and render out. This open standard is extremely powerful and flexible. It allows for very complex render pipelines so this is mostly used in VFX for film and not so much for small projects.


Render algorithms

Every renderer has its own algorithm but there are two distinctive paths on how to calculate an image: Scanline rendering and ray tracing. I am explaining shadow creation here as well although it can also fit in the lighting section below.

Scanline rendering is a technique which sorts the geometry according to depth and then renders a row at the time. It is very efficient as it discards geometry which is invisible and therefor limits calculations. Shadow calculations are usually done trough shadow mapping. Shadow maps are depth maps which can be stored in a file and be reused. High resolutions depth maps can be expensive to calculate but their reusability in certain circumstances make up for that. It handles large amounts of geometry rather well. Although it has been a very popular technique and is used for example by PRMan, it is being replaced more and more by ray tracing.

Very simple example of shadows made with a shadow map. This one has not a high enough resolution to have a nice shadow. The edges are pixelated.

A new render with a higher resolution shadow map. The edges aren't pixelated anymore.

This how a shadow map looks like. It is a depth map where the lighter grey is closer to the camera than the  darker grey.

Raytracing is a technique which calculates a pixel at the time. It shoots a ray from the camera to the the objects which bounces of to the lights present in the scene. Shadows are an automatic result of this technique and therefor easy to make but they can become rather expensive when soft shadows are needed. This increases the rays per pixel and affects directly the render times. The big benefit is true reflections and refractions are possible. Mental Ray and V-Ray belong to this category.

Ray traced shadows. These are sharp clean shadows.

An attempt to get softer shadows but not enough samples are used and it looks bad and pixelated.

This render has more samples as the previous image and has therefor a much smoother result but render times have gone up considerably. From 7 seconds to 23 seconds.

Render times in both techniques are influenced by the objects in the scene and the complexity of the shaders and lights used. It is imperative to keep render times under control when running a production. Render algorithms can be combined. It can be possible to use a scanline renderer and activate the ray traced shadows if the render engine allows this.

There are more subcategories like global illumination and radiosity but that is a bit too specialized for this article.

Lighting

A 3D scene without light would turn out black just like in the real world. The techniques for lighting a scene are pretty much like lighting for a live action set. There are some differences though. It is impossible to subtract light (and I do not mean block) in the real world whereas in the digital world it is a matter of mathematics. Shadows are another difference. It is possible to change the color, softness without affecting the light itself or even turn it off completely. This gives a huge amount of flexibility but be careful when lighting for a photorealistic scene. Using these tricks usually makes the scene look less real.

Classic lights

Lights in a 3D scene are controlled by light shaders just like surface shaders. Most of the time you do not have to assign a light shader to your light though as most packages do this automatically. A light shader is a little program which defines the properties of the light. Light shaders are also render engine specific. All 3D packages have a ready to use set of lights available. Here are the most important examples.
  • Point light: light emitting from a single point like a light bulb.
  • Spot light: A light like a regular spot on a set. It can be controlled by barn doors and by adjusting its diameter.
  • Directional light: A light source with parallel light beams. It is well suited for simulating the sun for example. 
  • Area light: A light which emanates from a surface. Good examples are Kino Flo lamps and light trough a window into a room.
Take notice that area lights are a special case for shadows. The light is bigger than a point and will therefor give always soft shadows. Soft shadows are nice but are always a bit more expensive in calculations especially when you don't want them to look to grainy.

Newer techniques

When lighting for CGI which needs to be incorporated into live action another technique can be used if your renderer allows it. This is called image based lighting or in short IBL. Instead of lighting the scene completely yourself it is possible to use the lighting which was present on the set. This can be done by taking high a dynamic range (or HDR) panorama photograph. The HDR images contain much more information than a regular photograph. Hot spots in the image are not clipped and the blacks are not crushed.

A panoramic image of a kitchen. This is just a representation of an HDR image. Real HDR images are not supported to be shown on the web.

The renderer will use this HDR image as base to light  the scene. This can give highly realistic results. There are two main techniques to make these photographs. The cheap way is to use a mirror ball. It works well for grabbing the lighting but has certain limits when the image is used for crisp reflections on the CGI objects. The more expensive way is to use a fish eye lens.

If you're interested in good lighting make sure you read some books on cinematography. There is much to learn from the real thing. Understanding color theory and how light behaves is very important.


This concludes the sixth part of the VFX Back to Basics series.
Make sure to subscribe (at the top) or follow me on Twitter (check the link on the right) if you want to stay informed on the release of new posts.