copy from thegates-jam repo

This commit is contained in:
Nordup 2024-03-31 09:25:42 +04:00
parent c1a7ad74e1
commit 1a335de566
523 changed files with 22408 additions and 0 deletions

BIN
levels/portal/foam_mask.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c7iebe8trdpbv"
path.s3tc="res://.godot/imported/foam_mask.png-d06420bfbdb9539f5c6e4e675088d913.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://levels/portal/foam_mask.png"
dest_files=["res://.godot/imported/foam_mask.png-d06420bfbdb9539f5c6e4e675088d913.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

19
levels/portal/portal.gd Normal file
View file

@ -0,0 +1,19 @@
extends Node3D
signal portal_entered(url: String)
@export var url: String
func _on_portal_entered(body):
if not body is CharacterBody3D: return
await get_tree().create_timer(0.2).timeout
print("portal_entered: " + url)
portal_entered.emit(url)
func shut_down(_body) -> void:
$Portal/MeshInstance3D.visible = false
$Portal/MeshInstance3D2.visible = false
$Portal/OmniLight3D.visible = false
$Portal/CollisionShape3D.set_deferred("disabled", true)

View file

@ -0,0 +1,50 @@
shader_type spatial;
render_mode unshaded;
uniform sampler2D caustics_texture : hint_default_black;
uniform sampler2D color_gradient : source_color;
uniform sampler2D distort_noise : hint_default_black;
uniform float flow_speed = 0.3;
uniform float vignette_size = 0.3;
uniform float vignette_blend = 0.1;
uniform float distort_strength = 0.1;
uniform float transparency = 0.5;
vec2 polar_coordinates(vec2 uv, vec2 center, float zoom, float repeat)
{
vec2 dir = uv - center;
highp float radius = length(dir) * 2.0;
highp float angle = atan(dir.y, dir.x) / TAU;
return mod(vec2(radius * zoom, angle * repeat), 1.0);
}
void vertex()
{
float dn = texture(distort_noise, UV + TIME * 0.1).r;
VERTEX.y += dn * 0.1;
}
void fragment()
{
// Polar UVs + Noise for caustics
vec2 base_uv = UV;
float dn = texture(distort_noise, UV + TIME * 0.1).r;
base_uv += dn * distort_strength;
base_uv -= distort_strength / 2.0;
highp vec2 polar_uv = polar_coordinates(base_uv, vec2(0.5), 1.0, 1.0);
polar_uv.x -= TIME * flow_speed;
float caus = texture(caustics_texture, polar_uv).r;
// Fade out caustics
float cd = distance(UV, vec2(0.5));
float vign = 1.0 - smoothstep(vignette_size, vignette_size + vignette_blend, cd);
// Color the caustics
float grad_uv = caus * vign;
vec3 color = texture(color_gradient, vec2(grad_uv)).rgb;
ALBEDO = color;
ALPHA = transparency;
}

Binary file not shown.

84
levels/portal/portal.tscn Normal file
View file

@ -0,0 +1,84 @@
[gd_scene load_steps=9 format=3 uid="uid://dykqq00uscsiy"]
[ext_resource type="Script" path="res://levels/portal/portal.gd" id="1_4deld"]
[ext_resource type="Material" uid="uid://ca0wtj0y4axjm" path="res://levels/portal/portal.material" id="2_yk1uj"]
[ext_resource type="PackedScene" uid="uid://b8hsfhawld5dg" path="res://addons/kenney_platformer_kit/doorOpen.glb" id="3_u08r8"]
[sub_resource type="PlaneMesh" id="PlaneMesh_uqi57"]
material = ExtResource("2_yk1uj")
size = Vector2(3.585, 1.63)
[sub_resource type="BoxShape3D" id="BoxShape3D_gs3cv"]
size = Vector3(0.3, 3.585, 1.63)
[sub_resource type="Animation" id="Animation_tc7hl"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("OmniLight3D:light_energy")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [3.141]
}
[sub_resource type="Animation" id="Animation_ea30s"]
resource_name = "idle"
length = 2.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("OmniLight3D:light_energy")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1, 2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [5.0, 2.5, 5.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kfovg"]
_data = {
"RESET": SubResource("Animation_tc7hl"),
"idle": SubResource("Animation_ea30s")
}
[node name="Portal" type="Node3D"]
script = ExtResource("1_4deld")
[node name="Portal" type="Area3D" parent="."]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Portal"]
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 1.79371, 0)
mesh = SubResource("PlaneMesh_uqi57")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Portal"]
transform = Transform3D(4.37114e-08, 1, 8.74228e-08, 1, -4.37114e-08, 0, 3.82137e-15, 8.74228e-08, -1, 0, 1.79371, 0)
mesh = SubResource("PlaneMesh_uqi57")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Portal"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.79371, 0)
shape = SubResource("BoxShape3D_gs3cv")
[node name="OmniLight3D" type="OmniLight3D" parent="Portal"]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 1.751, 0)
light_color = Color(0.156863, 0.513726, 0.988235, 1)
light_energy = 3.141
omni_range = 9.48185
[node name="AnimationPlayer" type="AnimationPlayer" parent="Portal"]
libraries = {
"": SubResource("AnimationLibrary_kfovg")
}
autoplay = "idle"
[node name="doorOpen2" parent="." instance=ExtResource("3_u08r8")]
[connection signal="body_entered" from="Portal" to="." method="_on_portal_entered"]