Skip to content

Commit 2a1d2af

Browse files
committed
Vulkan Mobile: Fix reading builtins in light() of spatial shader
1 parent 51b0379 commit 2a1d2af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ void light_compute(hvec3 N, hvec3 L, hvec3 V, half A, hvec3 light_color, bool is
9696
#define inv_projection_matrix scene_data_block.data.inv_projection_matrix
9797

9898
vec2 read_viewport_size = scene_data_block.data.viewport_size;
99+
100+
#ifdef LIGHT_BACKLIGHT_USED
101+
vec3 backlight_highp = vec3(backlight);
102+
#endif
103+
float roughness_highp = float(roughness);
104+
float metallic_highp = float(metallic);
105+
vec3 albedo_highp = vec3(albedo);
106+
float alpha_highp = float(alpha);
99107
vec3 normal_highp = vec3(N);
100108
vec3 light_highp = vec3(L);
101109
vec3 view_highp = vec3(V);
@@ -107,6 +115,7 @@ void light_compute(hvec3 N, hvec3 L, hvec3 V, half A, hvec3 light_color, bool is
107115

108116
#CODE : LIGHT
109117

118+
alpha = half(alpha_highp);
110119
diffuse_light = hvec3(diffuse_light_highp);
111120
specular_light = hvec3(specular_light_highp);
112121
#else // !LIGHT_CODE_USED

0 commit comments

Comments
 (0)