Skip to content

gdshader cannot compile on 4.5 beta 1, when accessing NORMAL in light() function #107908

Closed as duplicate of#107590
@tannineo

Description

@tannineo

Tested versions

  • Reproducible in: v4.5.beta1.mono.official [46c495c]
  • Not Reproducible (working fine) in:
    • v4.4.1.stable.mono.official [49a5bc7]
    • v4.5.dev5.mono.official [64b0990]

System information

Godot v4.5.dev5.mono - macOS Sequoia (15.5.0) - Multi-window, 2 monitors - Vulkan (Forward+) - integrated Apple M3 Max - Apple M3 Max (14 threads)

Issue description

gdshader cannot compile after switching to v4.5 beta 1.

I am trying to access NORMAL in light() function.
For now the better way might be passing NORMAL by using varying.

Steps to reproduce

  1. create a gdshader file
  2. access NORMAL in the gdshader light() function:
shader_type spatial;

varying vec3 normal;

void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	// Called for every pixel the material is visible on.
	ALBEDO = vec3(1.0, 1.0 ,1.0);
	
	float test = dot(ALBEDO, vec3(1.0, 1.0 ,1.0));
	
	normal = NORMAL;
}

void light() {
	//// Called for every pixel for every light affecting the material.
	//// Uncomment to replace the default light processing function with this one.
	//float test_var;
	//
	//float test = dot(normal, vec3(1.0, 1.0 ,1.0));
	//float test = dot(NORMAL, vec3(1.0, 1.0 ,1.0));
	//float test = dot(LIGHT, vec3(1.0, 1.0, 1.0));
	vec3 test = NORMAL;
}

Minimal reproduction project (MRP)

test_light_dot.zip

Error log also attached:

error.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions