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 and Castle Game Engine: CastleRenderOptions: Class TCastleRenderOptions about WholeSceneManifold
meaning.
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 ) 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 , 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 . 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 .