A friend of Baidu C4D Bar asked me this question: What happened to multi-channel depth? How to use depth map for dynamic focusing in AE?
This depth map is different from the bump map and normal map I mentioned before. The former belongs to the technology of materials, and its purpose is to increase the surface details of the model. The depth map to be studied below belongs to the content of layered rendering in synthesis.
Speaking of layered rendering, say a little more: 3D software rendering generally includes segmented rendering and layered rendering.
Segmentation rendering generally refers to the decomposition of complex animation. In order to reduce the difficulty of rendering and save computing resources, it can be divided into shots or scenes. Finally, it is synthesized and spliced in the video editing software.
Layered rendering is usually a "safe" rendering method for still frames or image sequences. Layered rendering still frames are image files composed of diffuse reflection, highlights, shadows, alpha and other independent layers. Its advantage is that it can store as much scene information as possible through independent layers, providing data basis for future modification and adjustment. For example, a high-resolution still frame image, after 4 or 5 hours of rendering, is not satisfied with the shadow or thinks that the reflection of the object is too strong, or is not satisfied with some colors. What should you do? If there is no layered rendering, there are only two ways: one is to adjust the material parameters in the three-dimensional scene and re-render, which wastes time; The second is to transfer to PS and adjust it by various means. Without the assistance of other channels, the effect is not necessarily good and the quality is poor. However, it is very easy to render with insurance layers. You can find an independent shadow layer and reflection layer and adjust them separately. When customers are satisfied, the synthetic output is very efficient.
In a word, layered rendering provides necessary data information for post-synthesis. Therefore, this paper specially wrote a special topic to study C4D layered rendering technology. Where to start? Let me start with the question my friend asked me: multi-channel-depth!
study
Is the depth channel in c4d the same as the "Z-depth channel" often mentioned in 3D?
1. What is a Z-depth channel?
What is Z depth? In fact, it is a map that describes the distance in the Z axis with black, white and gray.
In two-dimensional space, the X axis represents horizontal space, while the Y axis represents vertical space without Z direction. For example: Photoshop, such software. But when working in three-dimensional space, in addition to the X axis and Y axis, you have to add the concept of Z axis, which represents the depth.
Z-map (Z-channel map) is a gray-scale image, similar to the Alpha-channel image, used to store depth data (although it looks like a gray image, it is a data file that describes the depth of the scene for the renderer). For example, the Alpha channel image uses 8-bit 256-level gray scale to determine the mask, transparency, etc. In the Z diagram, each pixel in the scene is given a gray value of 0-255 according to its distance from the camera. Generally speaking, the object closest to the camera shows white, and the object farthest from the camera shows black.
Z-MAP channel map (white means close to the camera, black means far from the camera)
On a plane, if you define three directions: X, Y and Z, you can simulate a false three-dimensional space. X and y are left and right, up and down, and z is depth, which is perpendicular to the screen from front to back. Therefore, by using the concept of 3D software and adding the information of Z channel to 2D software, the depth direction can be "simulated". The technicians are so clever!
Second, what is the use of depth mapping?
It is most commonly used to make and control a blur operation, such as making on a two-dimensional image, 3D environment fog, depth of field (simulating what a real camera sees) and other effects.
1, acting on the depth of field:
2, acting on the depth mask, if there is a picture behind it, you can make a special effect that three balls rush out from behind the background picture in turn.
3. fog act on three-dimensional environment.
In a word, the above is based on two-dimensional images, using its Z channel (simulated depth) to generate special effects in synthesis software. This is faster and more flexible than making it in 3D software. (If you are in 3D software, the rendering will be very slow.)
Third, how to create:
Z-channel diagram is a gray scale diagram, and the principle is "white is near and black is far". There should be two ways to create Z-Map: one is to make Z-Map with 3D software, because this is the most correct and accurate method; The second is to draw Z diagram (Z channel diagram) with gradient in PS. If you make a static picture, it is easy to say that if the camera moves the image sequence, drawing with PS is very troublesome and inaccurate.
This is an example of how to create a file with Z channel.
1. Open C4D and create three spheres in the scene.
2. Open the rendering settings and select Save. Fill in the file name and pay attention to the format of RLA or RPF (what format is this? See the supplementary explanation later), and the depth is 16. (It can also be 8 digits)
3. Click the Options button at the back and check the box below. Then, when rendering, this information is also saved to the RLA image file.
4. Press SHIFT+R to render. Generate a demonstration. RLA image file, which also stores Z channel information. Simple, right?
Fourth, how to apply it?
RLA or RPF files, PS can't open, AE can. So, let's talk about the application in AE here.
1. Open AE and establish synthesis. Enter the demonstration. RLA generates the above. (Forgot to generate ID and alpha channel, which has a little influence on the effect)
2. the use effect->; 3d channel->; 3D channel extraction (3D channel extraction) can be used to extract Z channels from images.
3. Depth Mask (Depth Mask)
4. Depth of field (depth of field)
5. Fog 3D (Fog 3D)
5. In C4D, what does depth mean?
After a long study, what is the "depth" of C4D?
Answer questions raised by friends with examples:
1, or three balls in the scene.
2、? Set up a camera and drag the blue ball in front to the focus object bar. Point the camera at it.
3. Enter the camera details panel and check the depth of field map-background blur. It starts at 0 and ends around 1000.
The blue ball is in focus, with the foreground from the blue ball to the camera and the background from the blue ball to the distance.
4. Select multiple channels to increase the depth. The depth of field is automatically added. If it is not checked, the generated image will not be blurred and there will be no depth of field.
Check and save, BALL.JPG. Check the multi-channel image named BALL in JPG format.
5. Pay attention to start the active camera and press SHIFT+R to render. Generate two image files as follows:
6. how to use it?
Open AE to create a new composition. Drag the ball image file and its depth map into it, put the depth map at the bottom and hide it.
7. Click Ball to add the following filter effects.
8. Click on the blur map layer and select the depth map.
9. Set the blur radius and adjust the blur focal length.
10, increase blur focus.
1 1, and then increase the blur focus.
If you set keyframes for fuzzy focus, rendering will generate a video with the focus moving from front to back. This is faster and more effective than making it in 3D software.
12, the following is the official screenshot of the depth map. Note: At the focus, the depth map is black, but it is white away from the focus.
postscript
Through this article, do you realize that learning C4D knowledge is not enough, and the effort of composition is beyond composition? There are many three-dimensional and comprehensive basic theories to learn and learn from. For self-learners, they can only learn from examples while realizing the truth! Difficult!
Supplement 1
1, the RPF file RPF (rich pixel format) is a format that supports the ability to include any image channel. When setting the output file, if you select "RPF image file" from the list, you will enter the RPF setting dialog box. In this dialog box, you can specify the channel type for writing out to a file. When choosing RPF file instead of RLA file as the format of rendering animation, further post-production or effect realization is needed. connect
The standard channels of the standard channel group are RGB color channels and alpha (transparent) channels. Bits per Channel—Select 8, 16 or 32-bit "floating point" as the bits per channel. The default setting is 8. Save Alpha channel—Select whether to save the Alpha channel. The default setting is enabled. Pre-multiply Alpha- When this option is enabled, pre-multiply the Alpha channel. The default setting is enabled. If the image needs to be used in subsequent synthesis, pre-multiplication will save calculation time. For more information, see Multiplying Alpha. The "Optional Channels" group outputs an RPF file, which can generate additional channels (and view them in the rendered frame window): Z depth-saves the information of the "Z buffer" during the repeated gradient from white to black. The gradient represents the relative depth of objects in the scene. Material Effect—Saves the "Effect Channel" used by the material assigned to the object in the scene. "Effect Channel" is a kind of material attribute setting in the material editor, which is needed for video post-synthesis. Each effect channel ID is displayed in a different random color. Object—Use the Object Properties dialog box to save the G buffer object channel ID assigned to the object. This "G buffer ID" is used for video post-synthesis. Each "G Buffer ID" is displayed in a different random color. UV coordinates-save the range of UV map coordinates in gradient colors. This channel shows where the map may appear. Note: Unless a map using coordinates is applied, the "UV Coordinates" will not be displayed on the object to which the "UVW Map Modifier" is applied. Normal- Saves the direction of the normal vector in a gray gradient. A light gray surface has a normal that points to the view. The normal of the dark gray surface points away from the view. Non-clamping color—Saves the corrected area in the image whose color is out of the valid color range. These areas are displayed in bright saturated colors and are usually surrounded by reflective highlights. Overlay—Saves the overlay of the surface segment from which other G buffer values (z depth, normal, etc.) will be obtained. ) is available. The value range of "Z coverage" is from 0 to 255. To view the Z overlay, check the Z overlay in the Settings sub-dialog, then render it as an RLA file, and then select the Z overlay from the View Channel drop-down list in the Rendered Frame window. The function of "Z-coverage" is mainly provided for developers, which can help realize anti-aliasing of "Z-buffer". Node Render ID— Saves objects in a solid color according to each object's G-buffer object channel (under Object Properties). Color—Save the color returned by the fragment material and hide the weapon. This channel displays any transparent clips in a solid color. Transparency—Preserves the transparency returned by the material of the fragment to hide the weapon. Clips with any transparency are rendered as solid gray objects. Velocity—Saves the velocity vector of the fragment relative to the scene in the scene coordinates. Sub-pixel Weight-Saves the sub-pixel weight of the clip. This channel contains a portion of all pixel colors provided by the clip. Fragments of the sun provide the final pixel color. The weight of a given segment takes into account the coverage of the segment and the transparency of any segment before the given segment. Sub-pixel mask—Saves the alpha mask of the sub-pixel. This channel provides a mask of 16 bits per pixel (4 x 4) for antialiasing alpha synthesis. This mask is particularly useful when burning synthetic products.
2.RLA format
Is it popular SGI? Format, which can support channels containing arbitrary images. When setting the output file, if you select "RLA Image File" from the list and click the "Settings" button, you will enter the "RLA Settings" dialog box. In this dialog box, you can specify the channel type (format type) for writing out to a file.
connect
"standard channels" group
The standard channels are RGB color channels and alpha (transparent) channels.
Bit per channel
Select 8, 16 or 32 as floating-point number as the number of digits per channel. The default setting is 8.
Storage alpha channel
Choose whether to save the Alpha channel. The default setting is enabled.
Pre-multiplied Alpha
When opened, the Alpha channel will be multiplied in advance. The default setting is enabled.
If images are needed for post-synthesis, pre-multiplication will save calculation time. For more information, see. .
"Optional channels" group
For the output RLA file, eight additional channels can be generated (and viewed in the rendered frame window):
Z depth
In the process of repeated gradient from white to black, the information of "Z buffer" is displayed. The gradient represents the relative depth of objects in the scene.
Material ID
Displays the effect channel used by the materials assigned to objects in the scene. "Effect Channel" is a kind of material attribute setting in the material editor, which is needed for video post-synthesis. Each effect channel ID is displayed in a different random color.
Object ID
Use the object properties dialog box to display the G buffer object channel ID assigned to the object. This "G buffer ID" is used for video post-synthesis. Each "G Buffer ID" is displayed in a different random color.
UV coordinates
Displays the range of UV map coordinates in gradient colors. This channel shows where the map may appear.
Note that "UV coordinates" are not displayed on objects to which the UVW Map Modifier is applied unless a map using that coordinate is applied.
normality
Displays the direction of the normal vector in the grayscale gradient. A light gray surface has a normal that points to the view. The normal of the dark gray surface points away from the view.
Non-clamping color
Displays the area in the image where the color exceeds the effective color range and is corrected. These areas are displayed in bright saturated colors and are usually surrounded by reflective highlights.
involve
This will save the coverage of surface debris, and other G buffer values (Z depth, normal, etc.) will be deleted from the coverage. ) is available. The value range of "Z coverage" is from 0 to 255. To view the Z overlay, first select the Z overlay in the Settings sub-dialog, then render it to an RLA file, and then select the Z overlay in the View Channel drop-down list in the Rendered Frame window.
The function of "Z-coverage" is mainly provided for developers, which can help realize anti-aliasing of "Z-buffer".
"Description information" group
This information is saved with the file.
describe
You can enter descriptive text here.
author
You can enter your name here.
Supplement 2
How to export channel files?
1. Create the following scenario.
2. Set up a camera and create composite labels for three spheres. Set the ID number of the object cache to 1, 2 and 3 respectively.
3. Open the rendering settings. Check multi-channel, add three object caches, and set 1, 2, 3 respectively, corresponding to the above. Add a depth channel.
4. In the save panel, check the multi-channel image save and check the following items. The file name is AAAA. (same as preshipmentdocument) Shipping file
5.SHIFT+R rendering. You can see object caching and deep channel generation.
6. Find this file.
7. I found it dark when I opened it with PS, right? What about the paragraph?
8. Actually, those channel files are under the channel panel.
Second, how to generate an independent channel file?
This is the second question you asked.
1, actually it's really simple. Named BBBB. PSD only needs to tick off the following items.
2.SHIFT+R rendering. You can see object caching and deep channel generation.
3. Let's see, each of the four channels is generated by an independent file.
4. Open them separately with PS. This is the depth channel: black means in the camera focus and white means away from the camera focus.
5. The following are three object cache channels.