Compare commits
No commits in common. "a7d3815a0790720648940eaf58fb6ff3e02650af" and "322354d144315c21c49ec1ab50ecc0f68768ca17" have entirely different histories.
a7d3815a07
...
322354d144
BIN
godot/assets/models/MeatElevatorEntrance.material (Stored with Git LFS)
BIN
godot/assets/models/MeatElevatorEntrance.material (Stored with Git LFS)
Binary file not shown.
|
@ -1,30 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item;
|
||||
|
||||
uniform sampler2D curve;
|
||||
|
||||
void fragment() {
|
||||
COLOR.rgb = vec3(0.0, 0.0, 0.0);
|
||||
COLOR.r = texture(curve, vec2(SCREEN_UV.x, 0.0)).r;
|
||||
}"
|
||||
|
||||
[sub_resource type="Curve" id=3]
|
||||
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=4]
|
||||
curve = SubResource( 3 )
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/curve = SubResource( 4 )
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
|
||||
material = SubResource( 2 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
|
@ -1,4 +1,6 @@
|
|||
extends MeshInstance
|
||||
|
||||
onready var player = $"/root".find_node("Player", true, false)
|
||||
|
||||
func _process(_delta):
|
||||
get_active_material(0).set_shader_param("player_pos", Util.player.camera_position())
|
||||
get_active_material(0).set_shader_param("player_pos", player.camera_position())
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="ShaderMaterial" load_steps=5 format=2]
|
||||
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://tests/ground_squish/stringy_meat.jpg" type="Texture" id=1]
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
|||
code = "// NOTE: Shader automatically converted from Godot Engine 3.5.1.stable.mono's SpatialMaterial.
|
||||
|
||||
shader_type spatial;
|
||||
// Needs world_vertex_coords
|
||||
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;
|
||||
|
@ -20,15 +19,16 @@ uniform vec3 uv2_scale;
|
|||
uniform vec3 uv2_offset;
|
||||
uniform vec3 player_pos;
|
||||
|
||||
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);
|
||||
const float MAX_DISTANCE = 2.5;
|
||||
const float MAX_SINK = .3;
|
||||
|
||||
void vertex() {
|
||||
UV=UV*uv1_scale.xy+uv1_offset.xy;
|
||||
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;
|
||||
float d = clamp(distance(VERTEX.xz, player_pos.xz), 0.0, MAX_DISTANCE) / MAX_DISTANCE;
|
||||
d = smoothstep(0.0, 1.0, d);
|
||||
float decrease = mix(MAX_SINK, 0.0, d);
|
||||
float y_dist = mix(0.0, MAX_SINK, clamp(player_pos.y - VERTEX.y, 0.0, MAX_SINK)/MAX_SINK);
|
||||
VERTEX.y -= decrease + y_dist;
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,12 +43,6 @@ void fragment() {
|
|||
}
|
||||
"
|
||||
|
||||
[sub_resource type="Curve" id=5]
|
||||
_data = [ Vector2( 0, 0 ), 0.0, -0.454261, 0, 0, Vector2( 0.292308, 0.525 ), 2.53247, 2.53247, 0, 0, Vector2( 1, 1 ), -0.454844, 0.0, 0, 0 ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=6]
|
||||
curve = SubResource( 5 )
|
||||
|
||||
[resource]
|
||||
resource_name = "TestMeat"
|
||||
shader = SubResource( 4 )
|
||||
|
@ -62,7 +56,4 @@ 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
|
||||
shader_param/sink_factor = 1.8
|
||||
shader_param/end_distance = 5.2
|
||||
shader_param/texture_albedo = ExtResource( 1 )
|
||||
shader_param/curve = SubResource( 6 )
|
||||
|
|
Loading…
Reference in New Issue