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

Tuesday, February 24, 2009

To Premult or not to Premult

Now, I've known that 3D elements rendered out of Maya need to unpremultiplied before compositing, but I still wasn't sure when exactly I needed to do it.

I stumbled onto a document at work today that explains the rule:
  1. Unpremult before any color correction, and pre-mult after
  2. There's no need to unpremult before filtering options like blur because these operations should affect the alpha channel
Example:

Without un-premultiplying:



With: 

It's subtle, but the white 1-pixel halo around the green character's arm is gone. 

Friday, January 16, 2009

Composite Breakdown

I started off compositing in After Effects, but have since shifted over to Nuke. I was reluctant to learn another piece of software at first because I had already had to learn how to use Massive, RenderMan for Maya, IQ, Motion Builder and others for this film. But I'm glad I gave Nuke a shot, because it has turned out to be a lightweight, fast and intuitive package.

I like rendering in layers, it gives me a lot more control in the composite.

For example:


Render Layers:
  • Character (from multipass render):
  • Middleground Crowd:

  • Background Crowd:

  • Ground:


  • Platform:

  • Sky:

Result of combining the layers with no compositing:

Final composite (after color correction and addition of atmospheric elements):


Working in 16-bit color is also very useful, as it expands the range within which you can color correct the image without creating artifacts.

Thursday, January 15, 2009

Render Workflow Overview

The main reasons for using RenderMan for Maya as my renderer are:
  1. Speed, especially when scenes are not raytraced
  2. Fast motion blur, which is important in my film
  3. Good memory management, which means fewer crashes (my Maya files contain anywhere between 2 and 200 characters, and can get as large as .5 GB)
  4. Render-time smoothing (i.e. subdivision scheme) enables me to avoid heavy polygon meshes in my already huge scenes
  5. Integration with Massive - initially, I was going to use Massive's direct integration with RenderMan, but have since abandoned this approach
  6. I'm a geek - I've always wanted to learn more about RenderMan because of its role in the history of CG
Due to time and resource constraints, I can't render everything with all the bells and whistles I like. I've avoided ray tracing because the size of my scenes would probably cause all sorts of memory issues and require heavy optimization. As a substitute, I've relied on RenderMan for Maya's point cloud occlusion, which is a non-raytraced solution. Even with this feature, however, I can't render entire scenes in a reasonable time frame. (i.e. less than 10 minutes per frame as I only have access to 4-6 render nodes at a time).

Therefore, I only use occlusion on the 'hero' characters such as Bir, his mother, the old man, the goons, etc. For the rest of the characters and the set, I baked the occlusion into the respective file textures using Mental Ray. While baked occlusion doesn't look as good as the real thing, the rendering speedup makes it a worthwhile compromise.

So for example, a multipass exr might contain:

DiffuseDirect:

DiffuseIndirect (i.e. Shadowing):

DiffuseEnvironment:

OcclusionIndirect (i.e. Ambient Occlusion):

alpha:

Put the above layers together*, and you get:

Beauty:



Initially, I was rendering out all my render layers (such as the background, sky, etc) into multipass EXRs, but found that it was overkill and I really just needed that extra level of control on the hero characters.

* The actual compositing operations are:
(DiffuseDirect - DiffuseDirectShadow + DiffuseEnvironment) * OcclusionIndirect

** I left out the Specular components for simplicity, but the math is the same as for Diffuse

Wednesday, October 8, 2008

RenderMan for Maya Notes

There's not a whole lot of RenderMan for Maya tutorials out there, so I'm collecting all the little nuggets I've gotten from various blogs on this post:

Turn off the default Final pass that contains all the objects in the scene (useful when rendering out multiple passes)
setAttr "rmanFinalGlobals.rman__torattr___computeBehavior" 0;

To generate a shadow pass
Use the 'Occlusion Direct' ancillary output

To generate a multi-pass OpenEXR
In the pass, under Output, right-click and select Create Output->Custom. This pops open a list from which you can select multiple outputs
For 16-bit vs 32-bit, under Extra Output Settings for the pass, select and add 'OpenEXR Pixel Type'. 'Half' is 16-bit and 'Float' is 32-bit.

To create a Matte
Select a Material, open the Attribute Editor and add the custom RenderMan for Maya attribute "Matte Object". This attribute works the same way as the "Black Hole" setting in Maya Software/Mental Ray.

Jordan Reece Halsey's blog has a good tutorial that walks through a Global Illumination example using point-based techniques.

Confused about shading rate and the render quality in general? Check out:
http://www.renderman.org/RMR/st/PRMan_Filtering/Filtering_In_PRMan.html


Cheat Sheet from above site:
"
  • ShadingRate - should be 0.25 or smaller for final images. Smaller shading rates may be needed for large displacements. Larger shading rates may be needed if the render is too slow, but image quality will suffer.
  • PixelSamples - should be at least 8 in each direction for a shading rate of 0.25 and should never be less than 2 / sqrt(ShadingRate). Even numbers of samples are more efficient for many kernels. Larger numbers of samples may be needed for motion blur.
  • ShadingInterpolation - should be "smooth".
  • PixelFilter - start with the mitchell 4.0 filter. To soften and/or reduce aliasing, increase the width up to 5.0 (fractions are ok!). For a sharper filter, use a custom Mitchell with controllable sharpness (using a RIF plugin for example); or, use one of the recommended standard filters: separable-catmull-rom 4.0, lanczos 4.0 to 6.0.
"

I don't go below 0.5 for my own shading rate, and usually stay at 1, and use the relationships defined above to compute the appropriate parameters for my renders.
--------
Also, when enabling Motion Blur, values of Motion Factor greater than 1 automatically drop the shading rate of motion blurred objects, which may or may not be desirable. I use this feature to speed up my Ambient Occlusion pass because AO is more noticeable when the object is not moving.





Sunday, September 28, 2008

Shot 3 Comped

Took the settings of the last couple of shots, then added haze and subtle grain, blurred the horizon, added a ramp to the sky, and crushed the blacks a little (composited in After Effects).



Shake has been discontinued, and the compositor that everyone is shifting to is Nuke, but for my film, I'm thinking of continuing with After Effects because I'm happy with these results and AE now handles .iff files, which is what I render out of Maya.

Friday, September 26, 2008

Monday, September 22, 2008

More Style Frames

Finally started to render today. Did a quick style frame for fun.

Before:



After Color Correction:


Update - a couple more iterations that I went through on the look:

~December 2008



Final image:
~May 2009