Solving problems while working with shadows

Solving problems while working with shadows

Solving problems while working with shadows

All who worked in at least one package three-dimensional graphics ( Maya , 3d Max ), necessarily tried to create an image in which there will be a shadow. The shadow is one of the things I love most. Quite often it is with shadows that problems arise. How to solve them is set forth in this article.

Problems with the shadow map

Avoid creating dependent instances of light sources. Use them for ordinary copying ( copy ). Check the presence of a duplicate of the glowing fog, because when duplicating the illuminator, fog is not duplicated.

Incorrect shadows based on depth maps

For very large scales, a shadow based on depth maps may turn out to be incorrect due to improper scaling of the near and far-off shadow shading plane.

The following example shows how to manually set the clipping planes to render the shadow map (assuming the light source is called light Shape ):

Where the first line disables the automatic generation of clipping planes, and the last two set suitable values for the near and far clipping plane.

Dropping shadows with transparent objects based on depth maps

Transparent objects cast shadows for shadows based on depth maps. If this is not necessary, turn off the casting of shadows for objects that need to be transparent using the Attribute Editor window.

The bad quality of the shadow with a glowing fog

With a luminous fog, the quality of the shadow can be very poor.

This can happen if the value of coneAngle is significantly larger than the scope, and the Use Dmap Auto Focus option is enabled. If Use Dmap Auto Focus is enabled, the renderer calculates the minimum angle to achieve the best quality of the shadow. But with the luminous fog turned on, the angle can be greater than the angle of the cone of light.

Disable the Use Dmap Auto Focus attribute, then set the Dmap Focus value .

Incorrect hardware shadow generation

To make the hardware shadows work correctly, it is necessary that the viewport does not overlap with other windows.

Do not overlap the viewport with other windows.

The illuminator does not generate shadows

Verify that the Illuminates by Default attribute is enabled if you do not expect to associate the fixtures with objects.

Make sure that the Cast Shadows or Receive Shadows options are enabled for the object.

If you use shadows based on depth maps, check that the Enable Depth Maps option is enabled in the Render Settings window (Window> Rendering Editors> Render Settings).

If you use shadows based on ray tracing, make sure that the Ray Depth Limit attribute (for the illuminator in the Attribute Editor window) is accessible and not less than 1.

Shadows flicker during animation

When using shadows based on depth maps:

- To get the best quality with the Use Dmap Auto Focus attribute enabled, make sure that the ground surface (floor) does not cast shadows. Otherwise, the accuracy of calculating the shadow from small objects will be significantly less.

- Try to disable the Use Dmap Auto Focus attribute and determine the constant focus angle for the illuminators working throughout the animation.

Uneven Lighting Limits

If an object uses a Ramp Shader (for example, to implement a multiplier shader) and is illuminated with a spatial light source (Area light) with a shadow based on the depth map, the light limits may be uneven. To fix this, increase the Dmap Filter Size (Depth Map Shadows attributes in the Attribute Editor window for the illuminator). If this does not help, significantly increase the value of Dmap Bias.

Uneven or shimmering shadow edges

For spotlight, reduce Cone Angle .

For the directional light that casts a shadow, turn on Use Light Position, turn off Use Dmap Auto Focus, and set the Width Focus so that all the desired objects drop shadows in all frames of the animation.

To determine the Width Focus value, from the Panels menu, select Look Through Selected (previously selecting the illuminator) and adjust the scale of the viewport so that all objects that should cast a shadow are visible. Remember the width of the window - this will be the Width Focus value.

For all types of fixtures, do one of the following:

- disable Use Light Position (only for the directional illuminator), enable Use Dmap Auto Focus for the illuminator and disable Casts Shadows for all objects (especially large ones) that should not cast a shadow (although they can continue to take a shadow).

- increase the value of Dmap Filter Size (to the minimum value providing an acceptable result) for the illuminator that generates the shadow (this will make the edges of the shadow soft).

- Increase the value of Dmap Resolution (to the minimum value that provides an acceptable result) for the illuminator that generates the shadow.

A grainy or flickering shadow about a luminous fog

Increase the Fog Shadow Samples (to the minimum value that provides an acceptable result) for the illuminator that generates the shadow.

Dark spots and stripes on the illuminated surface, (outside the shadow area)

Do one of the following:

- Enable the Use Mid Dist Dmap for shadows that light.

- Increase the Dmap Bias slightly for the illuminators that generate the shadow and illuminate the surface.

The shadow is separated from the discarding surface

Slightly reduce Dmap Bias for lighters that generate a shadow.

Uneven or shimmering shadow boundaries (shadows based on ray tracing)

Do one of the following:

- Reduce the Light Radius ( point light or spot light ) or Light Angle ( directional light ) to the illuminators that generate the shadow. In this case, the boundaries of the shadow will become more clear.

- Increase the Shadow Rays (to the minimum value that provides an acceptable result) for the illuminators that generate the shadow.

Steps or dark triangles on the surface (shadows based on ray tracing)

Do one of the following:

- Increase the Curvature Tolerance for the surface.

- Increase the U Divisions Factor and V Divisions Factor for the surface (to the minimum value that provides an acceptable result).

Changes in the resolution of the depth map do not affect the IPR

When working with the IPR renderer, the Dmap Resolution or Use Dmap Auto Focus changes do not appear in the IPR .

if you like this tutorial you can visit our website for more info at https://www.nbyit.com

要查看或添加评论,请登录

Md Babul Hossain的更多文章

社区洞察

其他会员也浏览了