Skip to content

There is still a transparency issue with setting ALPHA=1.0 in the shader script #92144

Open
@jianliang-li

Description

@jianliang-li

Tested versions

4.0.4, 4.2, 3.5

System information

macOS 14.4 (23E214) Godot 4.2, 4.0.4

Issue description

Setting ALPHA=1.0 in the shader script still has a transparent effect, just like setting the transparency of StandardMaterial3D to alpha or setting no depth test.
But if the rendering mode of the shadow script adds depth_draw-always, setting ALPHA=1.0 can display normally, but it cannot produce shadow effects.

Steps to reproduce

In the project I uploaded:
In the scene of node_3d_desk, the shader script has set ALPHA=1.0 and I do not want to see the tripod of the table.

Desk_normal has added StandardMaterial3D to the surfaceMaterialOverlay of Box024 without any changes.
image

Desk_alpha added StandardMaterial3D to the SurfaceMaterialOverrides of Box024 and changed transparency to alpha.
image

Desk_no_depth_test has been added to StandardMaterial3D and transparency has been changed to no_depth_test in the surface MaterialOverrides of Box 024.
image

Desk_shaded_alpha added ShaderMaterial in the surfaceMaterialOverride of Box024, with only ALPHA=1.0 set in the script.
image

In the scene of node_3d_sofa, there is also a similar problem. This problem occurs whenever the mesh has an irregular shape.
image
image
image
image

How can I set ALPHA=1.0 in the shader without expecting transparency or no_depth_test effects, and still display shadows normally.

When I add render_mode depth_draw_always in the shader script, it can display normally, but it cannot display shadows properly. If the following image is displayed:
Shadow display in normal mode:
image
Display shadows after setting ALPHA=1.0 and adding render_mode depth_draw_always:
image

Minimal reproduction project (MRP)

Test0520.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions