Shadow maps in 2025?

In loosely related news: I tested and fixed today shadow maps in examples/deprecated_to_upgrade/fps_game_old_ai/. Commit to the engine is here.

Yeah, it’s an old and deprecated example, but it shows setup of shadow maps.

By default there are no shadows, but one can edit example_level_final.x3dv following comments to activate them.

After my fix, one can add a test light source + test box to example_level_final.x3dv and the shadow maps will be OK:

# Examples how to add a light source that casts shadows.
SpotLight {
  location 0 55 44
  direction 0 -1 0
  cutOffAngle 1
  intensity 10

  # Uncomment lines below to get shadow by shadow maps.
  # See https://castle-engine.io/x3d_extensions_shadow_maps.php
  # for a full documentation.
  # In a very trivial cases, it's enough to just say "shadows TRUE",
  # although you may want to adjust other settings.

  projectionNear 40
  projectionFar 60
  shadows TRUE
  defaultShadowMap GeneratedShadowMap {
    size 4096
    update "ALWAYS"
    bias 4
    scale 4
  }
}

Transform {
  translation 0 2 -10
  children Shape {
    appearance Appearance {
      material PhysicalMaterial {
        baseColor 0 0 1
        emissiveColor 0.2 0.2 0.2
      }
    }
    geometry Box { }
  }
}

I don’t think the fix related to your case (if it would, then changing effect would not matter; only it would matter if you do ChangedAll or not on a scene). But to be sure, you can update the CGE, after above fix is build.