Shadows / Maya
Here are described the settings and best practices to setup beautiful real-time shadows in Verge3D for Maya.
- Preparing Maya Viewport
- Shadow Filtering Types
- Global Settings
- Per-Light Settings
- Per-Object Settings
Verge3D supports shadows for Directional, Point and Spot lights only.
Preparing Maya Viewport
It's recommended to set up Maya's viewport as described in this section to make configuring shadows easier.
Enable the following viewport options:
- Lighting -> Use All Lights
- Lighting -> Shadows
Shadow Filtering Types
Shadows in Verge3D look very differently depending on what shadow map filtering algorithm is in use. The Shadow Filtering property located on the Verge3D Export Settings panel is used to specify the algorithm.
Disable filtering, render shadow map as is. This is the fastest method to render shadows.
Use bilinear filtering to smooth adjacent shadow map pixels.
Stands for Percentage Closer Filtering. Uses multiple shadow map lookups for smoothed shadow rendering. Average quality and performance.
Similar to PCF but uses bilinear interpolation for each shadow map lookup. Gives smoothed shadows at the expense of more computation power.
PCF (Poisson Disk)
Uses pseudorandom Poisson Disk Sampling to eliminate shadow pixelation for PCF shadows. This was made the default setting because it corresponds the most to what you see in the 3D editor viewport. The performance is comparable to PCF (Bilinear) algorithm or better.
Stands for Exponential Shadow Maps. Shadows are smoothest but light leaks are possible. Use ESM Bias setting on lights to remove light leaks artefacts. The performance is comparable to PCF (Bilinear) algorithm. ESM shadows can be particularly tricky to set up, therefore see ESM-related issues in the Troubleshooting section.
Which filtering type to choose?
It's recommended to try the default PCF (Poisson Disk) shadows first, because they offer good quality and performance. If you need faster but less quality shadows then try Basic or Bilinear. Try ESM if you want more quality, soft shadows, but the drawback is that they can be tricky to set up (artefact-wise) for a particular scene.
Global settings for shadows are located in the Verge3D Export Settings menu.
- Shadow Filtering
- shadow map filtering algorithm. See above.
- ESM Distance Scale
- ESM shadows scaling factor. Since the ESM filtering algorithm uses absolute distance values, decrease the scale value if you're working on a scene which is much bigger than the default cube, and increase it if your scene is much smaller. Default value is 2.5. Works only for ESM shadows.
Shadows can be enabled/disabled for each individual light using Maya's native panels. Supported shadow settings are highlighted with green.
- Use Depth Map Shadows
- must be enabled for shadows to appear in Verge3D.
- controls how big is the shadow texture (trading between speed and quality).
- Filter Size
- controls the blurriness ratio for shadows.
- can be tweaked until you get rid of self-shadow artefacts and/or the peter-panning effect.
- ESM Bias
- controls the bias to reduce ESM light leaking artefacts. Works only for ESM shadows.
You can also enable and disable receiving and casting shadow on per-object basis.
- Casts Shadows
- enable/disable shadow casting for this object.
- Receive Shadows
- enable/disable shadow receiving for this object.
See also Autodesk's official documentation for more information and best practices on using shadows in Maya.
Shadows in Verge3D and in the Maya viewport look different
- Verge3D doesn't use the same shadow rendering techniques as a 3d software can use - mostly for performance reasons. This can include ray-traycing, various post-processing effects and non-realtime methods. That's why there can be differences and shadows won't look exactly the same as in the viewport.
- Verge3D aims to resemble the Maya viewport. In order to make configuring shadows easier, follow the instructions described here: Preparing Maya Viewport.
Shadows look too pixelated
- Use higher Resolution values.
- Try to mask low resolution with soft penumbra. Such shadow filtering techniques as PCF (Poisson) and ESM along with properly adjusted Filter Size can make pixelization less prominent.
Shadows are visible in the Maya viewport but not in Verge3D
- In order to enable shadows in Verge3D the Use Depth Map Shadows option must be enabled.
- Very high Bias can partially or completely remove shadows. If that's the case try to lower its value.
Shadows have artefacts
- Such artefacts are called "shadow acne" or "self-shadow artefacts". Increase the Bias value to get rid of them.
Shadows have no/small penumbra
- In case of Basic or Bilinear shadows there's no control of the penumbra. Choose the other shadow filtering types instead.
- Increase Filter Size.
ESM shadows look faded
ESM shadows look too sharp or have no penumbra
- Increase Filter Size.
- Decrease the ESM Bias value.
- Decrease the ESM Distance Scale value.
- Such artefacts can appear on a receiver object's edge. It's one of ESM drawbacks. The solution is to avoid such situations.
- If an object receiving shadows doesn't cast shadows itself (e.g. if they are disabled via Casts shadows), then the shadows can have no penumbra at all no matter how large Filter Size is. The solution is to enable shadow casting on the receiving object or use an additional shadow casting object as an underlay to fix the penumbra.
ESM Shadows have artefacts
Feel free to ask on the forums!