
The Making of Slow Decay - Page 6 |
|
| << Previous Page 1 2 3 4 5 6 |
|
RENDERING - with Mental Ray It's not just a click and let the computer do the calculations. Whey you create the complex scenes like this one many difficulties and problems may come. Not enough memory to render the scene was one of the main with this one. I have had 1 gb of memory in my computer, which is not so small, but it was not enough ... especially when you try to render from Maya. Scene, when loaded in Maya took about 400 mb of ram, so in such cases forget about rendering directly from Maya and stick to the command line. Let's pass through some useful rendering stuff... Resolution It is up to you to pick the final resolution of the image, but remember, the higher the resolution, the more details will be visible. So this should be one of the first decisions that you have to make when creating 3d pictures. For this one I have used 1280x960 resolution, which is pretty big since the target media is internet. Why 960 you ask and not 1024... well because the proportions of this resolution is standard 4:3, like 800x600, or 1600x1200. If you want to work in some other resolution like 1280x600, when you type this resolution in mental ray tab the pixel aspect ratio will automatically change, which is what we don't want, and since it is faded you can not set it back to 1. But there is a little trick.... switch to Maya render, then set the pixel aspect to 1 and then go back to mental ray. The usual problem, when using higher resolution to render image, can appear in the textures that you use. I don't mean procedural ones, but image maps. If they are low resolution then they can appear blurry with lack of details. That's why you have to have this in mind when creating image maps. Samples and Filtering In this particular image I have set the sampling to min 0 and max 2. This means that mental ray will take minimal 1 sample per pixel and maximum 16. Since this is the still picture it is enough. One more thing that is tightly connected to the sampling is the contrast threshold value. By setting the lower threshold value you tell renderer to use more samples when needed. For example if the value difference between two nearby samples is 0.2 and the threshold is set the 0.1 then mental ray will use more samples to sample this area until the difference drops below 0.1. But, the depth of this division is bounded by the max samples value. So if the threshold value is not reached and mental ray already sampled the pixel with 16 samples then it will stop and go to the next pixel. That's how these things work. In my case, as I mentioned before, max sampling set to 2 is enough for final render. But in cases where you do the test render you can drop this to min -1 and max 1, and set the threshold to 0.2 This will save a lot of precious time when rendering. The filtering is another very useful and evident thing. What it does is that it, as the name says, filters samples collected when reconstructing one pixel of the image. There are five types of filter in mental ray. The default one is box... the faster of these ones but not so good like some others. For my image I have used the Mitchell filter. The image rendered with this filter will look a little sharper compared to gaussian but less sharper compared to Lancos. There is fine explanation in mental ray manual about these filters. Raytracing This is not very raytracing intensive scene when it comes to reflection and refraction. There are only few refractive and reflective elements in the scene, but there are many lights that use retraced shadows, so this will be the main concern of retracing engine. Because of that I have set the reflections to 1 and refractions to 2. This means that when the light is shot from the camera to trace the value it can be refracted two times until it returns the value. This will not be enough in cases when you have the scene with lots of refractive glass objects, but in this situation it is enough. BSP acceleration The binary space partitioning is mental ray algorithm to accelerate the raytracing calculations in the scene. It consumes memory but the speed increase, when using it, can be drastically. The BSP algorithm, as I understand, divides the scene with the bounding boxes or voxels that are recursively created around the bunch of polygons. So, for example when you set the BSP size to 10 that means that mental ray will try to divide the space with voxels so many times needed to bound the 10 polygons in one of these voxels. The other value, BSP Depth limits the depth of that BSP divisions. So for example if BSP Depth is set to 50, and BSP has divided the space 50 times but it still has the 40 polygons in one voxel it will not divide it further since it reached max depth which was limited to 50. The values that I have used in my image were 16 for the Size and 45 for the Depth. This means that BSP will be subdivided maximal 45 times to try to reach the 16 polygon in one BSP Box. I have also set the Large BSP options for the memory sake reasons. The BSP when it is created takes a lot of memory, and what Large BSP does, is that it caches some part of that BSP tree on the hard disk and frees up the main memory to do the other calculations. Once the renderer needs the information about the part of BSP Tree in rendering process it will load the cached BSP from drive to the memory and use it. According to mental ray manual this makes render a 20% slower, but it is necessary for the scenes like this one. It's best to experiment with these values. For one scene, for example, the best values will be 10 50 ... in some other maybe 14 45 or 8 40 ... you will never know if you don't try it. But remember, the BSP takes memory so don't go too low with size and too high with depth. |
|
Memory Limit In the same section (Memory and Performance) where BSP stuff is the memory limit needs to be set. Since I had 1 gb of ram I have set the limit to 800 MB. Do not let mental ray use all of your memory, since if it takes all of it, the memory segmentation problems may occur and mental ray can crash. That's why it is recommended to use the lower size of memory limit than the size of your memory. Memory Mapped Textures Another thing that I started to use when rendering with mental ray are memory-mapped textures. This is nothing else but the textures converted to special mental ray image format, which can be internally read by mental ray without the need to convert it. For example if you have 10 textures in jpg format which are applied to the object you are rendering, all of these textures need to be loaded to main memory and decompressed, and then mental ray can use them. But when you do the conversions by yourself, then try to render the image, mental ray will directly access these textures without the need for the task of decompressing, and save a lot of memory and time. There is a simple script that my friend Tom created at the company I am working in ... and what this script does is that it collects all information about the image textures in the scene, converts them to the .map format and copies them to the source images/ directory. Just copy the script to the Maya/Scripts/others directory. Once you need it just go to the script editor, click file > source script and '2map.mel'... this will ignite the conversion process of all image maps that you have in scene. I don't know for sure from which format can be converted to map, but I know that it can handle JPG, TGA and TIFF. You can also do the conversion manually. Just go to the directory where your image is (jpg, tif, tga...) and type:
imf_copy imagename.jpg newimagename.map
Z Depth Channel To turn on the Z depth rendering, just go to the Mental Ray render globals and in Common menu check the Depth Channel flag. If you are rendering in the IFF format then the Z depth channel will be created within the image file, but if you are rendering in some other format then the separate image file with z depth will be created. For this situation, and every other before I have used the standard IFF file format, which can be read by all respectable post processing software. Rendering from Command Prompt When you prepare the scene for rendering, quit the Maya and jump to the command line. I would suggest, when rendering scenes that eats memory, close every program that you can, to free up some memory. When you are in the directory where your Maya scene is just type:
mayarender_with_mr scenename.mb
COMPOSITION - Why to do everything in 3d? Yes, why? In the time when I was still using the POVRay to render my images, I tend to do everything in 3D. The result from the POVRay was the final image. But as time passed, I learned a lot about how to do stuff faster and better. One of the big time optimization factors lies in post processing programs like Digital Fusion, so if you haven't explored or used some of this programs before, I suggest you do so. The fog was the main reason why I have rendered depth map channel with the image. With this channel post-processing program can easily extract the depth of the elements in the image and use this to fade them to simulate the fog effect. You can also easily in tweak it or color it in real time, without the need to render the image once more. This makes this process way faster. The image below shows the Z depth channel of the rendered image. |
|
|
and the exaggerated fog extracted from the top image: |
|
|
But fog wasn't the only thing that I have done in post processing. I have also made a few color corrections, and added some grain to give a little noise to the image. This makes the image look more like a print, not so clean, and it makes the final image a little more real. The example of the image corrections that I have made in post process can be visible in next two pictures. First, the original, which came out of the renderer: |
|
|
... and the one with the color corrections: |
|
|
As you can see, the difference is very noticeable. Color corrections that I have used in this image were made on the whole image. But in some cases you would want to make the corrections on the particular objects in the image. The one way to do this is to restrict the area on which color corrector works. This can be done either with the mask painting, which is not so precise, or by rendering the mask from the Maya. If you decide to render the mask in Maya this is what you need to do. Create two surface shaders. For the first one set the color to black and for the second to white. Apply the first one to every object in the scene and the second one to the object, which you want to get mask, and render the image. After the rendering, you will get perfect black and white image, which isolates the particular object on which you want to do the color corrections. Now load that image in post processing program and use it to restrict the color corrector area. There is one more thing which you can do in post processing and that is to apply the ambient occlusion map to the final render. You already saw the example of the ambient occlusion renderer, and you have learned the way to do it. But let's see it one more time: |
[Click Here to View Large Image]
|
|
To see things a little bit better I will apply the ambient occlusion map to the next render which is the image without the textures: |
[Click Here to View Large Image]
|
|
And with the occ over it: |
[Click Here to View Large Image]
|
|
Now if you compare the picture with and without the ambient occlusion you will easily see the difference. Some details, particularly the ones that are at the edges where surfaces intersect are a little bit darker while the others keep their color values. So how to apply the ambient occlusion image to the original.... just load photoshop and put the ambient occlusion image over the main image layer and change layer blending mode to multiply. What I also did is that I have played with the Curves (Ctrl+M) a little bit to change the intensity of the ambient occlusion image. You can also fade it a little bit if you think that it is pushing details too far into the dark. That's it. Not too much about the post processing, but enough to make life easier. ;) Well, my 3d friends, that's all for now. Hope that you will come to see my next tutorial-overview when it comes out. ;) Also be free to email me if you don't understand some parts. |
| << Previous Page 1 2 3 4 5 6 |