From 3c50e5f630caa09a3c4cb937c6d83dd73f12555d Mon Sep 17 00:00:00 2001 From: Nitwel Date: Wed, 29 Nov 2023 22:24:38 +0100 Subject: [PATCH] add fake windows for recording --- assets/ComfyUI_00480_2.png | 3 ++ assets/ComfyUI_00480_2.png.import | 36 +++++++++++++++++++ content/entities/light/light.tscn | 2 +- .../entities/media_player/media_player.tscn | 2 +- content/ui/menu/room/room_menu.gd | 6 ++++ content/ui/menu/room/room_menu.gdshader | 10 ++++++ content/ui/menu/room/room_menu.tscn | 13 +++++++ content/ui/menu/room/window.tscn | 28 +++++++++++++++ content/ui/menu/room/windows.tscn | 29 +++++++++++++++ 9 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 assets/ComfyUI_00480_2.png create mode 100644 assets/ComfyUI_00480_2.png.import create mode 100644 content/ui/menu/room/room_menu.gdshader create mode 100644 content/ui/menu/room/window.tscn create mode 100644 content/ui/menu/room/windows.tscn diff --git a/assets/ComfyUI_00480_2.png b/assets/ComfyUI_00480_2.png new file mode 100644 index 0000000..10d102f --- /dev/null +++ b/assets/ComfyUI_00480_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15b0e5245f1865e395f8782d9cf4c457a766fb1f6a6c36f6cde65235b0abaa4e +size 497667 diff --git a/assets/ComfyUI_00480_2.png.import b/assets/ComfyUI_00480_2.png.import new file mode 100644 index 0000000..6451405 --- /dev/null +++ b/assets/ComfyUI_00480_2.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddkdqduooyt5e" +path.s3tc="res://.godot/imported/ComfyUI_00480_2.png-84052116f2e4190ce314367ec91c6f7b.s3tc.ctex" +path.etc2="res://.godot/imported/ComfyUI_00480_2.png-84052116f2e4190ce314367ec91c6f7b.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/ComfyUI_00480_2.png" +dest_files=["res://.godot/imported/ComfyUI_00480_2.png-84052116f2e4190ce314367ec91c6f7b.s3tc.ctex", "res://.godot/imported/ComfyUI_00480_2.png-84052116f2e4190ce314367ec91c6f7b.etc2.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 diff --git a/content/entities/light/light.tscn b/content/entities/light/light.tscn index dc72388..4602274 100644 --- a/content/entities/light/light.tscn +++ b/content/entities/light/light.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://content/entities/light/light.gd" id="1_ykxy3"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="4_4sfxb"] [ext_resource type="Material" uid="uid://vce66e7sbc3n" path="res://content/entities/light/light_on.tres" id="5_50gph"] -[ext_resource type="PackedScene" path="res://content/ui/components/slider/slider.tscn" id="6_mhjlm"] +[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="6_mhjlm"] [sub_resource type="SphereShape3D" id="SphereShape3D_ukj14"] radius = 0.05 diff --git a/content/entities/media_player/media_player.tscn b/content/entities/media_player/media_player.tscn index c721f57..b23422a 100644 --- a/content/entities/media_player/media_player.tscn +++ b/content/entities/media_player/media_player.tscn @@ -3,7 +3,7 @@ [ext_resource type="PackedScene" uid="uid://bsjqdvkt0u87c" path="res://content/ui/components/button/button.tscn" id="1_8opk3"] [ext_resource type="Script" path="res://content/entities/media_player/media_player.gd" id="1_ame17"] [ext_resource type="Script" path="res://content/functions/movable.gd" id="3_bguto"] -[ext_resource type="PackedScene" path="res://content/ui/components/slider/slider.tscn" id="4_w73hw"] +[ext_resource type="PackedScene" uid="uid://pk5k1q8bx0rj" path="res://content/ui/components/slider/slider.tscn" id="4_w73hw"] [ext_resource type="FontVariation" uid="uid://sshfnckriqxn" path="res://assets/icons/icons.tres" id="5_koe28"] [sub_resource type="BoxShape3D" id="BoxShape3D_vi3eg"] diff --git a/content/ui/menu/room/room_menu.gd b/content/ui/menu/room/room_menu.gd index 82a4485..ac16576 100644 --- a/content/ui/menu/room/room_menu.gd +++ b/content/ui/menu/room/room_menu.gd @@ -2,6 +2,7 @@ extends Node3D const wall_corner_scene = preload("./wall_corner.tscn") const wall_edge_scene = preload("./wall_edge.tscn") +const windows_scene = preload("./windows.tscn") @onready var teleport_root = $TeleportRoot @onready var background = $Background @@ -10,6 +11,7 @@ const wall_edge_scene = preload("./wall_edge.tscn") @onready var wall_mesh = $TeleportRoot/WallMesh @onready var wall_collisions = $TeleportRoot/WallCollisions @onready var toggle_edit_button = $Interface/ToggleEdit +@onready var spawn_windows = $SpawnWindows var moving = null var ground_plane = Plane(Vector3.UP, Vector3.ZERO) @@ -20,6 +22,10 @@ func _ready(): background.visible = false get_tree().get_root().get_node("Main").add_child.call_deferred(teleport_root) + spawn_windows.on_button_down.connect(func(): + get_tree().root.get_node("Main").add_child.call_deferred(windows_scene.instantiate()) + ) + teleport_root.get_node("Ground/Clickable").on_click.connect(func(event): if !edit_enabled: return diff --git a/content/ui/menu/room/room_menu.gdshader b/content/ui/menu/room/room_menu.gdshader new file mode 100644 index 0000000..061034b --- /dev/null +++ b/content/ui/menu/room/room_menu.gdshader @@ -0,0 +1,10 @@ +shader_type spatial; +render_mode unshaded, cull_disabled; + +uniform sampler2D SCREEN_TEXTURE : hint_screen_texture; +uniform float blur_amount: hint_range(0.0, 5.0, 0.1) = 2; + +void fragment() { + vec4 lod = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount); + ALBEDO = lod.xyz; +} \ No newline at end of file diff --git a/content/ui/menu/room/room_menu.tscn b/content/ui/menu/room/room_menu.tscn index 71a507b..558efff 100644 --- a/content/ui/menu/room/room_menu.tscn +++ b/content/ui/menu/room/room_menu.tscn @@ -60,3 +60,16 @@ modulate = Color(0, 0, 0, 1) text = "Edit Room" font_size = 18 outline_size = 0 + +[node name="CreateBlur" type="Label3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.15, 0.01, 0.261858) +pixel_size = 0.001 +modulate = Color(0, 0, 0, 1) +text = "Fake Windows" +font_size = 18 +outline_size = 0 + +[node name="SpawnWindows" parent="." instance=ExtResource("3_whl7a")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.05, 0, 0.26) +label = "lens_blur" +icon = true diff --git a/content/ui/menu/room/window.tscn b/content/ui/menu/room/window.tscn new file mode 100644 index 0000000..476a09c --- /dev/null +++ b/content/ui/menu/room/window.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=6 format=3 uid="uid://scu77f1crn6"] + +[ext_resource type="Script" path="res://content/functions/movable.gd" id="2_g70gm"] +[ext_resource type="Texture2D" uid="uid://ddkdqduooyt5e" path="res://assets/ComfyUI_00480_2.png" id="3_qlot3"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xx1h5"] +shading_mode = 0 +albedo_texture = ExtResource("3_qlot3") + +[sub_resource type="PlaneMesh" id="PlaneMesh_ndue5"] +size = Vector2(1, 1) +orientation = 2 + +[sub_resource type="BoxShape3D" id="BoxShape3D_00pto"] +size = Vector3(1, 1, 0.02) + +[node name="Window" type="StaticBody3D"] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.000999987) +material_override = SubResource("StandardMaterial3D_xx1h5") +mesh = SubResource("PlaneMesh_ndue5") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_00pto") + +[node name="Movable" type="Node" parent="."] +script = ExtResource("2_g70gm") diff --git a/content/ui/menu/room/windows.tscn b/content/ui/menu/room/windows.tscn new file mode 100644 index 0000000..0d88302 --- /dev/null +++ b/content/ui/menu/room/windows.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=3 uid="uid://bubusve8ijc7h"] + +[ext_resource type="PackedScene" uid="uid://scu77f1crn6" path="res://content/ui/menu/room/window.tscn" id="1_nl1ra"] + +[node name="Windows" type="Node3D"] + +[node name="Window" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.32, 0, 0, 0, 1.04, 0, 0, 0, 1, 0, 0, 0) + +[node name="Window3" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.32, 0, 0, 0, 1.04, 0, 0, 0, 1, 0.49, 0, 0) + +[node name="Window2" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.76, 0, 0, 0, 0.35, 0, 0, 0, 1, 0.26, 0.71, -0.04) + +[node name="Window8" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.76, 0, 0, 0, 0.35, 0, 0, 0, 1, 1.67, 1.84, -0.04) + +[node name="Window4" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.34, 0, 0, 0, 1.03, 0, 0, 0, 1, 1.45, 1.1, -0.03) + +[node name="Window5" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.34, 0, 0, 0, 1.03, 0, 0, 0, 1, 1.9, 1.1, -0.03) + +[node name="Window6" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.34, 0, 0, 0, 0.73, 0, 0, 0, 1, 1.45, 0.14, -0.03) + +[node name="Window7" parent="." instance=ExtResource("1_nl1ra")] +transform = Transform3D(0.34, 0, 0, 0, 0.73, 0, 0, 0, 1, 1.9, 0.14, -0.03)