meat_madness_redux/godot/tests/ground_squish/meat_plane_material.tres

69 lines
2.3 KiB
Plaintext
Raw Normal View History

2022-12-29 14:09:36 -07:00
[gd_resource type="ShaderMaterial" load_steps=5 format=2]
2022-11-27 13:31:09 -07:00
2023-01-04 01:43:35 -07:00
[ext_resource path="res://effects/sink_block_tiled_texture.png" type="Texture" id=1]
2022-11-27 13:31:09 -07:00
[sub_resource type="Shader" id=4]
code = "// NOTE: Shader automatically converted from Godot Engine 3.5.1.stable.mono's SpatialMaterial.
shader_type spatial;
2022-12-29 14:09:36 -07:00
// Needs world_vertex_coords
2022-11-27 13:31:09 -07:00
render_mode world_vertex_coords,async_visible,blend_mix,depth_draw_opaque,cull_disabled,diffuse_burley,specular_schlick_ggx;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
uniform vec3 player_pos;
2022-12-29 14:09:36 -07:00
uniform sampler2D curve;
uniform float sink_factor : hint_range(1.0, 10.0, 0.1);
uniform float end_distance : hint_range(1.0, 30.0, 0.1);
2022-11-27 13:31:09 -07:00
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
2022-12-29 14:09:36 -07:00
float w = clamp(distance(player_pos.xz, VERTEX.xz), 0.0, end_distance) / end_distance;
float amount = texture(curve, vec2(w, 0.0)).r;
VERTEX.y -= (1.0-w) * sink_factor;
2022-11-27 13:31:09 -07:00
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
METALLIC = metallic;
ROUGHNESS = roughness;
SPECULAR = specular;
}
"
2022-12-29 14:09:36 -07:00
[sub_resource type="Curve" id=5]
2023-01-04 01:43:35 -07:00
_data = [ Vector2( 0, 0 ), 0.0, -0.454261, 0, 0, Vector2( 0.292308, 0.525 ), 2.53247, 2.53247, 0, 0, Vector2( 0.645517, 0.186364 ), -0.454844, 0.0, 0, 0, Vector2( 0.838621, 0.822727 ), 0.0, 0.0, 0, 0, Vector2( 0.925517, 0.122727 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.859091 ), 0.0, 0.0, 0, 0 ]
2022-12-29 14:09:36 -07:00
[sub_resource type="CurveTexture" id=6]
curve = SubResource( 5 )
2022-11-27 13:31:09 -07:00
[resource]
resource_name = "TestMeat"
shader = SubResource( 4 )
shader_param/albedo = Color( 1, 1, 1, 1 )
shader_param/specular = 0.5
shader_param/metallic = 0.0
shader_param/roughness = 1.0
shader_param/point_size = 1.0
2023-01-04 01:43:35 -07:00
shader_param/uv1_scale = Vector3( 10, 10, 1 )
2022-11-27 13:31:09 -07:00
shader_param/uv1_offset = Vector3( 0, 0, 0 )
shader_param/uv2_scale = Vector3( 1, 1, 1 )
shader_param/uv2_offset = Vector3( 0, 0, 0 )
shader_param/player_pos = null
2023-01-04 01:43:35 -07:00
shader_param/sink_factor = 3.6
shader_param/end_distance = 5.4
2022-11-27 13:31:09 -07:00
shader_param/texture_albedo = ExtResource( 1 )
2022-12-29 14:09:36 -07:00
shader_param/curve = SubResource( 6 )