# Why can't I see the shadow of the sphere on the ground?

**URL:** <https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260>\
**Category:** Questions\
**Created:** [January 16, 2024, 3:01pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260 "2024-01-16T15:01:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumpjack2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jumpjack2/32/36712_2.png) [@jumpjack2](https://forum.babylonjs.com/u/jumpjack2)\
**Post date:** [January 16, 2024, 3:01pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/1 "2024-01-16T15:01:57Z")

</div>

I have this PG:

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/e/be280e51ef15ec26fbf56a739f9e5ee9d9851a98.png)

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#T94PVM%234)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Rays can see the sphere, shadows are enabled, so why don’t I see sphere shadow on ground?

Does it exist a better method to check if a point on ground is in shadow or not?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [January 16, 2024, 3:24pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/2 "2024-01-16T15:24:05Z")

</div>

I can see the shadow in your PG example.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/9/f9dbe14bbdef43c0e3b35ac358c696c1c5f3bce9.png)

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [January 16, 2024, 3:24pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/3 "2024-01-16T15:24:51Z")

</div>

Not sure why, but this is the scene you have shared on my devices (tested on edge, chrome and android-chrome)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/5/d5cfee7cd9e3fd9f36bda4831751b85f98029e65.png)

---

<div class="post-metadata">

**Author:** ![jumpjack2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jumpjack2/32/36712_2.png) [@jumpjack2](https://forum.babylonjs.com/u/jumpjack2)\
**Post date:** [January 16, 2024, 5:20pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/4 "2024-01-16T17:20:49Z")

</div>

This is funny, it works for me too, on a different PC!

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [January 16, 2024, 5:21pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/5 "2024-01-16T17:21:29Z")

</div>

so now it is very interesting to know what OS and browser you were using where it didn’t work

---

<div class="post-metadata">

**Author:** ![jumpjack2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jumpjack2/32/36712_2.png) [@jumpjack2](https://forum.babylonjs.com/u/jumpjack2)\
**Post date:** [January 17, 2024, 7:18am UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/6 "2024-01-17T07:18:18Z")

</div>

This morning it works also on the previous PC. Probably my multiple tests and experiments messed up chrome, and a fresh start fixed the issue.

Now, the (almost) working version:

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#T94PVM%2314)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

The script calculates how long a tile is in shadow along the whole loop, but it is extremely slow!  
Can I use any native method to know which points of the ground are hit by shadow at a specific moment?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 17, 2024, 9:48pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/7 "2024-01-17T21:48:36Z")

</div>

Could you share what you are trying to achieve ?

---

<div class="post-metadata">

**Author:** ![jumpjack2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jumpjack2/32/36712_2.png) [@jumpjack2](https://forum.babylonjs.com/u/jumpjack2)\
**Post date:** [January 18, 2024, 7:15am UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/8 "2024-01-18T07:15:16Z")

</div>

I opened a specific thread:

> [@How to know if a point of a face is in shadow?](https://forum.babylonjs.com/t/how-to-know-if-a-point-of-a-face-is-in-shadow/47284/7):
>
> I would use just boxes as shadow generators (but I don’t know how to associate a physics shape to a box)

Current status:

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#T94PVM%2329)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

It works, but considering that I should do the calculation for 365 turns of the sphere (which represents the sun), it is very very slow.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 20, 2024, 1:25am UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/9 "2024-01-20T01:25:52Z")

</div>

Why not using Babylon Shadow Generator ?

---

<div class="post-metadata">

**Author:** ![jumpjack2](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jumpjack2/32/36712_2.png) [@jumpjack2](https://forum.babylonjs.com/u/jumpjack2)\
**Post date:** [January 21, 2024, 9:33pm UTC](https://forum.babylonjs.com/t/why-cant-i-see-the-shadow-of-the-sphere-on-the-ground/47260/10 "2024-01-21T21:33:36Z")

</div>

because I need to examine the shadow point by point, to count how long an area stays in shadow and how long in light.
