Anti-aliasing and Sampling

Một phần của tài liệu BuMP and norMal MaPPIng (Trang 76 - 79)

The anti-aliasing settings on the Quality tab of the Render Settings window are used to control and reduce flickering and artifacts that can appear along the edges of 3D objects or within the details of high-contrast or detailed textures applied to surfaces. Flickering in high-contrast tex- tures is not noticeable in still frames, only when a sequence of frames is rendered and played back. This is why it’s often important to test short sequences of your animations when adjusting the quality.

To minimize flickering and artifacts, you can adjust the settings found in the Anti-Aliasing Quality section of the Render Settings window (see Figure 12.54).

Figure 12.52 The Approxima- tion Editor allows you to create and assign approxima- tion nodes.

Figure 12.53 Three duplicate cubes are rendered as smooth surfaces using an approxi- mation node, a smooth mesh, and a subdivision surface.

The two main controls are the Sample Levels and Anti-Aliasing Contrast. When adjusting the sampling level, you can choose among Fixed, Adaptive, and Custom sampling modes.

Sampling refers to how mental ray determines the color of a pixel in a rendered image of a 3D scene. A camera emits a number of rays into the scene (known as Primary Eye Rays) to deter- mine the initial color value that will be created for the individual pixels in the final image. After sampling occurs, filters are applied to average the color values for each pixel in the final image.

Secondary rays may be cast into the scene to determine raytracing effects such as reflections and refractions.

The type of Primary Eye Ray is determined by the Primary Renderer setting on the Features tab of the Render Settings window. Usually this is set to Scanline for most renders. Secondary rays are specified by the options in the Secondary Effects section of the Features tab (see Figure 12.55).

Figure 12.54 You can control the anti-aliasing quality in the Anti- Aliasing Quality section of the Quality tab in the Render Settings window.

Figure 12.55 The settings on the Features tab determine the type of Primary Eye Ray cast by the render- ing cameras to sample a 3D scene.

mental ray evaluates the render using tiles. A tile is a square section of what will become the rendered image. As mental ray renders the image, it stores the samples for each tile in the sam- pling Frame Buffer. Once the samples have been collected for a tile, filters are applied to average the colors. The filtered samples are translated into color values and then stored in the image buf- fer. A tile defines a region of samples that will become pixels in the final image.

The Min and Max Sample Levels determine the sampling range; mental ray uses the Min Sample Level as a starting point and then evaluates the scene and determines whether any parts of the scene require additional samples. If so, more samples are taken. The number of additional samples is determined by the Max Sample Level setting.

Sample levels increase by a factor of 4. A Sample Level setting of 0 means that each pixel in the image receives one sample. A sample level of 1 means four samples per pixel. A sample level of 2 means 16 samples per pixel, and so on.

Negative values mean that each sample contains a number of pixels. A sample level of -2 means that one sample is used for an area of 16 pixels in the rendered image. Again, the number of pixels in negative sampling increases by a factor of 4. As you change the sampling, the num- ber of samples that will be used is displayed in the Render Settings window under Number Of Samples (see Figure 12.56).

As the sampling rate is increased, the render time increases significantly. The Sampling Mode option can be used to increase the efficiency of the sampling process:

When Sampling Mode is set to Fixed, mental ray uses the sampling level specified by Max

•u

Sample Level. This is often useful for rendering with Motion Blur.

When Sampling Mode is set to Adaptive Sampling, mental ray uses one level below the

•u

Max Sampling Level setting as the minimum and one level above the Max Sampling Level setting as the maximum. In other words, when Max Sampling Level is set to 2, the mini- mum becomes 1 sample per pixel, and the maximum becomes 16 samples per pixel.

When Sampling Mode is set to Custom Sampling, you can enter your own values for Min

•u

Sample Level and Max Sample Level.

So, how does mental ray know when a pixel requires more sampling? mental ray uses the Anti-Aliasing Contrast value to determine whether a pixel requires more sampling. Lower Anti- Aliasing Contrast values increase the likelihood that addition sampling will be required.

The best approach to take when setting the sampling level is to adjust Anti-Aliasing Contrast gradually before increasing the Min Sampling Level and Max Sampling Level settings. You’ll notice that the Production Quality preset uses Adaptive Sampling with a Max Sampling Level of 2 and an Anti-Aliasing Contrast setting of 0.1. If you find this is not sufficient, try lowering the Anti-Aliasing Contrast setting. Try a setting of 0.05. If your image still has artifacts, you may then consider raising the Max Sample Level setting.

Figure 12.56 As you adjust the Min Sample Level and Max Sample Level settings, the range of samples is displayed next to Number Of Samples.

If your image has large blank areas and only small portions of detail, try setting a Min Sampling Level of 0 or -1 and a Max Sampling Level of 2. This way, sampling is not wasted in areas where it is not needed.

Other options include the following:

Adjusting the textures

•u

Applying filtering to the textures

•u

Using the mental ray overrides on individual surface shape nodes to adjust the sampling

•u

for whichever surface is causing problems

You can get a sense of how the sampling is being applied in a render by activating the Diagnose Samples option (found in the Raytrace/Scanline Quality section on the Quality tab of the Render Settings window) and performing a test render. The rendered image will show areas of higher sampling in white and lower sampled areas in black (Figure 12.57).

Một phần của tài liệu BuMP and norMal MaPPIng (Trang 76 - 79)

Tải bản đầy đủ (PDF)

(105 trang)