> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/cyberpunk-2077-modding/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/3d-objects-.mesh-files/meshes-shadows-and-shadow-meshes.md).

# Meshes, Shadows, and Shadow Meshes

This page explains how meshes are casting shadows.

## Summary

**Published**: Mar 02 2024 by [mana vortex](mailto:undefined)\
**Last documented update**: Mar 02 2024 by [mana vortex](mailto:undefined)

{% hint style="info" icon="question" %}
**Wait, this is not what I want!**

* Find information about shadows in the environment under [Environment: Shadows](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/the-whole-world-.streamingsector/environment-shadows.md)
* To learn more about [Level of Detail (LoD)](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/level-of-detail-lod.md), check the corresponding wiki page.
  {% endhint %}

## How to cast shadows

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 %}

### Generated shadows: Component properties

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-mesh](#proxy-shadows-shadow-mesh "mention")es avoid these issues.
{% endhint %}

You activate real-time shadows by checking the following properties in your [mesh component](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/components/documented-components.md#equipment-hair) (which you can find in your [.app](https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/for-mod-creators-theory/files-and-what-they-do/file-formats/appearance-.app-files#components) or [.ent](https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/for-mod-creators-theory/files-and-what-they-do/file-formats/entity-.ent-files#mesh-component-entity-simple-entity) file):

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-b4d7cb2aee03b47a9048a605038c3c87c6cc4ea1%2Fmesh_shadow_component_properties.png?alt=media" alt=""><figcaption></figcaption></figure>

### 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](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/level-of-detail-lod.md) than the original and often features a simplified geometry or even a [proxy mesh](/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/level-of-detail-lod.md#proxy-meshes).

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`:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-44cda5bc24bc0b9d65d9d32f22c78c49c67f0ba8%2Fmesh_shadow_render_mask.png?alt=media" alt=""><figcaption></figcaption></figure>

## 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**.

{% embed url="<https://www.youtube.com/watch?v=nlrs5dWttPU>" %}

## Troubleshooting

### My shadow mesh is always visible!

Check [#configuring-a-shadow-mesh](#configuring-a-shadow-mesh "mention") and make sure that `RenderInScene` is unchecked.

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-28d89cadbcc27e1076e046192857e7abb965886e%2Fimage.png?alt=media" alt=""><figcaption><p>The shadow is a marshmallow</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/3d-objects-.mesh-files/meshes-shadows-and-shadow-meshes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
