Document: DoF+DRL Link: https://horo.ch/docs/mine/pdf/DoF+DRL.pdf DoF and DoF Ring Lens DoF is Depth of Field. It depicts a part in a certain distance focused and what is nearer or farther away progressively less focused. With the DoF Ring Lens (DRL), the focused part is a ring and what is outside the ring gets blurred. DoF Depending on the aperture of the camera lens, more or less light reaches the film or sensor. The aperture is also called the lens speed and it is denoted in the ratio of a lossless lens to the actual lens. The best so far on the market you can buy has an aperture of 1:1.2 if the dia-phragm is fully open. Because the ratio is always 1 to something, it is abbreviated as f/1.2 and called f/stop. An f/stop (or f-stop) corresponds to a factor of square root 2. So a lens set at f/1.4 lets only half the light received to the sensor, at f/2 only a fourth. But the light sent to the sensor can also be controlled with the shutter speed (exposure time). However, a lens with a wide aperture like f/1.4 depicts a smaller range of depth than one with an aperture of f/16 which may depict most or the whole distance range sharp. As far as the light is concerned the Bryce camera "lens" has f/1, the theoretical full aperture to get all the light there is and at the same time an infinite small aperture of f/1000000… and thus depicts everything in full focus near and far from the camera, depth of field is infinite. Setting DoF in Bryce The Bryce camera lens can be set to a wider diameter than 0 to create depth of field. At the same time, the focal length can be set so that the part in the desired distance is in focus and what is nearer to - and farther away from - the camera less in focus. As the picture at right shows this can be done in the Render Options. It must be set to Premium and Depth of Field must be selected. [Picture] Lens Radius does what f/stop does, though it is not quite clear what the value entered means. One would think 1 means the full width of the lens and 0.25 as in the example one fourth of the full size. In fact, the smaller the number, the wider the DoF, the higher the number the narrower DoF gets. That makes sense, but you can also set it to 10 (ten times the lens radius) and DoF does get very narrow - but the number as such does not make sense in a photographic context. But who cares? It works. Focal Length works like in a traditional camera and the units are not metres but Bryce Units (BU). Insert an object into the scene where you want the focus and click on Set To Current Selection. This will enter the value for the centre of the object into the Focal Length field, 20.48 in the example. Now the object can be deleted or just set to Hidden. Rays per pixel should be set according to render the most blurred part with the least visible noise. The higher Lens Radius is set, the more blurred the parts out of focus get and the more visible the noise gets. Render with 9 or 16 Rays per pixel (rpp) to test how the scene looks with the DoF settings and increase rpp for the final render. A time saving method is to Plop-Render the most critical parts to find out what rpp setting is needed. <<<< Page 2 >>>> Example Renders The render at right has no DoF. The nearest object with the checker pattern is 100 BU from the camera (90 - 110), the five light houses 400 BU. The terrain is between 900 and 4900 BU with the blue wall at 2450 and the red one at 3450 BU (middle 2950). The HDRI is in the background at "infinite" distance. The white lines are 5 degrees apart so the width of the picture is 120°. [Picture] The pictures are all 800 px wide and 500 px high. Adjust the viewer size so that you can see the details in the pictures. Below, LR is Lens Radius and FL Focal Length in BU. [3 x 3 Pictures] From top to bottom shows how increasing the Lens Radius narrows the part in focus; from left to right shows how the focus is moved in the distance with Focal Length. Using DoF to focus a particular part of the scene is very effective; unfortunately, it increases the time to render often considerable. Render time quadruples from 4 to 16 to 64 to 256 rpp and from 9 to 36 to 144; it about doubles from 4 to 9 to 16 to 36 to 64 to 144. Ring DoF The kind of Depth of Field we know from photography and (now) from Bryce works on the whole plane into the distance. There is no difference in sharp and blur from left to right and bottom to top, just the distance of the object from the camera makes the difference. For special effects, a ring can be made well focused and the rest blurred. <<<< Page 3 >>>> The idea of a lens that focuses the centre and blurs the perimeter came as a side observation to David Brinnen while we were working on the wide-angle fisheye lenses to be "bolted" in front of the Bryce camera. When I re-discovered what we did years ago, I started to experiment with it. Not something you will use on a daily basis but nevertheless an interesting option for some special scenes. The DoF Ring Lens (DRL) The lens is a sphere at default size of X=Y=Z 20.48 at exactly the camera position: the camera is in the exact centre of the sphere. The sphere is set to the default material in the MatLab then set Diffusion to 0 and Transparency to 100, Refraction is at default 100. The sphere is invisible; the rendered scene looks exactly like the one on top right on the previous page. Focal Length must be set to the radius of the sphere: 10.24, Lens Radius affects how strong the DoF is, like above, but stronger. The size of the ring or torus depends on the Refraction setting of the transparent sphere. If set to 0, the centre of the picture is well focused from near to far but at the fringes it begins to blur. When Refraction is increased, a well-focused ring appears, its centre and periphery get progressively blurred by the amount set by Lens Radius. Below are nine example renders, the base is the picture on top right on the previous page. LR is Lens Radius and MR is the Material Refraction. [3 x 3 Pictures] From top to bottom shows how increasing the Lens Radius narrows the part in focus; from left to right show how the Refraction moved the ring farther from the centre. Lens Size: The examples used the default size of the sphere. If it is set smaller like 10.24 the sharp part gets narrower, if set bigger e.g. 40.96 wider, similar to Lens Radius. <<<< Page 4 >>>> Approximate Refraction Settings for Focused Ring Sizes These are approximate values determined visually as shown below and give you a hint where to start. The Range is plus/minus degrees from the image centre. The range of the transition from focused to blurred depends on the Lens Radius setting. The smaller it is set, the narrower the transition and vice versa. At Refraction 0, the centre is focused, there is no ring. [Table] Four renders that show the focused ring. MR is Refraction; FoV is the camera FOV and Scale. Examples: 50/100 is FOV 50°, Scale 100, 180/54 is FOV 180°, Scale 54. [4 Pictures] The RibCage HDRI is shown; the zenith is at the centre and the horizon beyond the image frame. The blue circle is 45° above the horizon (and thus below the zenith), the distance between the circles and lines is 5°. The numbers count from the horizon to the zenith. So 75 is 75° above the horizon and 15° below the zenith at 90°, which is at the centre of the image. Some Weird Ideas The source file is the second from left above (RM 30, FoV 138/100) which has the blue 45° ring in focus. For the first three below, either the camera or the sphere can be moved, for the last at far right, this must be done with the perspective camera setting. [4 Pictures] <<<< Page 5 >>>> With the camera moved backwards (Z -8), the Focal Length (10.24) is not correct anymore and thus the focused ring moves farther from the centre and also affects the angle of view, which extends to the horizon (red ring fragments at the corners). In the second example, the Focal Length was adjusted accordingly (18.24) and the blue 45° ring is in focus. Obviously, the angle of view has increased considerably from about 110° to about 170° from left to right. If the camera stays at the centre but is displaced vertically and/or horizontally (third image), the blue 45° ring is moved and stays in focus but the scene gets distorted. If the focused ring must be moved within the image without distorting the scene, this can be done with Pan V and/or Pan H. The far right image has the camera in the centre of the sphere. Since the image is 600 px square, setting camera Pan V to -300 moves it up by half its size. Example Scenes Below a more sensible example that could tell a story. The left image shows Michael 3 in focus, he is the hero of the scene. At right, Victoria 3 and Hitomi are in focus and important, Victoria 2 at the wall and sitting Aiko are out of focus and therefore not important to the story. [2 Pictures] Below the Alien Artefact 5 by MatCreator with a mirror ball in it; background and light are from the Tourbillon Tower HDRI. [2 Pictures] At left a normal Depth of Field render. The focus is at the three-fingered hand in the centre. The other three hands farther away are blurred, like foreground and backdrop. At right the DoF Ring Lens is used with the focus in the centre of the image, fore- and back-ground in the centre are focused; also the hand behind the front one, the rest is blurred. February 2020/horo