Repository: godot
Issue: Opening inspector of a MeshInstance3D with specific shader makes computer freeze
Labels: bug,topic:editor,needs testing,topic:3d

### Tested versions

- v4.2.1.stable.mono.official [b09f793f5]
- v4.1.1.stable.mono.official [bd6af8e0e] (first time I found it)

### System information

Windows 10 - v4.2.1.stable.mono.official - Vulkan (Forward +) - GeForce GT 750M (V.Pilote 425.31) - Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz

### Issue description

I added a water shader to a MeshInstance3D. When I open the inspector to modify some parameters, my whole computer freeze and I have to restart it.

Here is a small video of the problem: (I'm sorry for the quality but since my computer crashes I can't find an other way to capture it)
https://youtu.be/t6cyyRodafI?si=zNEruuoTPwc0fc4c

### Steps to reproduce

I have a scene with a MeshInstance3D with a shader material that I found online 
https://godotshaders.com/shader/another-water-shader/
<code>

	shader_type spatial;
	
	uniform sampler2D DEPTH_TEXTURE : hint_depth_texture, repeat_disable, filter_nearest; 
	
	uniform float depth_fade_distance : hint_range(0.0, 10.0) = 1.0;
	uniform float absorbance : hint_range(0.0, 10.0) = 2.0;
	
	uniform vec3 shallow_color : source_color = vec3(0.22, 0.66, 1.0);
	uniform vec3 deep_color : source_color = vec3(0.0, 0.25, 0.45);
	
	uniform float foam_amount : hint_range(0.0, 2.0) = 0.2;
	uniform vec3 foam_color : source_color = vec3(1);
	uniform sampler2D foam_noise : hint_default_white;
	
	uniform float roughness : hint_range(0.0, 1.0) = 0.05;
	
	uniform sampler2D wave_texture;
	uniform float wave_scale = 4.0;
	uniform float height_scale = 0.15;
	varying float wave_height;
	varying vec3 uv_world_pos;
	
	uniform sampler2D normal1;
	uniform vec2 wave_dir1 = vec2(1.0, 0.0);
	uniform sampler2D normal2;
	uniform vec2 wave_dir2 = vec2(0.0, 1.0);
	uniform float wave_speed : hint_range(0.0, 0.2) = 0.015;
	
	vec3 screen(vec3 base, vec3 blend){
		return 1.0 - (1.0 - base) * (1.0 - blend);
	}
	
	void vertex() {
		// Vertext displacement for waves
		uv_world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
		wave_height = texture(wave_texture, uv_world_pos.xz / wave_scale + TIME * wave_speed).r;
		VERTEX.y += wave_height * height_scale;
	}
	
	void fragment()
	{
		// Depth texture magic
		float depth = texture(DEPTH_TEXTURE, SCREEN_UV, 0.0).r;
		vec3 ndc = vec3(SCREEN_UV * 2.0 - 1.0, depth);
		vec4 world = INV_VIEW_MATRIX * INV_PROJECTION_MATRIX * vec4(ndc, 1.0);
		float depth_texture_y = world.y / world.w;
		float vertex_y = (INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).y;
		float vertical_depth = vertex_y - depth_texture_y;
		
		// Changes the color of geometry behind it as the water gets deeper
		float depth_fade_blend = exp(-vertical_depth / depth_fade_distance);
		depth_fade_blend = clamp(depth_fade_blend, 0.0, 1.0);
		
		// Makes the water more transparent as it gets more shallow
		float alpha_blend = -vertical_depth * absorbance;
		alpha_blend = clamp(1.0 - exp(alpha_blend), 0.0, 1.0);
		
		// Small layer of foam
		float foam_blend = clamp(1.0 - (vertical_depth / foam_amount), 0.0, 1.0);
		vec3 foam = foam_blend * foam_color;
		
		// Mix them all together
		vec3 color_out = mix(deep_color, shallow_color, depth_fade_blend);
		color_out = screen(color_out, foam);
		
		// Normal maps
		vec2 normal_offset1 = (TIME * wave_dir1) * wave_speed;
		vec2 normal_offset2 = (TIME * wave_dir2) * wave_speed;
		vec3 normal_blend = mix(texture(normal1, uv_world_pos.xz / wave_scale + normal_offset1), texture(normal2, uv_world_pos.xz / wave_scale + normal_offset2), 0.5).rgb;
		
		ALBEDO = color_out;
		ALPHA = alpha_blend;
		ROUGHNESS = roughness;
		NORMAL_MAP = normal_blend;
	}

</code>

1. Create a scene with a MeshInstance3D
2. Set the material to ShaderMaterial with the shader I provided
3. Close/Open project (not sure if this is necessary)
4. open inspector of the MeshInstance3D
5. PC start to freeze


### Minimal reproduction project (MRP)

[WaterCrash.zip](https://github.com/godotengine/godot/files/14231038/WaterCrash.zip)