Metadata cameras and worldspace intersection passes

We’ve been working on a stereoscopic production, and we’ve been coming up with helpful tricks to make things just a tiny bit easier.  Here’s an example comp that shows a couple of them.

Position Pass and Camera Metadata Screengrab

Position Pass and Camera Metadata Screengrab

The first is the embedding and extraction of a camera transform from the metadata of an EXR.   3ds max (and some other packages) write out the position, rotation, field of view, etc. to the metadata of EXR outputs.  Since we use this file format a lot, it’s a pretty easy thing to use in production, as it doesn’t require a special operation to export the data from the 3D scene.  It’s not as flexible as outputting an FBX, but it can be done without opening (or even finding) the 3D file.  The transform is stored in the metadata as a 4×4 float matrix, and using SimpleExpressions, you can apply the transform to a Fusion 3D Camera per-frame.  If you’ve ever used RPF files with Combustion, you’re probably already familiar with the workflow, we’re just doing that with EXR’s and Fusion now.

The second technique is the rendering of a worldspace intersection pass.  By rendering the location of the surface as an RGB vector, you can find the location, per pixel, of each sample in the render.  Combined with even a hardware rendered “beauty pass”, you can easily place your render into the “world”.  You’re limited to only seeing the first intersections, and only what the camera sees, but in many cases that’s all you need to see.  It’s smaller and faster than an animated FBX sequence, and you can play around with it with image tools.

The fun part is combining these techniques, getting both the shape of your scene and the location of your camera in one quickly rendered EXR sequence.  You can then use this information to try out some various camera separation and convergence setups using the stereoscopic rendering of Fusion, which can range from simple anaglyph to  full quad-buffer shutter setups.  The quality isn’t great, but it’s interactive, and until 3ds max gets better rendering of stereoscopy in the viewports, it’s a fast way to test out camera settings.

The pass and the camera can also be used in the composite as well, for making mattes, placing elements, etc.

Download Position Pass and Camera Metadata example Download Position Pass and Camera Metadata example

(85MB .rar file)

3 Responses

  1. Daniel Koch Says:

    Hi Chad – this all works rather nicely :-) The matrix-camera in particular would be handy – considered throwing it up on vfxpedia?

    Also, have you tried taking your beauty pass as an image plane and (shh) Displacing it with your position pass (RGB, Absolute, Scale=1)? Works pretty well, much faster than particles, though you do need to bump up the plane subdivision a little if you want to view in stereo.

  2. Chad Says:

    Yeah, we’re pretty low traffic, so a simple “(shh)” works well. :)

    The matrix camera thing is one of the reasons why I want 3D Fuses. Otherwise, getting the matrix out of the 3Rn is tricky. Not impossible though… Hmmm… Anyway, would be cool to round trip that sort of data. Oh, and the table datatype in metadata is mysterious, as is table output (or matrix) from a tool.

    The thing with particles is that you can avoid filtering them so that any discontinuous surfaces represented by large derivatives show up as broken, as opposed to streaked.

    But otherwise… Yeah, who do you think keeps putting the good requests on the VFXPedia wishlist, anyway? :)

  3. Chad Says:

    Updated to show the Displace3D in action. Worth noting that without Displace3D being multithreaded (or a vertex shader), it could easily be the limiting factor in a simple stereoscopic test like this.

    http://www.anatomicaltravel.com/research/2010/07/displace3d-and-explicit-vectors/

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.