I'm currently moving to Houdini for background work, in the context of "traditional" hand-drawn animation, and one mission-critical procedure that remains to be worked out is that of so-called camera projection mapping, i.e., texture mapping using the projection defined by a camera (typically not the taking camera), basically creating a slide projector from a camera. Our usual workflow is something like this:
- Create rough 3D "layout" scene (based on storyboard, 2D layout, or previz)
- Render out guide frames corresponding to extremes and/or intermediate camera positions (depending on range of camera motion required for the shot and other particulars). Each guide frame will have a corresponding static projector-camera for subsequent projection of our matte painting back into the scene.
- Create initial matte painting at best position and then project this painting onto guide geometry from corresponding projector
- Refine geometry as necessary to show off the "shape" of the painted background's subject, to make it seem like more than a flat painting. This might only be the most rudimentary of models, but with bumps or indentations or overhangs in just the right locations to sell the illusion. Other times, the geometry might be a more detailed 3D representation of what's in the painting. The important thing is that the model(s) gets textured (and lit!) in the painting, from the POV of our projectors, so that only surfaces visible by the viewer are fully realized.
- Create secondary paintings from other camera positions to cover areas that might be hidden in initial painting, but revealed during the move
- Refine, refine, refine...
You can see an example of our technique here (in Japanese, sorry)
https://youtu.be/P9oRNa8z9Fs?t=491 [youtu.be]
From around 8m11s. We did many hundreds of shots like this on that particular show, to great effect IMHO. There's also some examples of this "2.5D" method in an earlier project I was involved in:
https://streamable.com/k9v6o [streamable.com]
Anyways, in Houdini, creating a UV texture with type "Perspective From Camera" is a fine way to start out "camera projecting" matte paintings onto our guide geometry. Wonderful workflow to this tool, as far as it goes. But the resulting texture mapping is afflicted by warping distortion in areas of low mesh density or where the incoming primary ray's incident angle deviates from head-on. The only way to surmount this is to subdivide the mesh, but this turns out to be an exercise in diminishing returns... In olden times we'd have remedied this by resorting to an "implicit texture" (I guess that's Softimage/XSI nomenclature) to force our renderer to derive the texture projection at render time, in a shader, per-sample, based on an ideal camera projection, rather than relying on per-vertex UV data to be interpolated across the polygon (a so-called "explicit" texture mapping). The problem with the explicit method, of course, is that the UV lookup gets less accurate in the interior of a polygon, as a function of the UV interpolation.
I've found some posts and wonderful tutorials regarding use of the to/from NDC operators to get us in and out of camera space. In the context of a Point VOP to/from NDC even allow us to specify which camera (as does the UV Texture tool). But the in-shader variants of the to/from NDC operators always assume that the camera in question is the taking camera and does not allow for an arbitrary camera to be specified (to be fair, that would usually be a valid assumption).
Using a light as a slide projector seems to be one work around, albeit a relatively cumbersome one since it requires conversion of camera lens parameters (focal length and x/y window offset) to analogous light parameters, and managing of lights. And one of the key benefits of using actual cameras is that it is very easy to stop and render additional frame at any point along the move, copy cameras at the new positions, tweak, re-render, have access to all the ancillary features particular to cameras and texture mapping as well, etc., etc. whereas with lights, not so much
I've looked around a fair bit, here and a couple other posts, and have failed to find any good out-of-the-box solutions. Given the plethora of staggeringly complex tools on offer in Houdini, it's hard for me to accept that there's not one hidden somewhere... Anything?
Please forgive the newbie nature of this post. Any helpful replies very much appreciated!
m