godotengine / godotengine/godot

Object with "Distance Fade" enabled does not cast shadows.

Open
#97,537 3 comments 1 reaction 0 assignees View on GitHub
bug needs testing topic:3d topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- 4.3

### System information

Win 10

### Issue description

The wall has Distance Fade enabled. It stops to casting shadows.
![image](https://github.com/user-attachments/assets/8967800b-6c26-4e63-9ab8-827ecb9f7f33)

https://github.com/godotengine/godot/issues/69329#issuecomment-1330895397
>To resolve this, use the Pixel Dither or Object Dither transparency mode for Distance Fade.

Pixel Dither does not resolve this.

Also if this is intended then the tooltip should say that the object will stop casting shadows.
![image](https://github.com/user-attachments/assets/317e4dad-5c4c-47ae-a985-ce713da34a1e)

But object still do cast shadows from direct light:
![image](https://github.com/user-attachments/assets/aa9c0743-7a3a-42ce-a988-67da5d89a248)

Which makes me think that light camera is affected by same shader and are just to close to object. Which means light camera pass should use different settings/different shader.

Changing distance to very small number solves the shadows but looses its usability meaning ofc:
![image](https://github.com/user-attachments/assets/cb8f3e12-2dda-42fe-bb51-d230e21df68c)

Another detail:
This is GridMap. Which means that material was assigned to mesh material slot and not to OverrideMaterial Slot of MeshInstance (because GridMap has no Override Material slot, but it should!)
![image](https://github.com/user-attachments/assets/d1add444-47e3-4a54-93cd-94ac273fc300)

### Steps to reproduce

Enable Distance Fade on material and put light close to object.

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.