Thursday, May 23, 2013

Class03 - Camera Projection - filmback - interior lighting with HDR image


Building a virtual set, 3D camera matching, and MR productions shaders


For this class we will use an interior HDR panoramic I shot with some background plates, others are avail free on the web.


Summary: 1)building a simple virtual set 2)camera match your 3D camera to a plate 3)using MR production shaders, lookup_sphereical, mip_cameramap, and rayswitch_environment, create and position your IBL network. 4)add lights in the scene to match real world lights.  
5) break out into render layers for composite in Nuke.

DEMO: begin by building the hallways and wall in exact physical scale, then bring in plate image, then do the 3D camera match using filmback and focal length for Nikon D40 (.933 x .614) sensor scale of 1.519.  Make your render res match the plate, then hit fit to resolution, check with a render.

- Maya needs Camera Aperture values in inches.
- Read the exif data of your bg plate using Adobe Bridge or Lightroom.
- Find what camera shot your bg plate, find the film back values, or image sensor size which will be listed in mm, put this into your maya camera.
- If your camera is cheaper and has a cropped sensor, APS-C, then multiply the true focal length by 1.52 and put that into your maya focal length.
- Maya focal length wants the “35mm film equivalent” focal length.


Very good description of camera sensor size with the math behind calculating filmback.
http://earlyworm.org/2012/filmbacks-and-sensor-sizes-for-matchmoving/

Replace imageplane with mip_cameramap -> rayswitch_env -> camera
Replace IBL with mib_lookup_sphereical -> rayswitch_env -> camera
Rotate position of the ibl with IPR until -8.65 hallway in correct position
Create shader for ground mip_cameramap -> mip_matteshadow

Unfortunately mib_lookup_sphereical is difficult to interactively place as there is only radians rotate to position your HDR pano.  I will use sIBL to hack a solution to the rotation I want, or you can mel script this.
explain how rotation works differently (radians) for mib_lookup_sphereical then maya IBL
degrees = radians * (180/pi)
pi = 3.141
rad = degrees/(180/3.141)
Example
deg_to_rad(90)Returns 1.571, which is the same as pi/2.
Here is the sIBL solution
sIBL_lighting_mib_lookup_spherical.rotate = deg_to_rad(sIBL_feedback.rotateY/2);

First you use a normal IBL in maya to rotate your HDR pano correctly.
for example we have rotY=67
to match that exactly with your two spherical lookup nodes
spherical.rot = (67/2) / 57.29578 = .5847
remember that this magic number 57.29578 is 180/pi

hi,
the mapping used by mib_lookup_spherical can be found in the baseenviron.c code which is available from mental images ftp site.
The mib_texture_remap node is simply a transformation matrix so you can use it to flip, rotate, etc the environment shader. By simply scaling it in the x axis by -1, it matches IBL node of maya. Then you can simply apply rotation using again the remap matrix.
note that the you also need mib_texture_vector which goes in the input of the mib_rexture_remap
the output of mib_texure_remap is then plugged into the dir parameter of mib_sherical_lookup
hope it helps...
patrick

When you need to blur some random HDR you download from the web, use Diffuse_SH (spherical harmonics) Panoramic blur, that correctly wraps around the edges and compensates for distortion on nadir and zenith. This mimics the result of a diļ¬€use convolution function, but it runs much faster because it technically is just a special implementation of a multiple box blur.

CONCLUDE: 1)when shooting plates, take as many site specific measurements as possible 2)carefully build a simple real world set, and place camera accurately 3)place lights to match the strongest lights in your HDR image


No comments:

Post a Comment