# THREE \['shadowmap\_fragment'\] in r115

**URL:** <https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374>\
**Category:** Questions\
**Tags:** version, shaders\
**Created:** [March 14, 2021, 1:30pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374 "2021-03-14T13:30:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fossas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fossas/32/40154_2.png) [@fossas](https://discourse.threejs.org/u/fossas)\
**Post date:** [March 14, 2021, 1:30pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374/1 "2021-03-14T13:30:56Z")

</div>

I am consoling log THREE.ShaderChunk[‘shadowmap\_fragment’] but it is undefined in version r115. Is there any equivalent in that version?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [March 14, 2021, 3:09pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374/2 "2021-03-14T15:09:33Z")

</div>

This specific shader chunk is gone for years, see:

> <https://github.com/mrdoob/three.js/issues/8212>
>
> In threejs r.71 there is a shadowmap\_fragment shader chunk. In this version I can use the shadowColor to calculate the final...

I suggest you study the implementation of [THREE.ShadowMaterial](https://threejs.org/docs/index.html?q=shadowma#api/en/materials/ShadowMaterial). The shadow code is now a bit different than five years ago.

---

<div class="post-metadata">

**Author:** ![fossas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fossas/32/40154_2.png) [@fossas](https://discourse.threejs.org/u/fossas)\
**Post date:** [March 15, 2021, 12:01pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374/3 "2021-03-15T12:01:33Z")

</div>

Hello! Sorry for the late reply and thank you very much. Probably, next time I will extend the shader Phong material instead of importing chunks.

Thanks again!

---

<div class="post-metadata">

**Author:** ![IARI](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/iari/32/1983_2.png) [@IARI](https://discourse.threejs.org/u/IARI)\
**Post date:** [February 16, 2023, 12:08pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374/4 "2023-02-16T12:08:47Z")

</div>

@Mugen87  
I want to study ShadowMaterial for a different reason - its just now working with log depthbuffer (as pointed out [here](https://discourse.threejs.org/t/using-shadowmaterial-with-logarithmicdepthbuffer-is-affecting-render-order/37322) and [on this github issue](https://github.com/mrdoob/three.js/issues/25515))  
looking for the ShadowMaterial implementation, I cannot really find anything.

> <https://github.com/mrdoob/three.js/blob/182432d33956abc7525530822a9402dc05d074dc/src/materials/ShadowMaterial.js>

theres barely any code at all inside there - what am I missing?

(nvm - you already fixxed it it seems)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [February 16, 2023, 1:48pm UTC](https://discourse.threejs.org/t/three-shadowmap-fragment-in-r115/24374/5 "2023-02-16T13:48:01Z")

</div>

The shader itself is defined in a separate file:

> <https://github.com/mrdoob/three.js/blob/182432d33956abc7525530822a9402dc05d074dc/src/renderers/shaders/ShaderLib/shadow.glsl.js>

But as you can see, it’s just a collection of shader chunks. These are located in the following directory:

> **[three.js/src/renderers/shaders/ShaderChunk at dev · mrdoob/three.js](https://github.com/mrdoob/three.js/tree/dev/src/renderers/shaders/ShaderChunk)**
>
> dev/src/renderers/shaders/ShaderChunk

If you want to study the shader code in a more complete manner, I suggest you use Spector.js (a WebGL development tool for the browser).
