Skip to content

Commit

Permalink
Add dynamic geometry (closes #30).
Browse files Browse the repository at this point in the history
  • Loading branch information
stechyo committed Feb 24, 2024
1 parent f3a6f16 commit ac5acc0
Show file tree
Hide file tree
Showing 17 changed files with 588 additions and 185 deletions.
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env.Append(CPPPATH=["src/"])

if env.get("CC", "").lower() == "cl":
# Building with MSVC
env.AppendUnique(CCFLAGS=("/I", "src/lib/steamaudio/include/"))
env.AppendUnique(CCFLAGS=("/I", "src/lib/steamaudio/unity/include/phonon/"))
else:
env.AppendUnique(CCFLAGS=("-isystem", "src/lib/steamaudio/include/"))
env.AppendUnique(CCFLAGS=("-isystem", "src/lib/steamaudio/unity/include/phonon/"))

sources = Glob("src/*.cpp")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ SteamAudioPlayer = "res://addons/godot-steam-audio/icons/steam_audio_player.svg"
SteamAudioListener = "res://addons/godot-steam-audio/icons/steam_audio_listener.svg"
SteamAudioConfig = "res://addons/godot-steam-audio/icons/steam_audio_config.svg"
SteamAudioGeometry = "res://addons/godot-steam-audio/icons/steam_audio_geometry.svg"
SteamAudioDynamicGeometry = "res://addons/godot-steam-audio/icons/steam_audio_dynamic_geometry.svg"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://mtldg3f40ycf"
path="res://.godot/imported/steam_audio_dynamic_geometry.svg-8ba66359b77f42161a443b8fbe487784.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://addons/godot-steam-audio/icons/steam_audio_dynamic_geometry.svg"
dest_files=["res://.godot/imported/steam_audio_dynamic_geometry.svg-8ba66359b77f42161a443b8fbe487784.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[gd_resource type="SteamAudioMaterial" format=3 uid="uid://bljhgad6g2vnm"]

[resource]
absorption_low = 0.24
absorption_mid = 0.69
absorption_high = 0.73
scattering = 0.05
transmission_low = 0.015
transmission_mid = 0.002
transmission_high = 0.001
absorption_low = 1.0
absorption_mid = 1.0
absorption_high = 1.0
69 changes: 68 additions & 1 deletion project/scenes/demo.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=40 format=3 uid="uid://bilxmr83dwsgw"]
[gd_scene load_steps=46 format=3 uid="uid://bilxmr83dwsgw"]

[ext_resource type="Script" path="res://src/player.gd" id="1_c2adp"]
[ext_resource type="SteamAudioMaterial" uid="uid://dbai50r63k346" path="res://addons/godot-steam-audio/materials/rock_material.tres" id="1_wtcfy"]
Expand All @@ -9,6 +9,7 @@
[ext_resource type="SteamAudioMaterial" uid="uid://cexuij8fef5ay" path="res://addons/godot-steam-audio/materials/carpet_material.tres" id="6_ph4pe"]
[ext_resource type="Script" path="res://src/random_pluck.gd" id="7_gx8pe"]
[ext_resource type="Script" path="res://src/door.gd" id="8_jqgel"]
[ext_resource type="SteamAudioMaterial" uid="uid://bljhgad6g2vnm" path="res://addons/godot-steam-audio/materials/concrete_material.tres" id="10_hrk2r"]

[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_nkwlr"]

Expand Down Expand Up @@ -166,6 +167,50 @@ height = 2.0
[sub_resource type="SphereShape3D" id="SphereShape3D_mfyrx"]
radius = 1.0

[sub_resource type="BoxMesh" id="BoxMesh_vkxem"]
size = Vector3(0.5, 3, 3)

[sub_resource type="Animation" id="Animation_kvteu"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(-2, 2, 0)]
}

[sub_resource type="Animation" id="Animation_o0cm3"]
resource_name = "new_animation"
length = 15.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 8, 15),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(-2, 5, 0), Vector3(-2, -3, 0), Vector3(-2, 5, 0)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_a3b03"]
_data = {
"RESET": SubResource("Animation_kvteu"),
"new_animation": SubResource("Animation_o0cm3")
}

[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_eiu6u"]
data = PackedVector3Array(-0.25, 1.5, 1.5, 0.25, 1.5, 1.5, -0.25, -1.5, 1.5, 0.25, 1.5, 1.5, 0.25, -1.5, 1.5, -0.25, -1.5, 1.5, 0.25, 1.5, -1.5, -0.25, 1.5, -1.5, 0.25, -1.5, -1.5, -0.25, 1.5, -1.5, -0.25, -1.5, -1.5, 0.25, -1.5, -1.5, 0.25, 1.5, 1.5, 0.25, 1.5, -1.5, 0.25, -1.5, 1.5, 0.25, 1.5, -1.5, 0.25, -1.5, -1.5, 0.25, -1.5, 1.5, -0.25, 1.5, -1.5, -0.25, 1.5, 1.5, -0.25, -1.5, -1.5, -0.25, 1.5, 1.5, -0.25, -1.5, 1.5, -0.25, -1.5, -1.5, 0.25, 1.5, 1.5, -0.25, 1.5, 1.5, 0.25, 1.5, -1.5, -0.25, 1.5, 1.5, -0.25, 1.5, -1.5, 0.25, 1.5, -1.5, -0.25, -1.5, 1.5, 0.25, -1.5, 1.5, -0.25, -1.5, -1.5, 0.25, -1.5, 1.5, 0.25, -1.5, -1.5, -0.25, -1.5, -1.5)

[node name="Root" type="Node3D"]

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
Expand All @@ -177,6 +222,7 @@ environment = SubResource("Environment_gdnyc")
camera_attributes = SubResource("CameraAttributesPhysical_v0408")

[node name="SteamAudioConfig" type="SteamAudioConfig" parent="."]
scene_type = 0

[node name="Ground" type="MeshInstance3D" parent="."]
transform = Transform3D(200, 0, 0, 0, 200, 0, 0, 0, 200, 0, 0, 0)
Expand Down Expand Up @@ -231,6 +277,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -6)
[node name="Pluck Randomizer" type="SteamAudioPlayer" parent="Wooden House with RandomStream" node_paths=PackedStringArray("anim")]
min_attenuation_distance = 5.0
reflection = true
process_mode = 4
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
stream = SubResource("AudioStreamRandomizer_w72gs")
volume_db = 20.0
Expand Down Expand Up @@ -344,6 +391,7 @@ material = ExtResource("6_ph4pe")
distance_attenuation = true
min_attenuation_distance = 5.0
reflection = true
process_mode = 4
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0.0999999)
stream = ExtResource("3_0iivb")
attenuation_model = 3
Expand All @@ -368,6 +416,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 0, 11)

[node name="SteamAudioPlayer3" type="SteamAudioPlayer" parent="Collider Test"]
min_attenuation_distance = 5.0
process_mode = 4
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1, 1)
stream = ExtResource("3_0iivb")
volume_db = 20.0
Expand Down Expand Up @@ -455,3 +504,21 @@ text = "[WASD] Move
[2] Move door"
fit_content = true
scroll_active = false

[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 2, 0)
mesh = SubResource("BoxMesh_vkxem")

[node name="AnimationPlayer" type="AnimationPlayer" parent="MeshInstance3D"]
libraries = {
"": SubResource("AnimationLibrary_a3b03")
}
autoplay = "new_animation"

[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"]

[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_eiu6u")

[node name="SteamAudioGeometry" type="SteamAudioDynamicGeometry" parent="MeshInstance3D/StaticBody3D/CollisionShape3D"]
material = ExtResource("10_hrk2r")
2 changes: 1 addition & 1 deletion project/scenes/wooden_house.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=15 format=3 uid="uid://6sgtpvtg5aic"]

[ext_resource type="SteamAudioMaterial" uid="uid://oyakg0idhulv" path="res://addons/steamaudio/materials/wood_material.tres" id="2_lm25q"]
[ext_resource type="SteamAudioMaterial" uid="uid://oyakg0idhulv" path="res://addons/godot-steam-audio/materials/wood_material.tres" id="2_lm25q"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xa5je"]
albedo_color = Color(0.203922, 0.0901961, 0, 1)
Expand Down
Loading

0 comments on commit ac5acc0

Please sign in to comment.