Repository: godotengine/godot (language: cpp)

Issue:
Shader Materials broken when created in C# (Regression from `4.4-beta2` -> `4.4-beta3`)
### Tested versions

- The regression occurs in `4.4-beta3`, `4.4-beta4`, `4.4-rc1`.
- The last working version is `4.4-beta2`.

### System information

Godot v4.4.rc1.mono - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 32.0.15.6636) - Intel(R) Core(TM) i3-9100F CPU @ 3.60GHz (4 threads)

### Issue description

`ShaderMaterial` is completely bugged when created with `new` in C# starting with Godot `4.4-beta3`.

Here is the code that works in `4.4-beta2` but not in `4.4-beta3` and beyond:

```cs
[Export] Shader EyesShader;

// ...

ShaderMaterial EyesMaterial = new() {
    Shader = EyesShader,
};
FaceMesh.SetSurfaceOverrideMaterial(0, EyesMaterial);
```

Here is the fix:

```cs
[Export] ShaderMaterial EyesMaterial;

// ...

// Create eyes material
ShaderMaterial Material = (ShaderMaterial)EyesMaterial.Duplicate();
FaceMesh.SetSurfaceOverrideMaterial(0, Material);
```

This is what it looks like in `4.4-beta2`:

![Image](https://github.com/user-attachments/assets/209d6015-e635-46e8-831e-7e78849d994e)

This is what it looks like in `4.4-rc1` (same as `4.4-beta3` and `4.4-beta4`):

![Image](https://github.com/user-attachments/assets/70b04f25-70f3-4357-8460-debbb8910b72)

The big orange eyes are created in the editor so the `ShaderMaterial` is not instantiated in C#. The blue eyes on the character are subject to the given C# code.

### Steps to reproduce

```cs
Shader ExampleShader;
MeshInstance3D ExampleMeshInstance3D;

ExampleMeshInstance3D.SetSurfaceOverrideMaterial(0, new ShaderMaterial() {
    Shader = ExampleShader,
});
```

### Minimal reproduction project (MRP)

[shader-material-regression.zip](https://github.com/user-attachments/files/18925757/shader-material-regression.zip)

Godot `4.4-beta2`:

![Image](https://github.com/user-attachments/assets/0fc78bb6-2b7b-4974-b97a-ffe80a39ebb2)

Godot `4.4-rc1`:

![Image](https://github.com/user-attachments/assets/bda579d8-2055-4223-81a5-e8f90854a6ed)


Discussion / hints:
I haven't bisected, but looking at the changelog for 4.4-beta3 and the description of the bug, #95626 sounds like it might be related.

CC @Chaosus @raulsntos 
I bisected it to 860a6ab9ac57056a11cb913aef9eff75e85810f6

Also, here's the MRP ported to GDScript: [shader-material-regression-gd.zip](https://github.com/user-attachments/files/18927358/shader-material-regression-gd.zip)

Fix patch:
diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
index 6008a4d38f24..34ddb2871d55 100644
--- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp
@@ -799,7 +799,7 @@ void MaterialStorage::MaterialData::update_uniform_buffer(const HashMap<StringNa
 
 		} else if (E.value.default_value.size()) {
 			//default value
-			_fill_std140_ubo_value(E.value.type, E.value.default_value, data, p_use_linear_color);
+			_fill_std140_ubo_value(E.value.type, E.value.default_value, data, E.value.hint == ShaderLanguage::ShaderNode::Uniform::HINT_SOURCE_COLOR && p_use_linear_color);
 			//value=E.value.default_value;
 		} else {
 			//zero because it was not provided


Test patch: