From 97819441742c605d03c25a22af1c155cdcae7028 Mon Sep 17 00:00:00 2001 From: betalars Date: Sun, 22 Mar 2026 23:34:48 +0100 Subject: [PATCH] adding shiny dice and some more voice lines --- .../dice/dice-contsturction.blend | 4 +- .../volunteer_room/dice_models.tscn | 23 ++ .../volunteer_room/scenes/therapy_uni.tscn | 37 ++-- .../volunteer_room/scenes/trans.tscn | 40 ++-- .../volunteer_room/volunteer_room.tscn | 6 +- .../youth_room/import/dice-models.glb | 3 + .../youth_room/import/dice-models.glb.import | 55 +++++ .../import/materials/dice-base.gdshader | 200 +++++++++++++++++ .../import/materials/dice-base.gdshader.uid | 1 + .../import/materials/dice_base.tres | 28 +++ .../import/materials/dice_numbers.tres | 8 + .../youth_room/import/textures/dice_data.png | 3 + src/dice-model-import.tscn | 203 ++++++++++++++++++ 13 files changed, 570 insertions(+), 41 deletions(-) create mode 100644 src/base-environments/volunteer_room/dice_models.tscn create mode 100644 src/base-environments/youth_room/import/dice-models.glb create mode 100644 src/base-environments/youth_room/import/dice-models.glb.import create mode 100644 src/base-environments/youth_room/import/materials/dice-base.gdshader create mode 100644 src/base-environments/youth_room/import/materials/dice-base.gdshader.uid create mode 100644 src/base-environments/youth_room/import/materials/dice_base.tres create mode 100644 src/base-environments/youth_room/import/materials/dice_numbers.tres create mode 100644 src/base-environments/youth_room/import/textures/dice_data.png create mode 100644 src/dice-model-import.tscn diff --git a/design/volunteer room/dice/dice-contsturction.blend b/design/volunteer room/dice/dice-contsturction.blend index 5a2f4195..83a6c7cd 100644 --- a/design/volunteer room/dice/dice-contsturction.blend +++ b/design/volunteer room/dice/dice-contsturction.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b3f627c5c957fbc8fd0179aa012319a67539b30d351493f4047a61f2f9b253be -size 8343148 +oid sha256:606087ad3e0f70bb5f16ec0be76aac59a5c116759fecc14db9ff11032dd6eac7 +size 10205964 diff --git a/src/base-environments/volunteer_room/dice_models.tscn b/src/base-environments/volunteer_room/dice_models.tscn new file mode 100644 index 00000000..8376054d --- /dev/null +++ b/src/base-environments/volunteer_room/dice_models.tscn @@ -0,0 +1,23 @@ +[gd_scene format=3 uid="uid://d1rrpray86q17"] + +[ext_resource type="PackedScene" uid="uid://d1sqf5cgd8sba" path="res://base-environments/youth_room/import/dice-models.glb" id="1_vh430"] + +[node name="dice-models" unique_id=911256849 instance=ExtResource("1_vh430")] + +[node name="d12" parent="." index="0" unique_id=65177081] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.038978957, 0.6987885, -2.4119375) + +[node name="d6" parent="." index="1" unique_id=220306213] +transform = Transform3D(0, -1, 0, 1, 0, 0, 0, 0, 1, 2.2221472, 0.5278461, -2.6088107) + +[node name="d4" parent="." index="2" unique_id=1166078388] +transform = Transform3D(0.69187284, 0, 0.7220194, 0, 1, 0, -0.7220194, 0, 0.69187284, 3.019659, 0.34691018, -0.26562953) + +[node name="d20" parent="." index="3" unique_id=1519015411] +transform = Transform3D(0.7535016, -0.5529435, -0.3556526, 0.3512268, 0.79585314, -0.49321136, 0.5557653, 0.24672082, 0.79388523, -0.016941644, 0.81124437, -0.006403886) + +[node name="d10" parent="." index="4" unique_id=673773739] +transform = Transform3D(-0.30351675, -9.893264e-07, -0.9528261, 9.893264e-07, -1, 7.231638e-07, -0.9528261, -7.231638e-07, 0.30351675, -1.8407929, 0.027106762, -1.7446356) + +[node name="d100" parent="." index="5" unique_id=1792677124] +transform = Transform3D(0.8973767, 6.74069e-07, 0.44126534, -6.8304064e-07, 1, -1.3852043e-07, -0.44126534, -1.7709712e-07, 0.8973766, 1.4871418, 1.0925838, -0.7358486) diff --git a/src/base-environments/volunteer_room/scenes/therapy_uni.tscn b/src/base-environments/volunteer_room/scenes/therapy_uni.tscn index e20fad59..1209f6a4 100644 --- a/src/base-environments/volunteer_room/scenes/therapy_uni.tscn +++ b/src/base-environments/volunteer_room/scenes/therapy_uni.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://5dkocippxkwv"] +[gd_scene format=3 uid="uid://5dkocippxkwv"] [ext_resource type="Script" uid="uid://cb1d5cwtgllvq" path="res://logic-scenes/luna/playables/story_playable.gd" id="1_uxp36"] [ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="2_27dlw"] @@ -453,7 +453,7 @@ _data = { &"vanish": SubResource("Animation_x0d5q") } -[node name="therapy_uni" type="CenterContainer"] +[node name="therapy_uni" type="CenterContainer" unique_id=1162627027] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -464,12 +464,13 @@ script = ExtResource("1_uxp36") scene_id = 12 story_array = PackedStringArray("In hindsight I don\'t know if going to uni was the right decision.", "I doubt many professors would recommend me to come again.", "Me, the lazy student that just lacks the discipline to come to their lectures and do their assignments and learn for their exams. Sorry prof, I wanted to come but there was no class for me. ", "I didn\'t sign up to study math, biology and art history. I came here to study education.", "And my dear Mr. Professor:", "seeing your lacklustre lectures, I don\'t think there\'s much I can learn from you.", "So, rather than wasting my time on advanced algebra, I spend it on the student council to organize support I would have needed but didn\'t get.", "I have never worked or learned so much in my entire life.", "This is also where I got diagnosed by peer review.", "Who would have guessed that creating a social activity without alcohol or noise would attract all the neurodivergent students.", "This is also why I would maybe still do it all over again:", "Because these beautiful people very probably saved my life by not giving up on me and helping me get professional help.", "My therapist was somewhat old-fashioned and I got to learn from experience why deep psychology isn\'t recommended for autism or ADHD,", "but she didn\'t think I had that anyway.", "So we talked a lot about my depression, my sense of self and how it evolved from my past.", "She was a very good listener and had a gift for putting her finger on hurtful thoughts.", "She was never gentle in doing that, but she was right about one thing:", "Old thoughts are here to stay, but they can be rearranged.") paragraph_lengths = PackedInt32Array(0, 2, 5, 7, 9, 11, 14, 17) +progress = -1.0 -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1121701288] layout_mode = 2 mouse_filter = 1 -[node name="StartFrame" type="TextureRect" parent="PanelContainer"] +[node name="StartFrame" type="TextureRect" parent="PanelContainer" unique_id=1318378702] custom_minimum_size = Vector2(900, 900) layout_mode = 2 size_flags_vertical = 0 @@ -477,7 +478,7 @@ texture = ExtResource("2_27dlw") expand_mode = 2 stretch_mode = 4 -[node name="Panel" type="PanelContainer" parent="PanelContainer/StartFrame"] +[node name="Panel" type="PanelContainer" parent="PanelContainer/StartFrame" unique_id=1898386794] show_behind_parent = true layout_mode = 1 anchors_preset = 8 @@ -495,7 +496,7 @@ rotation = 0.349066 pivot_offset = Vector2(450, 450) mouse_filter = 1 -[node name="TextureRect" type="TextureRect" parent="PanelContainer/StartFrame"] +[node name="TextureRect" type="TextureRect" parent="PanelContainer/StartFrame" unique_id=1921991599] layout_mode = 1 anchors_preset = 6 anchor_left = 1.0 @@ -511,7 +512,7 @@ grow_vertical = 2 scale = Vector2(0.5, 0.5) texture = SubResource("ViewportTexture_ho85h") -[node name="SubViewport" type="SubViewport" parent="PanelContainer/StartFrame/TextureRect"] +[node name="SubViewport" type="SubViewport" parent="PanelContainer/StartFrame/TextureRect" unique_id=597707866] own_world_3d = true world_3d = SubResource("World3D_4m36g") transparent_bg = true @@ -520,15 +521,15 @@ canvas_cull_mask = 4293918724 size = Vector2i(1024, 1536) render_target_update_mode = 3 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer" unique_id=561287079] layout_mode = 2 -[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"] +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer" unique_id=264164665] layout_mode = 2 theme_type_variation = &"HeaderLarge" text = "Doctors Note" -[node name="StoryScroll" type="ScrollContainer" parent="PanelContainer/VBoxContainer"] +[node name="StoryScroll" type="ScrollContainer" parent="PanelContainer/VBoxContainer" unique_id=629808399] unique_name_in_owner = true custom_minimum_size = Vector2(0, 700) layout_mode = 2 @@ -539,7 +540,7 @@ scroll_vertical = 100 horizontal_scroll_mode = 0 vertical_scroll_mode = 3 -[node name="StoryLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/StoryScroll"] +[node name="StoryLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/StoryScroll" unique_id=2014458045] unique_name_in_owner = true custom_minimum_size = Vector2(800, 10) layout_mode = 2 @@ -550,7 +551,7 @@ fit_content = true scroll_active = false visible_characters_behavior = 1 -[node name="StartBottom" type="TextureRect" parent="PanelContainer/VBoxContainer"] +[node name="StartBottom" type="TextureRect" parent="PanelContainer/VBoxContainer" unique_id=27349884] custom_minimum_size = Vector2(0, 64) layout_mode = 2 size_flags_vertical = 8 @@ -558,19 +559,17 @@ texture = ExtResource("3_6qw45") expand_mode = 2 stretch_mode = 4 -[node name="SkipControl" parent="PanelContainer" instance=ExtResource("4_pf7gl")] +[node name="SkipControl" parent="PanelContainer" unique_id=9610280 instance=ExtResource("4_pf7gl")] unique_name_in_owner = true layout_mode = 2 -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=361993447] unique_name_in_owner = true root_node = NodePath("../PanelContainer/StartFrame/Panel") -libraries = { -&"": SubResource("AnimationLibrary_dc6th") -} -autoplay = "ini" +libraries/ = SubResource("AnimationLibrary_dc6th") +autoplay = &"ini" -[node name="Text" type="AudioStreamPlayer" parent="AnimationPlayer"] +[node name="Text" type="AudioStreamPlayer" parent="AnimationPlayer" unique_id=1305627574] mix_target = 2 bus = &"text" script = ExtResource("7_ld7n3") diff --git a/src/base-environments/volunteer_room/scenes/trans.tscn b/src/base-environments/volunteer_room/scenes/trans.tscn index 9b29cfb3..6ec850fa 100644 --- a/src/base-environments/volunteer_room/scenes/trans.tscn +++ b/src/base-environments/volunteer_room/scenes/trans.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=17 format=3 uid="uid://s48pybgsm5mo"] +[gd_scene format=3 uid="uid://s48pybgsm5mo"] [ext_resource type="Script" uid="uid://cb1d5cwtgllvq" path="res://logic-scenes/luna/playables/story_playable.gd" id="1_d3khy"] [ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="2_fe2un"] +[ext_resource type="PackedScene" uid="uid://duhldxihxn1x5" path="res://dice-model-import.tscn" id="3_fe2un"] [ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://import/interface-elements/bottom.png" id="3_uj7tn"] [ext_resource type="PackedScene" uid="uid://dvwuhobhka78d" path="res://ui/skip_control/skip_control.tscn" id="4_05o76"] [ext_resource type="AudioStream" uid="uid://dupcfwi54fpjx" path="res://base-environments/youth_room/audio/FoM_Lisa_Kindheit_Voice_Acting_deutsch_newt.wav" id="5_0b3yt"] @@ -458,7 +459,7 @@ _data = { &"vanish": SubResource("Animation_x0d5q") } -[node name="trans" type="CenterContainer"] +[node name="trans" type="CenterContainer" unique_id=995480796] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -469,12 +470,13 @@ script = ExtResource("1_d3khy") scene_id = 5 story_array = PackedStringArray("Ahw, shiny math rocks!", "It\'s funny how small moments can put your whole world upside down.", "It was the first time I ever made a DnD Character. I had no clue what I was doing.", "Good thing Markus has been DMing for longer than I live, so he helped me with all the rules and bits and bobs.", "He said I could be anything - as long as it was a tank. After seeing my Twokinds poster, he first suggested me making a druid, but he also mentioned the Barbarian ...", "and approaching problems head-first and tearing everything apart while raging ... was just a mood I could get behind.", "But then came *that* question:", "\"Do you want to be a Boy-barian or a Girl-barian?\"", "And that inner turmoil about boys and girls and ... fuck! I can\'t deal with this so I just shrugged it off.", "\"Okay, then roll for Gender!\". He put a d20 in a cup and gave it to me. \"Even for girl, odd for boy and floor is complicated.\", he laughed.", "I didn\'t appreciate that: \"It\'s in a cup, how is it supposed to hit the floor?\"", "His tone was still friendly, but suddenly more serious.", "\"I was meaning to ask what result you\'d be hoping for so you need to roll blind. But you may also just throw that die at your DM and see what happens.\"", "I threw that die at my DM.", "\"So, floor it is?\"", "I ... I couldn\'t be mad at that.", "When he then asked me for my name, I just spat out \"Xavier\".", "\"Okay, Xavier. And how do we want to name your Barbarian?\" I ... also couldn\'t be mad at that.", "Eventually, we settled on Ruby:", "a bearded dwarven women with a strong attitude that - unlike most other dwarves - for some reason really doesn\'t mind being mistaken for a man.", "And weirdly ... that was the first \"female\" character I enjoyed playing.", "Even tho I really didn\'t want that die to land on girl.") paragraph_lengths = PackedInt32Array(0, 3, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 21) +progress = -1.0 -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=2123696055] layout_mode = 2 mouse_filter = 1 -[node name="StartFrame" type="TextureRect" parent="PanelContainer"] +[node name="StartFrame" type="TextureRect" parent="PanelContainer" unique_id=610375576] custom_minimum_size = Vector2(900, 900) layout_mode = 2 size_flags_vertical = 0 @@ -482,7 +484,7 @@ texture = ExtResource("2_fe2un") expand_mode = 2 stretch_mode = 4 -[node name="Panel" type="PanelContainer" parent="PanelContainer/StartFrame"] +[node name="Panel" type="PanelContainer" parent="PanelContainer/StartFrame" unique_id=1758980155] show_behind_parent = true layout_mode = 1 anchors_preset = 8 @@ -500,7 +502,7 @@ rotation = 0.349066 pivot_offset = Vector2(450, 450) mouse_filter = 1 -[node name="TextureRect" type="TextureRect" parent="PanelContainer/StartFrame"] +[node name="TextureRect" type="TextureRect" parent="PanelContainer/StartFrame" unique_id=321755792] layout_mode = 1 anchors_preset = 6 anchor_left = 1.0 @@ -516,7 +518,7 @@ grow_vertical = 2 scale = Vector2(0.5, 0.5) texture = SubResource("ViewportTexture_ho85h") -[node name="SubViewport" type="SubViewport" parent="PanelContainer/StartFrame/TextureRect"] +[node name="SubViewport" type="SubViewport" parent="PanelContainer/StartFrame/TextureRect" unique_id=427031095] own_world_3d = true world_3d = SubResource("World3D_4m36g") transparent_bg = true @@ -525,15 +527,17 @@ canvas_cull_mask = 4293918724 size = Vector2i(1024, 1536) render_target_update_mode = 3 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +[node name="Node3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport" unique_id=1773866151 instance=ExtResource("3_fe2un")] + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer" unique_id=1953265333] layout_mode = 2 -[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"] +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer" unique_id=1837866878] layout_mode = 2 theme_type_variation = &"HeaderLarge" text = "Colorful Dice" -[node name="StoryScroll" type="ScrollContainer" parent="PanelContainer/VBoxContainer"] +[node name="StoryScroll" type="ScrollContainer" parent="PanelContainer/VBoxContainer" unique_id=720042581] unique_name_in_owner = true custom_minimum_size = Vector2(0, 700) layout_mode = 2 @@ -543,7 +547,7 @@ mouse_filter = 2 horizontal_scroll_mode = 0 vertical_scroll_mode = 3 -[node name="StoryLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/StoryScroll"] +[node name="StoryLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/StoryScroll" unique_id=1509749649] unique_name_in_owner = true custom_minimum_size = Vector2(800, 10) layout_mode = 2 @@ -554,7 +558,7 @@ fit_content = true scroll_active = false visible_characters_behavior = 1 -[node name="StartBottom" type="TextureRect" parent="PanelContainer/VBoxContainer"] +[node name="StartBottom" type="TextureRect" parent="PanelContainer/VBoxContainer" unique_id=1247893336] custom_minimum_size = Vector2(0, 64) layout_mode = 2 size_flags_vertical = 8 @@ -562,19 +566,17 @@ texture = ExtResource("3_uj7tn") expand_mode = 2 stretch_mode = 4 -[node name="SkipControl" parent="PanelContainer" instance=ExtResource("4_05o76")] +[node name="SkipControl" parent="PanelContainer" unique_id=882994032 instance=ExtResource("4_05o76")] unique_name_in_owner = true layout_mode = 2 -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=977179579] unique_name_in_owner = true root_node = NodePath("../PanelContainer/StartFrame/Panel") -libraries = { -&"": SubResource("AnimationLibrary_dc6th") -} -autoplay = "ini" +libraries/ = SubResource("AnimationLibrary_dc6th") +autoplay = &"ini" -[node name="Text" type="AudioStreamPlayer" parent="AnimationPlayer"] +[node name="Text" type="AudioStreamPlayer" parent="AnimationPlayer" unique_id=563069299] mix_target = 2 bus = &"text" script = ExtResource("7_ede0y") diff --git a/src/base-environments/volunteer_room/volunteer_room.tscn b/src/base-environments/volunteer_room/volunteer_room.tscn index 9b40d610..291498ed 100644 --- a/src/base-environments/volunteer_room/volunteer_room.tscn +++ b/src/base-environments/volunteer_room/volunteer_room.tscn @@ -19,6 +19,7 @@ [ext_resource type="PackedScene" uid="uid://brk4hjdf2x81a" path="res://logic-scenes/card_picker/card_picker.tscn" id="18_upyac"] [ext_resource type="PackedScene" uid="uid://bnskiyx1sksww" path="res://logic-scenes/board/physics-board.tscn" id="19_ci4rn"] [ext_resource type="PackedScene" uid="uid://citwb7f4dl3l1" path="res://thank-you.tscn" id="20_e1uao"] +[ext_resource type="PackedScene" uid="uid://d1rrpray86q17" path="res://base-environments/volunteer_room/dice_models.tscn" id="22_ci4rn"] [ext_resource type="Shader" uid="uid://d324neibxpomg" path="res://base-environments/intro/shaders/stars.gdshader" id="22_e1uao"] [ext_resource type="Texture2D" uid="uid://dabnlcnuticww" path="res://base-environments/intro/textures/sky_textures_2.png" id="23_my8p4"] @@ -240,7 +241,7 @@ transform = Transform3D(0.32358676, 0, -0.94619733, 0, 1, 0, 0.94619733, 0, 0.32 interaction = ExtResource("11_kmoh8") [node name="DiceInteractable" parent="Collectables" unique_id=960316357 instance=ExtResource("5_my8p4")] -transform = Transform3D(0.7071059, 0, -0.7071061, 0, 1, 0, 0.7071061, 0, 0.7071059, -2.07945, 0.5828748, 3.3940656) +transform = Transform3D(0.7071059, 0, -0.7071061, 0, 1, 0, 0.7071061, 0, 0.7071059, -2.1672184, 0.6933667, 3.4381282) interaction = ExtResource("16_e1uao") [node name="VoluntaryInteractable" parent="Collectables" unique_id=1328796377 instance=ExtResource("5_my8p4")] @@ -422,4 +423,7 @@ environment = SubResource("Environment_pdgua") camera_attributes = SubResource("CameraAttributesPractical_0bxa6") script = SubResource("GDScript_3k3rl") +[node name="dice-models2" parent="." unique_id=911256849 instance=ExtResource("22_ci4rn")] +transform = Transform3D(0.03, 0, 0, 0, 0.03, 0, 0, 0, 0.03, -2.3030388, 0.7617969, 3.7031662) + [editable path="PlayerController"] diff --git a/src/base-environments/youth_room/import/dice-models.glb b/src/base-environments/youth_room/import/dice-models.glb new file mode 100644 index 00000000..513fda50 --- /dev/null +++ b/src/base-environments/youth_room/import/dice-models.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a1f6299115b67c41942db9be8699cfadd2a318da486e07d7f5feee74f10545d +size 2550232 diff --git a/src/base-environments/youth_room/import/dice-models.glb.import b/src/base-environments/youth_room/import/dice-models.glb.import new file mode 100644 index 00000000..0d16f031 --- /dev/null +++ b/src/base-environments/youth_room/import/dice-models.glb.import @@ -0,0 +1,55 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://d1sqf5cgd8sba" +path="res://.godot/imported/dice-models.glb-91b26d85bfd554d654aab62c4c3d524e.scn" + +[deps] + +source_file="res://base-environments/youth_room/import/dice-models.glb" +dest_files=["res://.godot/imported/dice-models.glb-91b26d85bfd554d654aab62c4c3d524e.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={ +"materials": { +"dice_base": { +"use_external/enabled": true, +"use_external/fallback_path": "res://base-environments/youth_room/import/materials/dice_base.tres", +"use_external/path": "uid://bkrrjav7wtrcl" +}, +"dice_numbers": { +"use_external/enabled": true, +"use_external/fallback_path": "res://base-environments/youth_room/import/materials/dice_numbers.tres", +"use_external/path": "uid://cnd8u8f4vc3eo" +} +} +} +gltf/naming_version=2 +gltf/embedded_image_handling=1 diff --git a/src/base-environments/youth_room/import/materials/dice-base.gdshader b/src/base-environments/youth_room/import/materials/dice-base.gdshader new file mode 100644 index 00000000..985e3839 --- /dev/null +++ b/src/base-environments/youth_room/import/materials/dice-base.gdshader @@ -0,0 +1,200 @@ +shader_type spatial; + +const float INV_PI = 0.318309; + +uniform float _Rho : hint_range(0.0, 1.0, 1e-3) = 1.0; + +uniform sampler2D color_source : source_color, repeat_disable; +uniform sampler2D dice_data : source_color; +uniform float roughness : hint_range(0.0, 1.0, 0.01) = 0.4; +uniform float metallic : hint_range(0.0, 1.0, 0.01) = 0.0; +uniform float metallic_specular : hint_range(0.0, 1.0, 0.01) = 0.5; + +uniform float fresnel_power = 3.0; +uniform float interference_frequency = 3.0; +uniform vec3 base : source_color = vec3(1.0, 0.8, 0.6); +uniform vec3 shift : source_color = vec3(0.2, 0.7, 1.0); + +// https://github.com/Norrox/GodotShaders/blob/master/Shaders/Voronoi-Worley/Voronoi.shader +vec3 RNGV3(vec3 p) { + vec3 a = fract(vec3(p.x, p.y, p.z) * vec3(111.11,333.33,444.44)); + a += dot(a, a+33.51); + return fract(vec3(a.x*a.y, a.y*a.z, a.z*a.x)); //outputs a random vec2 between 0 and 1 +} + +vec4 voronoy(vec3 loc, float scale){ + loc = loc*scale; + vec4 output = vec4(0., 0., 0., 10.); + for(float y=-1.; y<=1.; y++){ + for(float x=-1.; x<=1.; x++){ + for(float z=-1.; z<=1.; z++){ + vec3 offs = vec3(x,y,z); + vec3 n = RNGV3(floor(loc)+offs)*2.0-1.0; + vec3 p = offs+sin(n) * .5; + float d = length((fract(loc)-0.5)-p); + if(d base_texture.y)*0.5-base_glitter.y); + METALLIC = 0.3; + //ALBEDO = vec3(.0); + BACKLIGHT = pow((1.0-base_depth), 2.2) * texture(color_source, vec2(dot(VIEW, NORMAL))).xyz; +} + +void light() { + vec3 n = normalize(NORMAL); + vec3 g_n = normalize(NORMAL + base_glitter.xyz); + vec3 l = normalize(LIGHT); + vec3 v = normalize(VIEW); + + vec3 h = normalize(v + l); + + float alpha = ROUGHNESS * ROUGHNESS; + float alpha_2 = alpha * alpha; + + float NdotL = dot(n, l); // cos(theta_l) == cos(theta_i). + float NdotV = dot(n, v); // cos(theta_v) == cos(theta_r). + float NdotH = dot(n, h); // cos(theta_h). + + float GNdotL = dot(g_n, l); // cos(theta_l) == cos(theta_i). + + float HdotL = dot(h, v); // cos(theta_d). + + float cNdotL = max(NdotL, 0.0); + float cGNdotL = max(GNdotL, 0.0); + float cNdotV = max(NdotV, 0.0); + float cNdotH = max(NdotH, 0.0); + + float cHdotL = max(HdotL, 0.0); + + /* Burley */ + float FD_l = pow(clamp(1.0 - NdotL, 0.0, 1.0), 5.0); + float FD_v = pow(clamp(1.0 - NdotV, 0.0, 1.0), 5.0); + + float FD90 = 0.5 + 2.0 * ROUGHNESS * HdotL * HdotL; + + float f_d = (_Rho / PI) * mix(1.0, FD90, FD_l) * mix(1.0, FD90, FD_v) * cNdotL; + + /* Trowbridge-Reitz-GGX */ + + /* Normal Distribution Function (GGX) */ + float D = alpha_2 / ( PI * pow(1.0 + (alpha_2 - 1.0) * NdotH * NdotH, 2.0) ); + + /* Geometric Function (Implicit) */ + //float G = 0.5 / mix(2.0 * NdotL * NdotV, NdotL + NdotV, alpha); + + /* Geometric Function (Smith-GGX) */ + float GL = 1.0 / (NdotL + sqrt(alpha_2 + (NdotL * NdotL) - alpha_2 * (NdotL * NdotL))); + float GV = 1.0 / (NdotV + sqrt(alpha_2 + (NdotV * NdotV) - alpha_2 * (NdotV * NdotV))); + + float G = GL * GV; + + /* Fresnel Function (Schlick’s Approximation) */ + vec3 f0 = mix(vec3(SPECULAR_AMOUNT * 0.08), ALBEDO, vec3(METALLIC)); + + vec3 F = f0 + (1.0 - f0) * pow(1.0 - HdotL, 5.0); + + vec3 f_s = min(max(D * G * F * cNdotL, 0.0), 1.0); + float f_g_s = min(max(D * G * cGNdotL, 0.0), 1.0); + + //vec3 backlight = max(0.0, (dot(LIGHT, reflect(VIEW, NORMAL))) * (dot(-NORMAL, LIGHT))) * BACKLIGHT; + vec3 backlight = BACKLIGHT * max(.0, dot(-NORMAL, LIGHT)-.2 + max(0.0, (dot(LIGHT, reflect(VIEW, NORMAL)))-.3)); + + DIFFUSE_LIGHT += LIGHT_COLOR * ATTENUATION * (f_d); + + //DIFFUSE_LIGHT += LIGHT_COLOR * ATTENUATION * f_d; + + vec3 irridescence = mix(irridescence(VIEW, NORMAL, LIGHT), vec3(1.0), fresnel(VIEW, NORMAL)); + + SPECULAR_LIGHT += LIGHT_COLOR * ATTENUATION * (f_s + f_g_s*base_glitter.w) * irridescence + backlight; + + +} diff --git a/src/base-environments/youth_room/import/materials/dice-base.gdshader.uid b/src/base-environments/youth_room/import/materials/dice-base.gdshader.uid new file mode 100644 index 00000000..84c0224a --- /dev/null +++ b/src/base-environments/youth_room/import/materials/dice-base.gdshader.uid @@ -0,0 +1 @@ +uid://d1qu5pkceo71p diff --git a/src/base-environments/youth_room/import/materials/dice_base.tres b/src/base-environments/youth_room/import/materials/dice_base.tres new file mode 100644 index 00000000..770c3465 --- /dev/null +++ b/src/base-environments/youth_room/import/materials/dice_base.tres @@ -0,0 +1,28 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://bkrrjav7wtrcl"] + +[ext_resource type="Shader" uid="uid://d1qu5pkceo71p" path="res://base-environments/youth_room/import/materials/dice-base.gdshader" id="1_4nq5u"] +[ext_resource type="Texture2D" uid="uid://bsx3i6hk4el4c" path="res://base-environments/youth_room/import/textures/dice_data.png" id="2_qjhvp"] + +[sub_resource type="Gradient" id="Gradient_6m1es"] +interpolation_color_space = 2 +offsets = PackedFloat32Array(0, 0.35923406, 0.7531713, 1) +colors = PackedColorArray(0.05169776, 0.008184712, 0.10792684, 1, 0.1552569, 0.22529125, 0.50927097, 1, 0.08409298, 0.44552475, 0.6182849, 1, 0.307025, 0.8766158, 0.7015734, 1) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_qrjfo"] +gradient = SubResource("Gradient_6m1es") +fill_from = Vector2(0, 1) +fill_to = Vector2(1, 1) + +[resource] +render_priority = 0 +shader = ExtResource("1_4nq5u") +shader_parameter/_Rho = 1.0 +shader_parameter/color_source = SubResource("GradientTexture2D_qrjfo") +shader_parameter/dice_data = ExtResource("2_qjhvp") +shader_parameter/roughness = 0.4 +shader_parameter/metallic = 0.0 +shader_parameter/metallic_specular = 0.5 +shader_parameter/fresnel_power = 3.0 +shader_parameter/interference_frequency = 3.0 +shader_parameter/base = Color(0.9598308, 0.82874936, 0.49482137, 1) +shader_parameter/shift = Color(0.2, 0.7, 1, 1) diff --git a/src/base-environments/youth_room/import/materials/dice_numbers.tres b/src/base-environments/youth_room/import/materials/dice_numbers.tres new file mode 100644 index 00000000..4747add7 --- /dev/null +++ b/src/base-environments/youth_room/import/materials/dice_numbers.tres @@ -0,0 +1,8 @@ +[gd_resource type="StandardMaterial3D" format=3 uid="uid://cnd8u8f4vc3eo"] + +[resource] +resource_name = "dice_numbers" +cull_mode = 2 +albedo_color = Color(0.83001226, 0.6630747, 0.4846493, 1) +metallic = 1.0 +roughness = 0.6 diff --git a/src/base-environments/youth_room/import/textures/dice_data.png b/src/base-environments/youth_room/import/textures/dice_data.png new file mode 100644 index 00000000..ce451e4f --- /dev/null +++ b/src/base-environments/youth_room/import/textures/dice_data.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bba0ae09c137a23041080df1c545d5deb13247999d6ea7f3fe6421929cb21026 +size 10367873 diff --git a/src/dice-model-import.tscn b/src/dice-model-import.tscn new file mode 100644 index 00000000..ac71ed68 --- /dev/null +++ b/src/dice-model-import.tscn @@ -0,0 +1,203 @@ +[gd_scene format=3 uid="uid://duhldxihxn1x5"] + +[ext_resource type="PackedScene" uid="uid://d1sqf5cgd8sba" path="res://base-environments/youth_room/import/dice-models.glb" id="1_g8chq"] +[ext_resource type="Shader" uid="uid://d324neibxpomg" path="res://base-environments/intro/shaders/stars.gdshader" id="2_2fft2"] +[ext_resource type="Material" uid="uid://bkrrjav7wtrcl" path="res://base-environments/youth_room/import/materials/dice_base.tres" id="2_pb38j"] +[ext_resource type="Texture2D" uid="uid://dabnlcnuticww" path="res://base-environments/intro/textures/sky_textures_2.png" id="3_yrkkl"] + +[sub_resource type="Gradient" id="Gradient_d5lk6"] +interpolation_mode = 2 +offsets = PackedFloat32Array(0, 0.175337, 0.414258, 0.593449, 0.700565, 0.770713, 0.798493, 0.809793, 0.954802) +colors = PackedColorArray(0, 0, 0, 0, 0.003, 0.0047, 0.02, 0.584314, 0.02385, 0.009, 0.09, 0, 0.06228, 0.0312, 0.12, 1, 0.22, 0.055, 0.1815, 0, 0.816757, 0.155467, 0.208686, 0.819608, 0.0136439, 0.0237636, 0.0955315, 1, 0.0120242, 0.0120251, 0.0360567, 0.356863, 0.00319355, 0.00476964, 0.0186391, 0.313726) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_apxml"] +gradient = SubResource("Gradient_d5lk6") +use_hdr = true + +[sub_resource type="Gradient" id="Gradient_liqu7"] +interpolation_mode = 2 +interpolation_color_space = 1 +offsets = PackedFloat32Array(0, 0.137476, 0.46516, 0.851224) +colors = PackedColorArray(0.127188, 0.325303, 0.352533, 1, 0.0512, 0.18112, 0.32, 1, 0.0406, 0.0530699, 0.29, 1, 0.106137, 0.0034, 0.17, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_vetqo"] +gradient = SubResource("Gradient_liqu7") +use_hdr = true + +[sub_resource type="Gradient" id="Gradient_87cdb"] +colors = PackedColorArray(0.85, 0.46325, 0.0765, 1, 0.825717, 0.47559, 0.983214, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_8fou6"] +gradient = SubResource("Gradient_87cdb") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_s2c5b"] +shader = ExtResource("2_2fft2") +shader_parameter/star_size = 120.0 +shader_parameter/star_colors = SubResource("GradientTexture1D_8fou6") +shader_parameter/sky_gradient = SubResource("GradientTexture1D_vetqo") +shader_parameter/nebula_gradient = SubResource("GradientTexture1D_apxml") +shader_parameter/nebula_offset = 0.5 +shader_parameter/universe_background = ExtResource("3_yrkkl") + +[sub_resource type="Sky" id="Sky_pjlgq"] +sky_material = SubResource("ShaderMaterial_s2c5b") + +[sub_resource type="Environment" id="Environment_f0pbs"] +background_mode = 2 +sky = SubResource("Sky_pjlgq") +tonemap_mode = 4 + +[sub_resource type="Shader" id="Shader_pb38j"] +code = "shader_type spatial; +render_mode unshaded; + +uniform sampler2D noise_texture; + +group_uniforms depth; +uniform int layers : hint_range(0, 64, 1) = 8; +uniform float depth_amount = 1.0; +uniform float fade_amount : hint_range(0.0, 16.0, 0.01) = 1.0; + +vec2 to_polar(vec2 uv) { + uv = uv * 2.0 - 1.0; + float radius = length(uv); + float angle = atan(uv.x, uv.y); + return vec2(angle / PI, radius) / 2.0; +} + +float overlay(float a, float b){ + float limit = step(0.5, a); + return mix(2.0 * a * b, 1.0 - 2.0 * (1.0 - a) * (1.0 - b), limit); +} + +vec2 parallax(float depth, vec3 n, vec3 t, vec3 v) { + vec3 normal = normalize(n); + vec3 tangent = normalize(t); + vec3 bitangent = cross(normal, tangent); + vec3 view = normalize(v); + vec3 view_tangent = vec3(dot(view, tangent), dot(view, bitangent), dot(view, normal)); + vec2 offset = (view_tangent.xy / max(view_tangent.z, 0.001)) * depth; + offset = vec2(-offset.x, offset.y); + + return offset; +} + +void fragment() { + float value = 0.0; + + for(int i = 0; i < layers; i++){ + float t = float(i) / float(layers); + float depth = t * depth_amount; + + vec2 circle_uv = UV + parallax(depth, NORMAL, TANGENT, VIEW); + float circle = length(circle_uv * 2.0 - 1.0); + + circle = clamp((circle - 0.2) / 0.8, 0.0, 1.0); + + vec2 noise_uv = UV + parallax(depth, NORMAL, TANGENT, VIEW); + noise_uv = to_polar(noise_uv); + noise_uv.y += TIME * 0.1; + noise_uv += t; + float noise = texture(noise_texture, noise_uv).r; + + float layer_value = overlay(circle, noise); + layer_value = step(0.5, layer_value); + + layer_value *= pow(1.0 - t, fade_amount); + + value = max(value, layer_value); + } + + ALBEDO = vec3(value); +}" + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_f0pbs"] +render_priority = 0 +shader = SubResource("Shader_pb38j") +shader_parameter/layers = 8 +shader_parameter/depth_amount = 1.0 +shader_parameter/fade_amount = 1.0 + +[sub_resource type="Animation" id="Animation_pb38j"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("dice-models:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 0, 0)] +} + +[sub_resource type="Animation" id="Animation_f0pbs"] +resource_name = "rotato" +length = 20.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("dice-models:rotation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 20), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(0, 6.2831855, 0)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_2fft2"] +_data = { +&"RESET": SubResource("Animation_pb38j"), +&"rotato": SubResource("Animation_f0pbs") +} + +[node name="Node3D" type="Node3D" unique_id=1773866151] + +[node name="dice-models" parent="." unique_id=911256849 instance=ExtResource("1_g8chq")] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=643243255] +environment = SubResource("Environment_f0pbs") + +[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=1222420168] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.8118598, 5.654051, -4.128759) +light_color = Color(0.11549998, 0.67182505, 0.77, 1) +light_energy = 50.0 +light_size = 0.5 +omni_range = 11.019698 + +[node name="OmniLight3D2" type="OmniLight3D" parent="." unique_id=1930269367] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.4119627, -0.52938986, 2.8074057) +light_color = Color(0.8606616, 0.4447567, 0.7934354, 1) +light_energy = 20.0 +light_size = 0.5 +omni_range = 13.7001095 + +[node name="CSGSphere3D" type="CSGSphere3D" parent="." unique_id=1429866322] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.2142496, 3.9381886, -2.3222432) +visible = false +radial_segments = 24 +rings = 12 +material = ExtResource("2_pb38j") + +[node name="CSGSphere3D" type="CSGSphere3D" parent="CSGSphere3D" unique_id=1312662813] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.2142496, 3.9381886, -2.3222432) +radial_segments = 24 +rings = 12 +material = SubResource("ShaderMaterial_f0pbs") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=25046560] +libraries/ = SubResource("AnimationLibrary_2fft2") +autoplay = &"rotato" + +[node name="Camera3D" type="Camera3D" parent="." unique_id=4702504] +transform = Transform3D(1, 0, 0, 0, 0.98768836, 0.15643448, 0, -0.15643448, 0.98768836, 0, 5.3918023, 10.009028) +fov = 46.4 + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1438886491] +transform = Transform3D(0.6984153, -0.46764836, 0.5417759, 0, 0.7569951, 0.65342057, -0.71569276, -0.4563589, 0.52869695, 2.2407079, 0.15685582, 0) +light_color = Color(0.83963645, 0.80125695, 0.5947978, 1)