You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Add model_normal_matrix for fragment shader
This commit is contained in:
@@ -1030,6 +1030,13 @@ void fragment_shader(in SceneData scene_data) {
|
||||
vec3 light_vertex = vertex;
|
||||
#endif //LIGHT_VERTEX_USED
|
||||
|
||||
mat3 model_normal_matrix;
|
||||
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_NON_UNIFORM_SCALE)) {
|
||||
model_normal_matrix = transpose(inverse(mat3(read_model_matrix)));
|
||||
} else {
|
||||
model_normal_matrix = mat3(read_model_matrix);
|
||||
}
|
||||
|
||||
mat4 read_view_matrix = scene_data.view_matrix;
|
||||
vec2 read_viewport_size = scene_data.viewport_size;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user