Meshes, Shadows, and Shadow Meshes
Shady biz
Last updated
Shady biz
Last updated
Published: Mar 02 2024 by manavortex Last documented update: Mar 02 2024 by manavortex
This page explains how meshes are casting shadows.
Find information about shadows in the environment under Environment: Shadows
To learn more about Level of Detail (LoD), check the corresponding wiki page.
There are two different ways to cast shadows: real-time (generated) shadows, and proxy shadows.
Most in-game items use both.
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):
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
.
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
:
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.
Check Configuring a shadow mesh and make sure that RenderInScene
is unchecked.