Real Player Shadow Casting
🟢 Updated this monthPreview

🔍 Analysis
- 👍 1.8% endorsement rate — high engagement, a strong quality signal
- ✅ Updated 15 days after the latest game patch — actively maintained
- 🏆 #98 of 193 Visuals mods in this game by downloads
📋 About This Mod
Transforms the bad static player shadow caster into a good and realistic one calculated in real time
WORKING FROM v1. 20
Installation:
Drop both .asi and 'winmm.dll' inside 'steamapps\common\Dying Light 2\ph\work\bin\x64'
If you already have 'winmm.dll' inside the directory, you don't need to drop it again, just the .asi
Drop .pak inside 'steamapps\common\Dying Light 2\ph\source'
The pak contains the .prefab that will be used to spawn the shadow entity
How it works (VERY LONG technical explanation):
Player shadows in the Dying Light franchise were never a good thing. In Dying Light 1 it simply didn't exist, in Dying Light 2 it was made in a bad way, and in Dying Light The Beast it simply was the same thing as Dying Light 2.
My guess is that Techland tried to save resources by making the shadows be casted in a cheap way, although it wouldn't really make a FPS difference. It was somewhat improved in Dying Light The Beast as Techland put a different system of shadow casting, where some of the player armor would have a shadow cast and single meshes for the shadow of the head, etc. But it wasn't made in a good way either:
The game normally uses a static shadow caster mesh to the player, called "player_shadow_caster.msh" which is just a generic bald man as you can see:
The game uses that mesh to cast shadows
I fix that in my mod
To do that, I created another .prefab and inside it, created 2 components: a CoSkinnedMesh, which will initially define the tpp default player skeleton model (player_tpp_skeleton.model) as the shadow caster and a CoSkeleton binded to the skeleton named "player_tpp.msh" (Not sure if that mesh actually works, but it's needed for skeleton animation binding later on).
(The retail prefab uses a static mesh binded to a ModelObject, but to achieve accurate shadow, we need to firstly cast the real player model, not a static mesh, so that's why we need to replace ModelObject to the CoSkinnedMesh and then CoSkeletonProxy to its equivalent which is CoSkeleton)
After the .prefab is set I need to intercept where the original "fpp_shadow_mesh.prefab" is created as a CEntity and also make the game create the entity of my .prefab. That will make so the game creates the original needed things and also creates the needs of my custom prefab. But it can't just stop right here, doing only those changes wouldn't change anything as the original mesh from the original prefab would still be used as the shadow caster, so we need to do some additional steps to firstly get the custom caster working:
- First, you need to hide the original shadow caster, you can do that by calling IModelObject::EnableRenderingShadows with argument a2 = 0 to the original fpp shadow ModelObject class
- Secondly, you need to move the custom shadow entity (created somewhere in the world) to the current shadow caster location. You can do that by calling IControlObject::GetWorldXform to the original ModelObject class and then move to the custom entity by calling CoHierarchy::SetWorldXform using CoSkeleton class (from custom entity).
- Thirdly, you need to populate the custom CoSkinnedMesh with the correct player outfit following the original logic the game normally does
- Fourthly, you need to finally enable the custom CoSkinnedMesh shadow rendering by making an OR bitwise operation to the dword in CoSkinnedMesh+0x74 with the value 0x1F
After doing all of that, it'll turn something like this:
A hard, unmovable shadow will appear, with the current player model also clipping through your camera.
To fix that, you then need to firstly hide the clipping mesh then fix the animations
To fix the clipping:
Going to CVisibilityManager::DetermineVisibility and where the game writes to CoVisibility+0xB8 (mesh visibility flag), do an AND operation with the mask 0xFFEFFFFF, that will clean the "bVisible" bit and disable the clipping mesh.
To fix the animations:
This is technically the hardest part and hardly explainable, you need to do several operations between original CoSkeletonProxy and your CoSkeleton to sync properly all bones, but basically consists in searching the bones names from the original CoSkeletonProxy (and its values) and copying the exact thing to the custom CoSkeleton. (You need to use calls such as CoSkeleton::GetLocalXformsWriteInvalidateAll, CoSkeleton::FindElement, CoSkeleton::UpdateModelXforms and several other vtable calls from CoSkeletonProxy that a
📊 Mod Details
- Game
- Dyinglight2 Mods
- Author
- Synsteric
- Version
- 1.1
- Downloads
- 502
- Endorsements
- 9
- Category
- Visuals
- Created
- 8/11/2026
- Updated
- 9/5/2026
🔧 How to Install Dying Light 2 Mods
Download from Nexus Mods.
📖 Full step-by-step install guide for Dying Light 2 →
Visit the official mod page for specific installation instructions for this mod.
🎮 Need cheat codes or console commands? Check ur gaming wiki for Dying Light 2 commands, item IDs, and more.
Keep browsing — more Dying Light 2 mods await