My trees have stopped casting shadows and I can't figure out why!

I've already checked a lot of stuff. Starting with the most obvious: The Sprite3D node is correctly set to "Cast Shadow" = "On". Both a WorldEnvironment and DirectionalLight3D exist in the scene and are correctly causing shadows on other objects like the Player Sprite3D and terrain mesh so they should be configured correctly. Everything is on Layer 1 and the DirectionalLight has a mask of all layers.

I do have a custom shader (set on the MaterialOverride). I don't believe it has any render modes that would block shadows but here they are just in case:
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx, world_vertex_coords;

There is a script on the Sprite3D that corrects the aabb to compensate for changes made by the vertex shader. There's also a script on a child StaticBody3D that causes it to become partially transparent when it occludes the player and fully opaque when it does not.

If you have any suggestions at all for anything to check that might be responsible for my missing shadows, please share them! Thank you for your time and assistance.

  • xyz replied to this.

    Pipko Try adding depth_prepass_alpha to render mode flags.

      xyz Thank you for the help - I tried adding that flag and nothing seems to have changed. I thought it might conflict with depth_draw_opaque so I tried removing that as well but still no shadows.

      • xyz replied to this.

        Pipko Can you post a minimal reproduction project?

        I finally found the problem. Turns out the problem wasn't the tree scene but the demo room scene's instances of those trees.

        All the trees in the demo level for some reason had an override linking to an older version of the shader. So even when I changed the shader on the master tree scene it didn't effect the trees in my level because they were using an older one!

        Stuff like this is surprisingly difficult to spot. I only noticed because I accidentally dragged a new tree into the scene and saw it had shadows!