1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Enable the use of all builtins on the light shader

When using the light process in spatial shader,
the built-ins work as spected, now they work in forward+,
mobile and compatibility renderer.
This commit is contained in:
Manuel Dun
2023-05-11 18:56:04 -04:00
parent fd4a06c515
commit e2321c21db
7 changed files with 33 additions and 5 deletions

View File

@@ -343,6 +343,8 @@ void vertex_shader(in uint instance_index, in bool is_multimesh, in uint multime
mat4 modelview = scene_data.view_matrix * model_matrix;
mat3 modelview_normal = mat3(scene_data.view_matrix) * model_normal_matrix;
mat4 read_view_matrix = scene_data.view_matrix;
vec2 read_viewport_size = scene_data.viewport_size;
{
#CODE : VERTEX
@@ -823,7 +825,8 @@ void fragment_shader(in SceneData scene_data) {
inv_view_matrix[1][3] = 0.0;
inv_view_matrix[2][3] = 0.0;
#endif
mat4 read_view_matrix = scene_data.view_matrix;
vec2 read_viewport_size = scene_data.viewport_size;
{
#CODE : FRAGMENT
}