# Simple shadow mapping example

**URL:** <https://forum.defold.com/t/simple-shadow-mapping-example/47628>\
**Category:** The Defoldmine\
**Created:** [March 28, 2019, 12:50pm UTC](https://forum.defold.com/t/simple-shadow-mapping-example/47628 "2019-03-28T12:50:34Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [March 8, 2021, 4:22am UTC](https://forum.defold.com/t/simple-shadow-mapping-example/47628/9 "2021-03-08T04:22:13Z")

</div>

I’m studying your original example now and I have some questions.

Is it cheaply possible to improve the quality of shadows like this? Smoothing the shadow or something?

 ![2021-03-07%2020_17_13-shadow-mapping-example](https://forum-defold.b-cdn.net/uploads/default/original/3X/2/5/2599d7e488d567709cc7e098247daf92af34539f.png)

Percentage-closer filtering as mentioned here?

> [LearnOpenGL - Shadow Mapping](https://learnopengl.com/Advanced-Lighting/Shadows/Shadow-Mapping)

What is the best way to allow some objects to cast shadows but not to receive shadows? So in the below it would be nice looking to allow the voxel character to cast a shadow but to be shaded in its own way.

 ![2021-03-07%2020_17_28-shadow-mapping-example](https://forum-defold.b-cdn.net/uploads/default/original/3X/1/f/1f1bbfa6028ff4efa63d6bf4ac4c7fef3c0f3c48.png) ![2021-03-07%2020_18_09-shadow-mapping-example](https://forum-defold.b-cdn.net/uploads/default/original/3X/b/9/b9f3f9ed9e95815e23fae821be64b39b3e5204b0.png)

Would it be possible to check if an object is inside of a shadow (a point is “standing” on top of a shadow) to change its shading? So like from lit to more shaded. Some games do this. I can imagine how this is done but I don’t know how it would probably be done.

---

_[View the full topic](https://forum.defold.com/t/simple-shadow-mapping-example/47628)._
