Tuesday, April 19, 2016

Tips and tricks to avoid common Pitfalls when Shooting Stop Motion Video



Having young kids I got interested in stop motion animation so I could make some short entertaining video's with their own toys, in particular their Lego Duplo sets. I got most equipment anyway and I only had to invest in some white paper and card board which is needed for the background. So 10 € later could set up a mini studio. Results can be seen on my Legobrick Parade YouTube channel.

I did encounter some pitfalls which can really ruin the quality of the video. In this article I will show you what problems I encountered and how I solved them.


Lighting the Scene


When lighting the scene I wanted to have soft lighting which didn't produce hard shadows. Hard shadows give too much contrast and are usually not very nice to look at. As the key light I used a 1K tungsten spot with a soft box. This diffuses the light enough to get rid of harsh shadows. As a fill light I used a 650 Watt spot. I didn't have a second soft box to diffuse it so I have put a polystyrene panel above the scene and pointed the spot towards it. The light bounces back down and gives a soft filler which removes even more shadows. The  white background paper also helps bouncing the light a bit to make it softer.



Basic scene lighting for my stop motion project.


Only the spotlights illuminate the scene.


Stop motion and the dreaded flicker


One of the difficulties of shooting stop motion is to keep consistency in the lighting to avoid differences between frames. Even small differences are a cause for a nasty flicker once you edit your clip together. It does seem simple enough but there are many different causes for flicker which you all need to address to get clean footage.

1. Shoot in an environment where you have full control over the light. This seems trivial but shooting on a sunny day with clouds will give you different light situations every couple of minutes. On video this is usually not that big of an issue since you continually shoot the footage at 25 frames per second or so. In stop motion there might be a pause of a couple of seconds or longer while you change the scene before you take the next frame. This is a guaranteed way to flicker. Shoot preferably in a room where no external light sources control the lighting conditions. You can see on the pictures above how I have set up my mini studio in my basement.

2. Don't use fluorescent light as they flicker at a certain frequency. Tungsten or LED is your best option. If you do so anyway then the next tip might be a help to cancel out some of the flicker.

3. Use a slow shutter speed on your camera. If you use 1/200th of a second for example you might have a bigger chance at getting flicker. Especially when using fluorescent lights. They have a much lower frequency and you just might take the picture right in between the two light pulses and therefor have less light than the previous frame. 1/5th of a second works for me.

4. Use an open diaphragm if possible. The aperture gives you control over your exposure but also the depth of field so experiment what works for you. I still had enough sharpness at F5.6 on my Nikon D7000 which has an APS-C sensor. Most modern DSLR lenses have their diaphragm controlled by the camera. The camera will open up the diaphragm completely in its default state. When taking a picture it will change the aperture of the diaphragm to the setting which you have set. This means that the diaphragm changes state.  Your camera might have difficulties at going back at the exact same state as the frame before. Even the smallest difference in aperture between two frames will give you a difference in lighting. If you leave it open then the change of state is not as big as when you close it almost completely and less error will occur. Also a small difference in aperture on an open diaphragm between shots has a smaller margin of error then on an almost closed diaphragm. If you use old school manual lenses then this problem is non existent as there is no change of state when taking the picture. If there is too much light coming in the camera due to a large aperture you can use a ND filter to decrease the light going in.

5. Wear dark or even black clothing while shooting. White clothing might reflect indirect light into the room and therefor will change your lighting condition when you are moving around. You could try to stand in the exact same position while taking the picture but that is usually very unpractical. Black clothing doesn't reflect light and will have no impact on your lighting condition.

6. Don't use the automatic white balance function. Yes it it easy when shooting pictures but for stop motion it is another potential source for flicker. Instead fix the value depending on which light you use. Tungsten might need a different value than LED. Test it and then keep it the same for the whole shoot.

Which frame rate do I use


When shooting stop motion you have to keep in mind which frame rate you want to use while shooting. There are a couple of options.
  • 24 frames per second: This is the ideal world. It looks nice and is as much as regular feature film. The drawback is that you need to take 24 positions for every second of video you want to make. This can be time consuming.
  • 24/2 frames per second: This means you take only 12 positions per second but use every frame twice. This is usually more achievable and gives decent results.
  • 30/2 frames per second: Here you take 15 positions per second and use every frame twice. This is closer to the American NTSC standard and a bit in between the two above concerning the time spend to record it.

