Is there any way to cast shadow when ALPHA set to 0 in spatial shader?

Godot Version

Godot 4.5.1 mono

Question

It seems shadow will be cutoff when ALPHA set to 0, even if render_mode depth_prepass_alpha has been added on.

One way I’ve tried is to duplicate a cast-shadow-only MeshInstance3D to render shadow separately. But is there any way inside shader to cast shadow when ALPHA = 0 ?

Btw, ALPHA_SCISSOR_THRESHOLD can’t set to 0.0 since I want to keep it invisible when ALPHA = 0.

You can use geometry instance transparency instead of alpha.

Hi there.

Unfortunately I can’t set MeshInstance’s transparency since there is just a part of it’s mesh invisible.

The application scenario is I’m creating procedural terrain mesh and want to hide unexplored terrain part, so I set these parts’ alpha value to zero, but I still wan to process shadow correctly for hidden parts. I don’t know how to implement correctly in shader.

Make a duplicate and set its transparency to 1.

1 Like

Alright, seems duplicating is a best way.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.