# \#shadowgenerator

**URL:** https://forum.babylonjs.com/tag/shadowgenerator/87.md

[Latest](https://forum.babylonjs.com/latest.md) · [Categories](https://forum.babylonjs.com/categories.md) · [Tags](https://forum.babylonjs.com/tags.md)

---

## [Enabling shadow generator (ShadowGenerator) unexpectedly fixes intermittent ghosting/flickering on WebGPU](https://forum.babylonjs.com/t/enabling-shadow-generator-shadowgenerator-unexpectedly-fixes-intermittent-ghosting-flickering-on-webgpu/63219)

<div class="topic-metadata">

**Author:** [@Yasinli29](https://forum.babylonjs.com/u/Yasinli29)\
**Replies:** 4\
**Last updated:** [April 20, 2026, 11:23am UTC](https://forum.babylonjs.com/t/enabling-shadow-generator-shadowgenerator-unexpectedly-fixes-intermittent-ghosting-flickering-on-webgpu/63219 "2026-04-20T11:23:33Z")

</div>

OS: Win11 Browser Chrome Version 147.0.7727.57 When rendering a scene on WebGPU, I am experiencing intermittent ghosting/flickering artifacts on moving objects or during camera movement. Interestingly, simply creatin…

---

## [Shadow Darkning Issue](https://forum.babylonjs.com/t/shadow-darkning-issue/62323)

<div class="topic-metadata">

**Author:** [@Vishal](https://forum.babylonjs.com/u/Vishal)\
**Replies:** 2\
**Last updated:** [February 3, 2026, 11:03pm UTC](https://forum.babylonjs.com/t/shadow-darkning-issue/62323 "2026-02-03T23:03:56Z")

</div>

Hello, Im trying to make a website using babylon. But after my mesh undergoes multiple subtraction my all mesh which are in the subtraction operation or others all becomes dark. I have tried all fixes - regenerate n…

---

## [How to interact with shadows in shaders that move vertices](https://forum.babylonjs.com/t/how-to-interact-with-shadows-in-shaders-that-move-vertices/61875)

<div class="topic-metadata">

**Author:** [@Panuchka](https://forum.babylonjs.com/u/Panuchka)\
**Replies:** 2\
**Last updated:** [December 22, 2025, 9:01am UTC](https://forum.babylonjs.com/t/how-to-interact-with-shadows-in-shaders-that-move-vertices/61875 "2025-12-22T09:01:35Z")

</div>

Hi everyone! I’m hoping to get general guidance on how to interact with shadows with my node material shader. I have a very complex main shader I use in my game. There is a part that moves the vertices a bit according t…

---

## [shadowMaxZ is ignored when changing CSM depth renderer](https://forum.babylonjs.com/t/shadowmaxz-is-ignored-when-changing-csm-depth-renderer/61429)

<div class="topic-metadata">

**Author:** [@CrashMaster](https://forum.babylonjs.com/u/CrashMaster)\
**Replies:** 10\
**Last updated:** [November 19, 2025, 5:46pm UTC](https://forum.babylonjs.com/t/shadowmaxz-is-ignored-when-changing-csm-depth-renderer/61429 "2025-11-19T17:46:52Z")

</div>

Hey there, I am setting up a cascaded shadow generator on my scene and I want to change the camera. I found this topic that demonstrated how to make this happen: I am having some issues when one of the camera has a l…

---

## [Optimize performance of ShadowGenerator.Parse](https://forum.babylonjs.com/t/optimize-performance-of-shadowgenerator-parse/60086)

<div class="topic-metadata">

**Author:** [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Replies:** 8\
**Last updated:** [August 25, 2025, 3:31pm UTC](https://forum.babylonjs.com/t/optimize-performance-of-shadowgenerator-parse/60086 "2025-08-25T15:31:26Z")

</div>

Background ShadowGenerator.Parse called scene.getMeshesById, which is O(n) in time, for each mesh id in parsedShadowGenerator.renderList, makes the loop O(m\*n) in time, where n is the count of meshes in scene, m is the c…

---

## [Light interacting with Gaussians in Gaussian Splatting for generating shadows](https://forum.babylonjs.com/t/light-interacting-with-gaussians-in-gaussian-splatting-for-generating-shadows/58659)

<div class="topic-metadata">

**Author:** [@Zenith004](https://forum.babylonjs.com/u/Zenith004)\
**Replies:** 3\
**Last updated:** [May 26, 2025, 2:28pm UTC](https://forum.babylonjs.com/t/light-interacting-with-gaussians-in-gaussian-splatting-for-generating-shadows/58659 "2025-05-26T14:28:35Z")

</div>

I imported .splat and .ply file using ImportMeshAsync() and loaded a mesh using Gaussian Splatting method. Now since, I want to generate shadow for the Gaussian Mesh, I tried to add ShadowGenerator() to the gaussian mes…

---

## [Incorrect direction of shadow after enabled Exponential shadow map](https://forum.babylonjs.com/t/incorrect-direction-of-shadow-after-enabled-exponential-shadow-map/57967)

<div class="topic-metadata">

**Author:** [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Replies:** 2\
**Last updated:** [April 21, 2025, 8:16pm UTC](https://forum.babylonjs.com/t/incorrect-direction-of-shadow-after-enabled-exponential-shadow-map/57967 "2025-04-21T20:16:19Z")

</div>

Version: 8.3.1 Engine: WebGL2 Playground: Steps to reproduce: Open the playground Look at the shadow Expected: It looks something like if “Exponential shadow map” not enabled. Actual: Shadow appears at both …

---

## [Shadows not rendering](https://forum.babylonjs.com/t/shadows-not-rendering/57526)

<div class="topic-metadata">

**Author:** [@TadKing42](https://forum.babylonjs.com/u/TadKing42)\
**Replies:** 29\
**Last updated:** [April 2, 2025, 6:11pm UTC](https://forum.babylonjs.com/t/shadows-not-rendering/57526 "2025-04-02T18:11:24Z")

</div>

Hello, I have an error in my code and I can’t find it. Whenever I add objects, then add a point light, and then use shadow(); scene only gets a bit darker. Any help would be appreciated createbox(args) { const…

---

## [Make objects cast/receive shadows](https://forum.babylonjs.com/t/make-objects-cast-receive-shadows/57505)

<div class="topic-metadata">

**Author:** [@TadKing42](https://forum.babylonjs.com/u/TadKing42)\
**Replies:** 7\
**Last updated:** [March 31, 2025, 3:35pm UTC](https://forum.babylonjs.com/t/make-objects-cast-receive-shadows/57505 "2025-03-31T15:35:23Z")

</div>

In my project I have functions to create objects and light, I don’t have direct access to objects. How can I make those objects cast shadows? createbox(args) { const box = BABYLON.MeshBuilder.CreateBox(args.na…

---

## [shadowGenerators serialized without light](https://forum.babylonjs.com/t/shadowgenerators-serialized-without-light/56134)

<div class="topic-metadata">

**Author:** [@kzhsw](https://forum.babylonjs.com/u/kzhsw)\
**Replies:** 3\
**Last updated:** [January 24, 2025, 3:28am UTC](https://forum.babylonjs.com/t/shadowgenerators-serialized-without-light/56134 "2025-01-24T03:28:11Z")

</div>

Background Version: 7.44.1 Engine: any Browser: any Desc There is currently no doNotSerialize option for a ShadowGenerator, and a ShadowGenerator would be serialized even if the light of it marked with doNotSerialize. …

---

## [CascadedShadowGenerator set meshes to consider for bounds?](https://forum.babylonjs.com/t/cascadedshadowgenerator-set-meshes-to-consider-for-bounds/54330)

<div class="topic-metadata">

**Author:** [@pcace](https://forum.babylonjs.com/u/pcace)\
**Replies:** 8\
**Last updated:** [October 24, 2024, 7:39pm UTC](https://forum.babylonjs.com/t/cascadedshadowgenerator-set-meshes-to-consider-for-bounds/54330 "2024-10-24T19:39:07Z")

</div>

Hi there, i am trying to get the cascadedshadowgenerator to generate its bounds from pecific meshes, or better to exclude meshes for the generation of bounds. currently as far as i understand the function autoCalcDepth…

---

## [The depth of babylonjs csm](https://forum.babylonjs.com/t/the-depth-of-babylonjs-csm/51179)

<div class="topic-metadata">

**Author:** [@woniubushiniu](https://forum.babylonjs.com/u/woniubushiniu)\
**Replies:** 2\
**Last updated:** [June 10, 2024, 12:52pm UTC](https://forum.babylonjs.com/t/the-depth-of-babylonjs-csm/51179 "2024-06-10T12:52:51Z")

</div>

The depth of the viewing frustum seems to be the same in babylonjs csm, I draw all the frustums,and result is As can be seen from the figure, the frustum is not layered during the rendering process. and If this str…

---

## [Shadow generator produces wrong shadow](https://forum.babylonjs.com/t/shadow-generator-produces-wrong-shadow/50996)

<div class="topic-metadata">

**Author:** [@DavidP](https://forum.babylonjs.com/u/DavidP)\
**Replies:** 4\
**Last updated:** [June 2, 2024, 9:08am UTC](https://forum.babylonjs.com/t/shadow-generator-produces-wrong-shadow/50996 "2024-06-02T09:08:33Z")

</div>

Hello, It appears that the shadow generator is not producing the expected results. In this example, sphere0’s shadow is a circular line instead of a solid circle, and sphere1 does not cast a shadow at all Can you plea…

---

## [Why does the shadow edge will keep shaking as long as the camera moves when the autoCalcDepthBounds set to true in cascaded shadows?](https://forum.babylonjs.com/t/why-does-the-shadow-edge-will-keep-shaking-as-long-as-the-camera-moves-when-the-autocalcdepthbounds-set-to-true-in-cascaded-shadows/50011)

<div class="topic-metadata">

**Author:** [@heyefeng229](https://forum.babylonjs.com/u/heyefeng229)\
**Replies:** 8\
**Last updated:** [April 30, 2024, 12:52am UTC](https://forum.babylonjs.com/t/why-does-the-shadow-edge-will-keep-shaking-as-long-as-the-camera-moves-when-the-autocalcdepthbounds-set-to-true-in-cascaded-shadows/50011 "2024-04-30T00:52:04Z")

</div>

Hello,I turned on autoCalcDepthBounds and when the camera moves, the shadows wobble a lot .I wonder if there is a way to prevent the edge of the shadow from shaking in cascading shadows when setting autoCalcDepthBounds …

---

## [Disabling PCF shadows (with scene optimizer) makes objects go invisible](https://forum.babylonjs.com/t/disabling-pcf-shadows-with-scene-optimizer-makes-objects-go-invisible/49937)

<div class="topic-metadata">

**Author:** [@SerialF](https://forum.babylonjs.com/u/SerialF)\
**Replies:** 4\
**Last updated:** [April 26, 2024, 8:33pm UTC](https://forum.babylonjs.com/t/disabling-pcf-shadows-with-scene-optimizer-makes-objects-go-invisible/49937 "2024-04-26T20:33:57Z")

</div>

Hello, Here’s repro code (can’t save to playground, error 500). The floor will disappear after 2s when the optimizer disables shadows (same effect with scene.disableShadows = true) Without PCF the floor will still be …

---

## [Use RenderTarget](https://forum.babylonjs.com/t/use-rendertarget/49701)

<div class="topic-metadata">

**Author:** [@brightMoon](https://forum.babylonjs.com/u/brightMoon)\
**Replies:** 1\
**Last updated:** [April 16, 2024, 9:08am UTC](https://forum.babylonjs.com/t/use-rendertarget/49701 "2024-04-16T09:08:51Z")

</div>

I used the Create Screenshot Using RenderTarget method to capture the screen in my scene, and the screen suddenly flickered because I wanted to capture a width of 1920 and a height of 1080, which is different from the or…

---

## [Shadows are displayed incorrectly and are lost](https://forum.babylonjs.com/t/shadows-are-displayed-incorrectly-and-are-lost/49662)

<div class="topic-metadata">

**Author:** [@Tri\_Hang](https://forum.babylonjs.com/u/Tri_Hang)\
**Replies:** 2\
**Last updated:** [April 15, 2024, 9:32am UTC](https://forum.babylonjs.com/t/shadows-are-displayed-incorrectly-and-are-lost/49662 "2024-04-15T09:32:34Z")

</div>

I have created a shadow for a model, here is my demo: https://playground.babylonjs.com/#78RJ3V#102 But it seems the shadow is not right. As the man’s shadow fell to the floor, his legs were amputated. Please help me.Th…

---

## [Option for DirectionalLights or ShadowGenerator to follow camera](https://forum.babylonjs.com/t/option-for-directionallights-or-shadowgenerator-to-follow-camera/48374)

<div class="topic-metadata">

**Author:** [@HowdyLuda](https://forum.babylonjs.com/u/HowdyLuda)\
**Replies:** 2\
**Last updated:** [February 28, 2024, 9:48pm UTC](https://forum.babylonjs.com/t/option-for-directionallights-or-shadowgenerator-to-follow-camera/48374 "2024-02-28T21:48:50Z")

</div>

Hi there, I’m writing some code to limit shadow rendering to just where the camera is looking. It feels like it should be a feature rather than something left to the developer. It would be really nice if there was an o…

---

## [Get shadow map texture](https://forum.babylonjs.com/t/get-shadow-map-texture/48302)

<div class="topic-metadata">

**Author:** [@robcaa](https://forum.babylonjs.com/u/robcaa)\
**Replies:** 2\
**Last updated:** [February 27, 2024, 2:25pm UTC](https://forum.babylonjs.com/t/get-shadow-map-texture/48302 "2024-02-27T14:25:04Z")

</div>

Hello! I am using CascadedShadowGenerator, and I would like to get somehow the actual shadow map texture and save it to a file. So I try to read the texture pixels draw it to a canvas and then open the image in a new b…

---

## [Mesh can't receive and cast shadow in the same time](https://forum.babylonjs.com/t/mesh-cant-receive-and-cast-shadow-in-the-same-time/48281)

<div class="topic-metadata">

**Author:** [@serhiigonchar](https://forum.babylonjs.com/u/serhiigonchar)\
**Replies:** 1\
**Last updated:** [February 26, 2024, 10:48am UTC](https://forum.babylonjs.com/t/mesh-cant-receive-and-cast-shadow-in-the-same-time/48281 "2024-02-26T10:48:38Z")

</div>

Hello, How can I set shadow for objects For example, if I have a Cube, it should both accept a shadow and give a shadow, but now it can only give a shadow. I need to configure it as both a shadow source and a shadow r…

---

## [\`varying\` cause shader error when shadow is enabled in WebGPU](https://forum.babylonjs.com/t/varying-cause-shader-error-when-shadow-is-enabled-in-webgpu/46396)

<div class="topic-metadata">

**Author:** [@slin](https://forum.babylonjs.com/u/slin)\
**Replies:** 6\
**Last updated:** [December 14, 2023, 10:04am UTC](https://forum.babylonjs.com/t/varying-cause-shader-error-when-shadow-is-enabled-in-webgpu/46396 "2023-12-14T10:04:30Z")

</div>

Dear BJS team, I wish you a happy holiday. :smiling\_face\_with\_three\_hearts: I am able to reproduce my issue in a PG. It looks like a bug in BJS code. First this PG works fine with WebGL engine: https://playground.baby…

---

## [Shadows not casted/received with HDR environment texture](https://forum.babylonjs.com/t/shadows-not-casted-received-with-hdr-environment-texture/29732)

<div class="topic-metadata">

**Author:** [@MelMacaluso](https://forum.babylonjs.com/u/MelMacaluso)\
**Replies:** 22\
**Last updated:** [November 6, 2023, 11:53am UTC](https://forum.babylonjs.com/t/shadows-not-casted-received-with-hdr-environment-texture/29732 "2023-11-06T11:53:00Z")

</div>

Hi there I’ve been working on a scene where I add an environment texture such as: const environmentTexture = new HDRCubeTexture( './../game/environment/studio\_small\_09\_1k.hdr', scene, 128, f…

---

## [Problem: Fixing self-shadowing on cubes (dark planes, blurry edges)](https://forum.babylonjs.com/t/problem-fixing-self-shadowing-on-cubes-dark-planes-blurry-edges/45453)

<div class="topic-metadata">

**Author:** [@prehendi](https://forum.babylonjs.com/u/prehendi)\
**Replies:** 5\
**Last updated:** [November 5, 2023, 1:15pm UTC](https://forum.babylonjs.com/t/problem-fixing-self-shadowing-on-cubes-dark-planes-blurry-edges/45453 "2023-11-05T13:15:01Z")

</div>

Hey! I’ve been struggling with a problem: I’m trying to get cubes to cast shadows on each other. However, when I enable ‘cube.receiveShadows’, they not only shadow each other but also themselves in an unrealistic way. Th…

---

## [How do we limit the size of the auto-sized shadow frustum](https://forum.babylonjs.com/t/how-do-we-limit-the-size-of-the-auto-sized-shadow-frustum/43152)

<div class="topic-metadata">

**Author:** [@trusktr](https://forum.babylonjs.com/u/trusktr)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 2:24pm UTC](https://forum.babylonjs.com/t/how-do-we-limit-the-size-of-the-auto-sized-shadow-frustum/43152 "2023-09-06T14:24:42Z")

</div>

I’ve enabled auto shadow frustum size. light.autoUpdateExtends = true light.autoCalcShadowZBounds = true Can we limit the size? I guess maybe I should just set the size manually to the max size, and get the worst case …

---

## [ShadowGenerator issue with physical objects](https://forum.babylonjs.com/t/shadowgenerator-issue-with-physical-objects/35172)

<div class="topic-metadata">

**Author:** [@neu5](https://forum.babylonjs.com/u/neu5)\
**Replies:** 6\
**Last updated:** [November 8, 2022, 12:27pm UTC](https://forum.babylonjs.com/t/shadowgenerator-issue-with-physical-objects/35172 "2022-11-08T12:27:09Z")

</div>

Hello there, Something weird is going on with the shadows. It looks like its quality goes to 0 over time. It looks like it has something to do with the moving objects, as if you comment out the lines #271 rigidVehicle…

---

## [Point light not fully shadowing the mesh](https://forum.babylonjs.com/t/point-light-not-fully-shadowing-the-mesh/35286)

<div class="topic-metadata">

**Author:** [@Panuchka](https://forum.babylonjs.com/u/Panuchka)\
**Replies:** 8\
**Last updated:** [October 31, 2022, 7:17pm UTC](https://forum.babylonjs.com/t/point-light-not-fully-shadowing-the-mesh/35286 "2022-10-31T19:17:13Z")

</div>

Hi everyone! A silly shadowing question that I look some insight into. I have a point light set up to my game main character, so I can get cool looking shadows from the corners and when I peek into rooms that are dark! …

---

## [ShadowGenerator Blur inside ImportMesh](https://forum.babylonjs.com/t/shadowgenerator-blur-inside-importmesh/35165)

<div class="topic-metadata">

**Author:** [@3dwebgs](https://forum.babylonjs.com/u/3dwebgs)\
**Replies:** 3\
**Last updated:** [October 27, 2022, 7:04pm UTC](https://forum.babylonjs.com/t/shadowgenerator-blur-inside-importmesh/35165 "2022-10-27T19:04:53Z")

</div>

So I’m trying to get a shadow to blur and I got this far: This is the first time I’ve messed around with ShadowGenerator. I just copy pasted what worked in a playground scene from the documentation in Background Mate…

---

## [Best way to darken shadows near contact points?](https://forum.babylonjs.com/t/best-way-to-darken-shadows-near-contact-points/34909)

<div class="topic-metadata">

**Author:** [@Dillon\_Baker](https://forum.babylonjs.com/u/Dillon_Baker)\
**Replies:** 3\
**Last updated:** [October 18, 2022, 6:58pm UTC](https://forum.babylonjs.com/t/best-way-to-darken-shadows-near-contact-points/34909 "2022-10-18T18:58:41Z")

</div>

Hi all! Still pretty new here. I’m tinkering with contact shadows, and although the blurring with distance is neat, I’m looking to adjust the darkening with distance. Here’s a comparison of my playground on the left, an…

---

## [When adding additional directional lights, my shadow disappears. How do I keep this shadow intact?](https://forum.babylonjs.com/t/when-adding-additional-directional-lights-my-shadow-disappears-how-do-i-keep-this-shadow-intact/34878)

<div class="topic-metadata">

**Author:** [@Dillon\_Baker](https://forum.babylonjs.com/u/Dillon_Baker)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 4:27am UTC](https://forum.babylonjs.com/t/when-adding-additional-directional-lights-my-shadow-disappears-how-do-i-keep-this-shadow-intact/34878 "2022-10-18T04:27:35Z")

</div>

Hi all, super new to Babylon! I’m trying to illuminate a chair with several directional lights, with only one of them casting shadows. The shadow works great, but if I uncomment any of my 3 additional directional lights,…

---

## [Problem with soft shadows](https://forum.babylonjs.com/t/problem-with-soft-shadows/33171)

<div class="topic-metadata">

**Author:** [@Trusiak](https://forum.babylonjs.com/u/Trusiak)\
**Replies:** 4\
**Last updated:** [September 26, 2022, 1:41pm UTC](https://forum.babylonjs.com/t/problem-with-soft-shadows/33171 "2022-09-26T13:41:06Z")

</div>

is any way to tone shadows on object itself without using hemisphere light? i mean, in this character we had hard shadows like here: Babylon.js Playground i want to my shadows were more soft, but only on object itse…

[Next page](https://forum.babylonjs.com/tag/shadowgenerator/87.md?match_all_tags=true&page=1&tags%5B%5D=shadowgenerator)
