Meshes, Shadows, and Shadow Meshes
Shady biz
Summary
Published: Mar 02 2024 by manavortex Last documented update: Mar 02 2024 by manavortex
This page explains how meshes are casting shadows.
Wait, this is not what I want!
Find information about shadows in the environment under Environment: Shadows
To learn more about Level of Detail (LoD), check the corresponding wiki page.
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):
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FGWDdMWdcAnq6ApcAyAwY%252Fmesh_shadow_component_properties.png%3Falt%3Dmedia%26token%3D59a3a492-2a97-48c1-94dd-8e35b1db969a&width=768&dpr=4&quality=100&sign=674fc21c&sv=1)
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
:
![](https://wiki.redmodding.org/~gitbook/image?url=https%3A%2F%2F1427525421-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4gzcGtLrr90pVjAWVdTc%252Fuploads%252FEZUyUSAqaHkLwXCH7rXv%252Fmesh_shadow_render_mask.png%3Falt%3Dmedia%26token%3D13de7a8b-baff-49fd-989d-7fb43f902670&width=768&dpr=4&quality=100&sign=63a26d98&sv=1)
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