Skip to content

4.5-beta1 Shader compilation fails when calling NORMAL in light() function #107772

Closed as duplicate of#107590
@Aniraster

Description

@Aniraster

Tested versions

Reproducible in v4.5.beta1.official [46c495c]
Not Reproducible in v4.5-dev5 or earlier

System information

Godot v4.5.beta1 - Fedora Linux 42 (KDE Plasma Desktop Edition) on Wayland - X11 display driver, Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Ti (nvidia; 575.57.08) - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 threads) - 31.22 GiB memory

Issue description

Whenever I try accessing the NORMAL built-in value in the light() function of a shader, the shader compilation fails.
It works perfectly fine if I store the NORMAL from the fragment() function as a varying and use said varying in the light() function.

Steps to reproduce

  1. Open a new project
  2. Create a ShaderMaterial
  3. Create a new .gdshader file for the ShaderMaterial
  4. Put the line "DIFFUSE_LIGHT = NORMAL;" in the light() function of the shader
  5. Apply the ShaderMaterial to a mesh or look at the preview in the inspector

When I do this, the engine freezes for a minute or two and the shader compilation fails.

Minimal reproduction project (MRP)

N/A

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