Keeping the camera in the same spot


Most of the time you will be doing locked off shots (Shots which have no movement in them). For stop motion you need a good sturdy tripod that will keep your camera in the same spot. But even then you can have slightly moved shots and they can be quite distracting. This is usually caused by pressing the button on you camera. By entering a bit of force on the camera you can move it ever so slightly. The solution is to use a remote. I use a wired one but wireless remotes are even better as you don't have to touch the camera anymore. Make sure not to bump into the tripod. It will move a tiny bit and that is very visible once you convert your project to video. I had it happen to me once and I had to start all over again. Luckily I was only a hundred frames in or so.


What if you want a pan or a travel in your shot.


Although you could do it manually it might be better to use a motion controlled slider. I have no hands on experience on this but systems like Edelkrone's Sliderplus with action and target module can generate great repeatable results.

Conclusion


Making stop motion video's can be fun but attention to some details is important to create good results. I have made two video's so far and it took me about an evening a video to shoot it.




Friday, September 19, 2014

PRMan RMS 18: Some tips on Rendering in Maya



RMS 19 is around the corner and will be released this fall. The new RIS engine works different than the RMS 18 reyes and ray tracer hiders but these old hiders will still be available. So why not write an article on how to get decent quality images out and how to streamline your workflow. Some of the workflow tips will still be useful in RMS 19.


What are my render options while working on a scene?


There are three ways to get your previews rendered. You can use the internal renderer. The interactive re-render option or the PRMan external renderer.
  • The internal renderer: Works just like the Maya renderer or Mental Ray. My biggest problem with this method is that Maya becomes unresponsive while rendering. You can stop the render process by pressing Esc but you can't modify any parameters in Maya. You can only twiddle your thumbs while waiting.
  • The re-render option: In this mode the renderer will constantly update the image while Maya stays responsive. You can change settings on the fly and see them change in de Render View. I have seen people using it successfully. Personally speaking I do not have a great experience with it. It does sometimes freeze Maya as it is still a process within Maya. This can really disrupt the workflow. It works best when you output your image to "it" and not to the render view in Maya.
  • The PRMan external renderer: In this mode the scene gets exported en queued up in the Local Queue manager (or the farm if you have one) and then rendered by RenderMan Pro Server. The big benefit is that it is an external process which won't block Maya from being used once the scene is launched. It is slightly less interactive than the re-render mode but is very stable. Since it uses the Local Queue it is possible to queue up multiple renders. It also uses "it" which is superior image viewer compared to the Render View.



How to speed up your workflow by using the external renderer


RMS 18 has two modes of rendering: reyes or ray trace. Reyes is a hybrid renderer (used to be scan line only) and the other mode is of course a full ray tracer. They both produce excellent results but they respond slightly different to the quality settings. I have made a test scene with a pencil and three black spheres lit with an HDR map.

Let's have a look at those settings (click on the images to see a full res version):


Image1: RenderMan Globals: Quality tab and advanced tab. (click image to see full res).

Under the advanced tab you can choose your render mode (or also called hider) (right window on image 1). When choosing reyes there is not much else to set in the hider tab. When choosing ray trace it is possible to tweak some settings. I prefer the adaptive path tracer. When you check incremental the image will start rendering noisy but will improve over time. I really like this as you get immediate results but you can also wait for more details to show up while it continues calculating the image. It allows you to judge the image quickly so you can start making tweaks. The image keeps rendering while you make those shading tweaks in Maya or when updating texture maps. (but does not incorporate them until the next render). For me it means I can do two things at once.

Image 2: RenderMan Render Options

To set up you external renderer you need to adjust some setting in the RenderMan Render Options.

  • Check the external renderer and choose "it" as your image display or your image viewer.
  • Choose local queue and local render (unless you have a complete render farm at your finger tips).
  • Set the environment key to "rms-18.0-maya-2015 prman-18.0". Important: You do need to have the RenderMan Pro server installed for this to work.


How to simply adjust quality.


The next section shows some differences in quality. Make sure to click the images to see the actual differences between them. The blurred reflection on the spheres and the text on the pencil are good places to look.

Reyes is easily controllable with the shading rate setting (left window on the image 1). Large values will produce course quality but will render very fast. A shading rate of 5 will give very quick renders but your texture maps will look blurred. This can be enough to see if everything renders but isn't very great to check the detail in your maps while you are painting them. The letters on the pencil are unreadable. Check out the test image below (Image 3):


Image 3: Reyes: shading rate 5, pixel samples 3x3

When you lower the shading rate, the quality will improve. Production renders are always on a shading rate of 1 or lower (like 0.5). This will increase rendering time. On the next image (Image 4) I lowered the shading rate to 0.1 which makes the small letters on the pencil very readable but the render time was 7 times as high as shading rate 5.

Image 4: Reyes: shading rate 0.1, pixel samples 3x3

The quality controls work a bit different when you are using the ray tracer. In general you can leave the shading rate on 1. It is in fact the pixel samples which control the quality of the image (check right window on Image 1). You can see on the next image (Image 5) that the ray tracer shows the texture maps more clearly but has more problems with noise and anti-aliassing. It is very noticeable in the blurred reflections.

Image 5: Ray trace: shading rate 1, pixel samples 2x2

Increasing the pixel samples will render better quality but will increase render times exponentially. On the next image (Image 6) we can see that 4x4 pixel samples is enough for a still image without depth of field. It is very comparable to the high quality reyes image.Once you start adding movement or shallow depth of field it needs much more samples to get rid of the noisiness.

Image 6: Ray trace: shading rate 1: pixel samples 4x4



Conclusion


As you can see, both the good old reyes and the newer ray tracer produce excellent results. I tend to lean to the ray tracer as I like the incremental path tracer. It is just great so your image improve over time. It is a bit slower than reyes though but delivers very sharp images  when the pixel samples are set correctly.

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

Wednesday, April 23, 2014

My first impression of Maya 2015



Maya 2015 came out last week and for once I was quite excited with the new release. Maya now ships with Bifröst, a water simulation tool derived from Naiad. There are of course other features which also peaked my interest so here is a quick overview on what I like about the new Maya 2015.


The new stuff


Let me start with the simulation and dynamics updates.
  • Bifröst is by far the coolest feature added to Maya 2015. It allows you to make decent fluid simulations like the ones possible in Realflow. Some people on the net don't consider this big news but it saves you an extra license if you are on a tight budget and didn't have the luxury to buy extra software. Check the Autodesk channel on Youtube for nice examples. As I understand, the Bifröst implementation is not fully complete yet so there will be features missing but to me this is a great start.
  • XGen is a tool for grooming and styling hair but can also be utilised as a tool to populate landscapes and environments with plants and foliage.
  • Although the Bullet plug-in for Maya exists for quite a while now, it seems better integrated and usable in Maya 2015.

Some other mixed features which I like.

  • Texture deformers let you displace your geometry like a displacement map but it is applied straight on the geometry and can be seen in the viewport. Displacement maps do their magic at rendertime and so are harder to get right as you have to wait for your renderer to do the calculations. This could potentially be a nice time saver.
  • A lot of UV-tool improvements. Yes, Ptex is also supported in Mental Ray now but UVing is stil a very common and annoying job. Any tool that reduces the pain is welcome by me.
  • Viewport 2.0 is now the default viewport. I must admit that in the previous Maya releases I haven't used it all that much yet but I am quite happy to use this as a default now.
  • Mental Ray Progressive rendering in the IPR is a nice addition which other renderers like V-ray and PRMan already supported ages ago. This can also be a huge time saver.
Of course there are more new features than I mention here but these are the most important for me.

Where is Matchmover and Composite?


Matchmover and Composite came as free packages with Maya in the earlier versions but I was surprised (or maybe not) that these are no longer installed next to Maya 2015. I've tried Composite and never really liked it too much (I am more a Shake/Nuke adept) but I used Matchmover quite successfully in the past so I was miffed that it wasn't there anymore.

No panic though!
You can still find them on the Autodesk exchange Apps website. I could download them freely as a subscription member. They didn't get an update and it is basically the same version which came with Maya 2014. I suppose these will get to the end of their life sooner or later but you can still enjoy them for now.

