Has anyone got any pointers about how to control the range of focus with a Vray physical camera and in-camera depth of field? I usually hook up a distance dimension node to the focus distance to control the most in-focus point in the scene, but this doesn't help with controlling the range of foreground and background focus. This seems to be a tricky and tedious process of adjusting camera attributes such as F stop and shutter speed, rendering, rinse repeat. (Yeah, I know this is kind of the point of the physical camera). But does anyone have any clever ideas about how to speed this up? I guess with some smart scripting you could create a couple of planes that would represent the nearest and farthest point of focus and some expressions to control correct exposure. Probably beyond my scripting skills though.
Announcement
Collapse
No announcement yet.
Controlling depth of field
Collapse
X
-
This'll give you a bit of the background, I'll try and come back with more later!
http://joconnell.com/2010/12/depth-of-field-in-vray/
Comment
-
Thanks. Some good info in there although I already have an understanding of how film and cameras work -- was really asking if anyone had any ideas about how to control exposure and range of focus in Vray without having to do endless test renders to get it "just right". I don't have a better approach than setting my focus distance to the desired point in the scene, then starting to test until I get the range of focus and the exposure I want. It can be a bit head spinning though as I constantly have to remind myself which attrs. need to go up in value and which down, and which way exposure and depth of field will go as a result. It would be great to have a tool which allowed you to set a range of focus and then dial in exposure separately. I'm sure this could be scripted -- I'm thinking the range of focus could be represented by two vertical planes in the 3D scene. The placement of these would drive at least one attr. on the camera (e.g. shutter speed), multiplying it by another attribute (e.g. ISO) so that you could dial exposure up and down while keeping the same range of focus. Or something along those lines....
Comment
-
Here's a procedure I wrote to hook up a distance dimension node to a physical cam. At least this allows you to set your focal point interactively:
global proc SD_makeVrayDOFCam()
{
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 -horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1; objectMoveCommand; cameraMakeNode 1 "";
$cams = `ls -sl`;
$camShape = `listRelatives -shapes`;
vray addAttributesFromGroup $camShape "vray_cameraPhysical" 1;
setAttr ($camShape[0] + ".vrayCameraPhysicalOn") 1;
setAttr ($camShape[0] + ".vrayCameraPhysicalSpecifyFocus") 1;
setAttr ($camShape[0] + ".vrayCameraPhysicalUseDof") 1;
setAttr ($camShape[0] + ".vrayCameraPhysicalBladesEnable") 1;
$distance = `distanceDimension -sp -0 0 0 -ep 0 0 -5`;
$locs = `listConnections -t locator $distance`;
pointConstraint $cams $locs[0];
select -r $distance;
$distanceShape = `pickWalk -direction down`;
connectAttr -f ($distanceShape[0] + ".distance") ($camShape[0] + ".vrayCameraPhysicalFocusDistance");
}
Comment
Comment