Meshes, Shadows, and Shadow Meshes

Shady biz

Summary

This page explains how meshes are casting shadows.

Wait, this is not what I want!

How to cast shadows

There are two different ways to cast shadows: real-time (generated) shadows, and proxy shadows.

Most in-game items use both.

Generated shadows: Component properties

Your mesh casts an actual shadow.

The real-time shadow will be extremely detailed, but it can impact performance, and it can glitch out or cause spectacular raytracing bugs. Proxy shadows: Shadow meshes avoid these issues.

You activate real-time shadows by checking the following properties in your mesh component (which you can find in your .app or .ent file):

Proxy shadows: Shadow mesh

The proxy shadow, by contrast, will use an invisible mesh to cast a shadow (the shadow mesh). It has a lower Level of Detail than the original and often features a simplified geometry or even a proxy mesh.

Due to the less complex geometry, a shadow mesh is much less prone to raytracing glitches, and it will be much eaiser on performance.

Shadow meshes are usually added as entMeshComponents.

Configuring a shadow mesh

Your average shadow mesh has only one default material with a blank local instance of engine\materials\metal_base.remt. If the shadow mesh is loaded in a scene, it will lead to white, marshmallow-y overlays.

To make sure that it's only used for shadow generation, check the renderMask:

Creating shadow meshes

To create a low-poly mesh, you can build a cage, subdivide it a few times and use a Shrinkwrap modifier to shape it like your mesh. Then, you can reduce the poly count by decimating.

Last updated