Time for me to go and play a bit with Maya now.

Wednesday, November 06, 2013

Review: DJI Phantom Quadcopter



I have always been a fan of remote controlled devices. When I came across the DJI Phantom I was immediately sold. This not too expensive quadcopter can carry a GoPro camera and has built in GPS to make sure your camera returns safely back to you. I already own a GoPro Hero 2 and in combination with the Phantom you can shoot really cool footage.



Assembled Phantom and the rest of the box content.



Features of the Phantom


The Phantom is stable and easy to fly. It will just hover when you release the controls unlike RC helicopters which need constant adjustments during flight to stay in the same spot. That makes it ideal to take pictures and film. Thanks to the GPS it will even counter any wind and won't drift off. The more pro pilots can disable this feature and just have the altitude regulated or can disable any correction features all together and fly it fully manual.

The Phantom has great orientation lights. The Red and green LEDs give you a clear sense of direction, even when flying high up. They also make it possible to fly it at night.

To avoid disaster, the Phantom has some nice failsafes built in. It returns to your lift off location if the connection between your controller and the Phantom fails (provided you have good GPS reception). It also will go in landing mode when the batteries are nearly depleted instead of just dropping out of the sky when the voltage isn't high enough anymore.

A full charge will give you between 10 to 15 minutes of flight depending on the load it is carrying. The maximum speed is about 10 m/s.



What's in the box (or at least in mine)?


  • A quick start manual V1.0
  • The Phantom quadcopter
  • Two legs of landing gear with built in compass
  • A white remote control
  • 4 sets of propellors
  • 2 sets of decals
  • A special mount for the the GoPro camera
  • 1 LyPo battery
  • A balance charger with a set of universal plugs
  • Screws to mount the landing gear
  • A small wrench and 4 nuts to screw on the propellors
  • A USB extension cable
  • A spare USB convertor (USB to Micro USB)
The guys from DJI promise that it takes only minimal effort to assemble and getting the Phantom ready to fly.


Getting the Phantom ready to make its first flight.


The first thing you need to do is to read the manual. Although there is the promise of getting the Phantom quickly into the air, this is by no means a simple device and can become a potential hazard. Fast rotating propellors, even made of plastic, are dangerous. I don't recommend kids flying this thing.

A good source of information next to the quick start guide is the DJI website. You can find extra manuals, video's and the software to calibrate the compass and IMU. The software is unfortunately Windows only.

Before you do the calibration and assembly it is wise to start charging the battery. The charging cycle takes about 1 to 2 hours so it is a good idea to get that underway while you prepare the rest of the Phantom.


Calibration of the IMU


The heart of the Phantom is a NAZA-M + GPS multi-rotor auto pilot system. Part of that system is the IMU. It interprets the built in gyroscopes, accelerometers and the external compass. It is important to calibrate this system because faulty interpretation of the flight data might crash your Phantom.

You need a charged battery to start the calibration process. Always turn on the remote control first and then connect the battery to the Phantom.

The calibration is done by connecting the Phantom with the provided USB cable to the software. It is also wise at this stage to upgrade to the latest firmware and to start out with the standard calibration file which can also be downloaded from the DJI site.

You can also test the response of the remote control and recalibrate it if necessary. When all the updates and calibrations are done it is time to assemble the rest of the parts.


Phantom assembly


There are two plastic legs which need to be mounted on the body with four screws each to form the landing gear. One of the legs has the compass module on it and it needs to be connected with the 5-pin cable so data can be passed onto the IMU. The manual states that this step can be done after IMU calibration but the video shows it is better to screw on the legs and connect the compass before the calibration.

At this stage you can also screw on the connector plate for the GoPro camera if you're planning to film during flights.

The last bits to be assembled are the propellors. There are two different types so it is very important that you screw on the right propellor on the right motor. There are arrow marks on the Phantom and the propellors to make sure you screw on the right one. Make sure they are well tightened. Losing a propellor in mid flight is a fast but fatal way to land the Phantom. 


Calibration of the compass and the first flight


