# How models form self-shadow in MeshToonMaterial?

**URL:** https://discourse.threejs.org/t/how-models-form-self-shadow-in-meshtoonmaterial/68503
**Category:** Questions
**Tags:** shadows, gltf, 3d-model
**Created:** [July 24, 2024, 6:21am UTC](https://discourse.threejs.org/t/how-models-form-self-shadow-in-meshtoonmaterial/68503 "2024-07-24T06:21:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ravenmelt](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ravenmelt/32/49910_2.png) [@Ravenmelt](https://discourse.threejs.org/u/Ravenmelt)
#### Post date: [July 24, 2024, 6:21am UTC](https://discourse.threejs.org/t/how-models-form-self-shadow-in-meshtoonmaterial/68503/1 "2024-07-24T06:21:06Z")

</div>

Hi,  
I used ShadowMesh to generate a shadow of the model on the ground, but the model itself partially occluded another part without any shadow, as if it were light passing through  
I expect it is, (using Cocos engine)

 ![QQ20240724-141917](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/7/776fa78dd55ea6dc70aea316116a7616e45583c2.png),  
but I get this  
 ![QQ20240724-141944](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/b/9b7e6be908661aefe6bec836793c95420d3fe2a9.png)  
I have already used cast Shadow and receive Shadow, but they have not taken effect, and render has also been set to shadowMap.exe enabled.

---

<div class="post-metadata">

### Author: ![manthrax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/manthrax/32/2596_2.png) [@manthrax](https://discourse.threejs.org/u/manthrax)
#### Post date: [July 25, 2024, 10:35pm UTC](https://discourse.threejs.org/t/how-models-form-self-shadow-in-meshtoonmaterial/68503/2 "2024-07-25T22:35:08Z")

</div>

Might be related to the camera near/far setting, and/or shadowmap.bias ?

Make sure your camera near is as big as you can get it but still be functional… and your Far as small / tight as possible on the scene content… this maximises the precision you have available in your depth buffer.

Try changing the shadowMap bias by + or - some small numbers like .001 or -.001 and see if it goes all dark… and find the sweet spot…

If none of this does anything, then maybe your toon/cel shader just doesn’t have shadowing implemented?

---

<div class="post-metadata">

### Author: ![Ravenmelt](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ravenmelt/32/49910_2.png) [@Ravenmelt](https://discourse.threejs.org/u/Ravenmelt)
#### Post date: [July 26, 2024, 4:21am UTC](https://discourse.threejs.org/t/how-models-form-self-shadow-in-meshtoonmaterial/68503/3 "2024-07-26T04:21:50Z")

</div>

sorry，I found the reason. That’s because I import two Three.js versions, and anothor npm application link to old version.
