# Strange yellow shadows

**URL:** https://forum.castle-engine.io/t/strange-yellow-shadows/1064
**Category:** Uncategorized
**Created:** [January 24, 2024, 12:50am UTC](https://forum.castle-engine.io/t/strange-yellow-shadows/1064 "2024-01-24T00:50:07Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [January 26, 2024, 3:39am UTC](https://forum.castle-engine.io/t/strange-yellow-shadows/1064/14 "2024-01-26T03:39:02Z")

</div>

> [@edj](#):
>
> Yep, if I also set in addition to texture the Shape.Appearance.Material to a TPhysicalMaterialNode of white, it displays the shadows.

The material must be “lit” (affected by lights) for shadows to be visible – since “being in shadow” just means that “one of the lights is obscured, so doesn’t contribute to given color”. So the shadow receiver must indeed have a material like TPhysicalMaterialNode or TMaterialNode. The shadows will not be visible on TUnlitMaterialNode .

Note: You wrote earlier you enabled `WholeSceneManifold` on roads, you likely want to set it to `false` on the road pieces. `WholeSceneManifold` is only useful on shadow casters (shadow receivers don’t need it) and it is shall only enabled if you’re sure that the model is 2-manifold, as a whole (CGE doesn’t check it in this case, only assumes; and if it’s wrong assumption, rendering artifacts will occur). See [Shadow Volumes | Manual | Castle Game Engine](https://castle-engine.io/shadow_volumes#_optional_treat_whole_scene_as_2_manifold) and [Castle Game Engine: CastleRenderOptions: Class TCastleRenderOptions](https://castle-engine.io/apidoc/html/CastleRenderOptions.TCastleRenderOptions.html#WholeSceneManifold) about `WholeSceneManifold` meaning.

> [@edj](#):
>
> Can shadows work with transparency? Probably not I am guessing. Here is one of my trees. The leaves are single faces with a picture of a leaf with transparency, but the shadow is the whole square face.

Unfortunately, shadow volumes cannot work with transparency. The shadows are cast by the geometry, i.e. the leaves are quads, their texture (with alpha channel) doesn’t matter. We have another algorithm for shadows implemented: shadow maps ( [Shadow Maps | Castle Game Engine](https://castle-engine.io/x3d_extensions_shadow_maps.php) ) that is better in this regard, it is affected by texture with alpha channel ( one of the demos of it indeed shows leaves on a tree – [https://castle-engine.io/images/original\_size/sunny\_street\_tree\_hard.png](https://castle-engine.io/images/original_size/sunny_street_tree_hard.png) , this is from model `shadow_maps/castle_with_trees/castle_with_trees_final.x3dv` inside [GitHub - castle-engine/demo-models: Demo 3D models (mostly in X3D and VRML formats) of view3dscene and Castle Game Engine](https://github.com/castle-engine/demo-models) . But using shadow maps is right now not so comfortable, in particular both objects must be in a single X3D graph. It’s a TODO to make it better. See also [Shadows for transparent textures - #2 by MBa](https://forum.castle-engine.io/t/shadows-for-transparent-textures/1020/2) .

---

_[View the full topic](https://forum.castle-engine.io/t/strange-yellow-shadows/1064)._