The last step is to calibrate the compass. It is best to do this outside, away from large pieces of metal or magnetic sources. It is one of the steps I neglected a bit and my Phantom wouldn't fly because of it. Remember the process to turn on the remote control first and only then connect the battery to the Phantom. The other way around will give you an error message.

It is possible that the compass is so out of wack that it can't be calibrated with the regular procedure. Through one of the video's I have learned you can get it back straight with a magnet.

Once this is all done you are ready for your first flight.




My personal experience


I am not great with reading manuals. I want to dive in immediately which is actually not a very good idea with a machine as complex as the Phantom. As stated above, read the manual first. I did skip some sections and later on I wondered why the Phantom didn't want to fly.

There was also a bit of confusion concerning the box content. It didn't match the manuals and the video's I have seen online. I did get 2 sets of spare rotor blades instead of 1 but you won't see me complaining about that.

My remote control is also different. It has an extra lever on the back and the throttle control is automatically centered. This was really confusing as one of the important steps for lift off is setting the throttle stick all the way down. This is impossible when a spring centers it. I even opened up the controller to see what was wrong with it. It was only after searching several online forums that I figured out I had the new controller type which they only starting shipping recently. The extra lever on the back is usable as a controller for tilting an optional gimbal.

The last problem I had was the connection between remote control and the Phantom. Although the Phantom itself indicated that there was a connection to the remote control, the software was unable to detect it. The remote control is supposed to be of the PPM type and this is also the default value in the standard calibration file. It was only after changing to D-Bus that it started to work. Again, the forums helped me figure out that this updated controller behaves a bit different. The documentation wasn't updated though which lead to this long search. 

It went all smoothly once I had it into the air. Well, except for landing that is. My first landings were a bit rough and I did cut some grass with the propellors. Once I figured out how to do it, I had no issues whatsoever.

Always check the weather forecasts for the wind speeds. Once it gets too windy, the Phantom really needs to fight it to stay in the same spot, becomes highly unstable and might crash. Since it's maximum speed is 10 m/s I tend not to fly when the wind is blowing faster than 8 m/s.

As you can see, it wasn't a complete walk in the park to get it into the air. Luckily the Phantom is very popular and there are many forums on which you can find a ton of information or ask questions to other Phantom owners. Overall I am very happy with the Phantom. I got mine for 419€.


Flying the Phantom with the GoPro Hero2


Using the GoPro Hero 2 to take pictures. I did some basic grading and removed the lens distortion.


The Phantom is designed to fly with the GoPro Hero3 in mind. That said, it also works with previous models like the Hero2. When checking other people's footage I noticed there was a consensus among all Phantom and GoPro owners that the footage had problems with what they call the jello effect. This is because of micro vibrations that get transferred from the Phantom to the camera during flight. It makes the footage rather unusable for anything professional.

There are a couple of things you can do to avoid this effect.

You can do it the expensive way by getting a gimbal. This is by far the best option and gives extra benefits like camera tilt control. The gimbal is more expensive than the Phantom so it wasn't an option for me (for the time being at least).

Another option is to put some foam or rubber between the Phantom and the connection piece for the camera. This will absorb some of the micro vibrations. This did work for me and it removed them to an acceptable level although not completely.

A last trick is to balance the propellors by sanding off excess weight of one side. There are some handy balancing gizmos on the market which makes it easy enough to get it right. So far I haven't tried this option myself as I was making rough landings which wasn't great for the propellors. Every time you damage your propellors a bit they might become unbalanced again and you have to start all over again.


Some last tips to get better footage and photos.





It is good practice to shoot at 50 (or 60) fps. The footage will look more stable when slowing it down to 25 (or 30) fps during the edit.

It is better to use the camera housing which ships with your GoPro Camera. It protects it from impact should you crash your Phantom.

Another trick to stabilize your footage it to use After Effects Warp Stabilizer. You will loose some resolution but it works like a charm.

The GoPro has quite a bit of lens distortion. This is something you want to get rid of when just shooting still images. Camera Raw which is accessible trough Adobe Bridge has built in lens profiles for the Hero3. Using the Hero3 silver setting also works for the Hero2 camera. This eliminates the lens distortion and is great when shooting panorama's or buildings.



Links:


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