description |
---|
Shady biz |
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.md
- To learn more about level-of-detail-lod.md, check the corresponding wiki page.
There are two different ways to cast shadows: real-time (generated) shadows, and proxy shadows.
{% hint style="success" %} Most in-game items use both. {% endhint %}
Your mesh casts an actual shadow.
{% hint style="warning" %} 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. {% endhint %}
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.
{% embed url="https://www.youtube.com/watch?v=nlrs5dWttPU" %}
Check #configuring-a-shadow-mesh and make sure that RenderInScene
is unchecked.
The shadow is a marshmallow