This commit is contained in:
2025-05-09 23:06:36 +02:00
parent f3d332f39c
commit dda8eac39a
135 changed files with 8297 additions and 186 deletions

View File

@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/.idea.3D-Character-Controller-Template.iml
/contentModel.xml
/modules.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -34,10 +34,10 @@ const GRAPH_MAX_FRAMETIME = 1.0 / GRAPH_MAX_FPS
## Debug menu display style.
enum Style {
HIDDEN, ## Debug menu is hidden.
VISIBLE_COMPACT, ## Debug menu is visible, with only the FPS, FPS cap (if any) and time taken to render the last frame.
VISIBLE_DETAILED, ## Debug menu is visible with full information, including graphs.
MAX, ## Represents the size of the Style enum.
HIDDEN, ## Debug menu is hidden.
VISIBLE_COMPACT, ## Debug menu is visible, with only the FPS, FPS cap (if any) and time taken to render the last frame.
VISIBLE_DETAILED, ## Debug menu is visible with full information, including graphs.
MAX, ## Represents the size of the Style enum.
}
## The style to use when drawing the debug menu.
@@ -70,7 +70,7 @@ var sum_func := func avg(accum: float, number: float) -> float: return accum + n
var frame_history_total: Array[float] = []
var frame_history_cpu: Array[float] = []
var frame_history_gpu: Array[float] = []
var fps_history: Array[float] = [] # Only used for graphs.
var fps_history: Array[float] = [] # Only used for graphs.
var frametime_avg := GRAPH_MIN_FRAMETIME
var frametime_cpu_avg := GRAPH_MAX_FRAMETIME
@@ -106,10 +106,10 @@ func _ready() -> void:
# (red = 10 FPS, yellow = 60 FPS, green = 110 FPS, cyan = 160 FPS).
# This makes the color gradient non-linear.
# Colors are taken from <https://tailwindcolor.com/>.
frame_time_gradient.set_color(0, Color8(239, 68, 68)) # red-500
frame_time_gradient.set_color(1, Color8(56, 189, 248)) # light-blue-400
frame_time_gradient.add_point(0.3333, Color8(250, 204, 21)) # yellow-400
frame_time_gradient.add_point(0.6667, Color8(128, 226, 95)) # 50-50 mix of lime-400 and green-400
frame_time_gradient.set_color(0, Color(239, 68, 68)) # red-500
frame_time_gradient.set_color(1, Color(56, 189, 248)) # light-blue-400
frame_time_gradient.add_point(0.3333, Color(250, 204, 21)) # yellow-400
frame_time_gradient.add_point(0.6667, Color(128, 226, 95)) # 50-50 mix of lime-400 and green-400
get_viewport().size_changed.connect(update_settings_label)
@@ -274,8 +274,8 @@ func update_information_label() -> void:
information.text = (
"%s, %d threads\n" % [OS.get_processor_name().replace("(R)", "").replace("(TM)", ""), OS.get_processor_count()]
+ "%s %s (%s %s), %s %s\n" % [OS.get_name(), "64-bit" if OS.has_feature("64") else "32-bit", release_string, "double" if OS.has_feature("double") else "single", graphics_api_string, RenderingServer.get_video_adapter_api_version()]
+ "%s, %s" % [adapter_string, driver_info_string]
+"%s %s (%s %s), %s %s\n" % [OS.get_name(), "64-bit" if OS.has_feature("64") else "32-bit", release_string, "double" if OS.has_feature("double") else "single", graphics_api_string, RenderingServer.get_video_adapter_api_version()]
+"%s, %s" % [adapter_string, driver_info_string]
)

View File

@@ -0,0 +1 @@
uid://uy4ruqo71tqe

View File

@@ -1,7 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://cggqb75a8w8r"]
[gd_scene load_steps=6 format=3 uid="uid://cggqb75a8w8r"]
[ext_resource type="Script" path="res://addons/debug_menu/debug_menu.gd" id="1_p440y"]
[sub_resource type="SystemFont" id="SystemFont_f56mb"]
font_names = PackedStringArray("Sans-Serif", "", "", "", "", "", "", "", "", "")
[sub_resource type="Theme" id="Theme_qdnc2"]
default_font = SubResource("SystemFont_f56mb")
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6qqxv"]
bg_color = Color(0, 0, 0, 0.498039)
expand_margin_left = 8.0
expand_margin_top = 8.0
expand_margin_right = 8.0
expand_margin_bottom = 8.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ki0n8"]
bg_color = Color(0, 0, 0, 0.25098)
@@ -9,20 +22,19 @@ bg_color = Color(0, 0, 0, 0.25098)
process_mode = 3
layer = 128
[node name="DebugMenu" type="Control" parent="." node_paths=PackedStringArray("fps", "frame_time", "frame_number", "frame_history_total_avg", "frame_history_total_min", "frame_history_total_max", "frame_history_total_last", "frame_history_cpu_avg", "frame_history_cpu_min", "frame_history_cpu_max", "frame_history_cpu_last", "frame_history_gpu_avg", "frame_history_gpu_min", "frame_history_gpu_max", "frame_history_gpu_last", "fps_graph", "total_graph", "cpu_graph", "gpu_graph", "information", "settings")]
[node name="DebugMenu" type="PanelContainer" parent="." node_paths=PackedStringArray("fps", "frame_time", "frame_number", "frame_history_total_avg", "frame_history_total_min", "frame_history_total_max", "frame_history_total_last", "frame_history_cpu_avg", "frame_history_cpu_min", "frame_history_cpu_max", "frame_history_cpu_last", "frame_history_gpu_avg", "frame_history_gpu_min", "frame_history_gpu_max", "frame_history_gpu_last", "fps_graph", "total_graph", "cpu_graph", "gpu_graph", "information", "settings")]
custom_minimum_size = Vector2(400, 400)
layout_mode = 3
anchors_preset = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
offset_left = -416.0
offset_top = 8.0
offset_right = -16.0
offset_bottom = 408.0
anchor_bottom = 1.0
offset_left = -277.0
grow_horizontal = 0
grow_vertical = 2
size_flags_horizontal = 8
size_flags_vertical = 4
mouse_filter = 2
theme = SubResource("Theme_qdnc2")
theme_override_styles/panel = SubResource("StyleBoxFlat_6qqxv")
script = ExtResource("1_p440y")
fps = NodePath("VBoxContainer/FPS")
frame_time = NodePath("VBoxContainer/FrameTime")
@@ -47,13 +59,7 @@ information = NodePath("VBoxContainer/Information")
settings = NodePath("VBoxContainer/Settings")
[node name="VBoxContainer" type="VBoxContainer" parent="DebugMenu"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -300.0
offset_bottom = 374.0
grow_horizontal = 0
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 0
@@ -61,8 +67,8 @@ theme_override_constants/separation = 0
modulate = Color(0, 1, 0, 1)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 5
theme_override_constants/line_spacing = 0
theme_override_constants/outline_size = 5
theme_override_font_sizes/font_size = 18
text = "60 FPS"
horizontal_alignment = 2

View File

@@ -0,0 +1 @@
uid://c15ljqrjuqgvh

View File

@@ -0,0 +1,9 @@
shader_type spatial;
render_mode unshaded;
uniform sampler2D depth_texture : source_color, hint_depth_texture, filter_nearest, repeat_disable;
void fragment() {
float depth = texture(depth_texture, SCREEN_UV).x;
ALBEDO = vec3(depth);
}

View File

@@ -0,0 +1 @@
uid://0dexnhbddxfl

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 SpockBauru
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,79 @@
# LightmapProbeGrid
Create a grid of Lightmap Probes and cut unwanted ones!
LightmapProbeGrid is an extension for [Godot Engine](https://godotengine.org/) that helps on the demanding task of placing Lightmap Probes where LightmapGI fails to do it.
**Disclaimer:** If you are getting the error `scene/3d/lightmap_gi.cpp:529 - Inconsistency found in triangulation...` is because [Godot Issue 82642](https://github.com/godotengine/godot/issues/82642). If you have the knowledge, would you kindly contrubute to fix the issue please? \o/
### Video Tutorial
https://www.youtube.com/watch?v=HzZSQ0BPpuk
# Index
* [What's new](#whats-new)
* [How to install](#how-to-install)
* [Making a grid of Light Probes](#making-a-grid-of-light-probes)
* [Cut Obstructed Probes](#cut-obstructed-probes)
* [Cut probes inside objects](#cut-probes-inside-objects)
* [Cut probes far from objects](#cut-probes-far-from-objects)
* [Limitations](#limitations)
* [Compatibility](#compatibility)
* [Ending notes](#ending-notes)
* [Changelog](#changelog)
# What's New
Thanks to [dwarfses](https://twitter.com/dwarfses/status/1731691097263362513), LightmapProbeGrid v2.0 now uses GPU raycast instead of the regular Physics raycast. It may be slower but means that colliders are not needed anymore! If the camera can see, it should work!
NOTE: The Cull Mask from v1.0 is not compatible with v2.0.
# How to install
1) Download the file `LightmapProbeGrid_v2.0.zip` from the [Download Page](https://github.com/SpockBauru/LightmapProbeGrid/releases)
2) Extract the `addons` folder on the root of your project (`res://`). Other files/folders are optional.
3) Go to Godot's "Project" menu -> "Project Settings" -> "Plugins" tab -> enable "LightmapProbeGrid".
4) Restart Godot.
You can also open the `DemoScene` to see how it works.
# Making a grid of Light Probes
- Place the LightmapProbeGrid Node in the scene. It's located at "Add Node" -> Node3D -> LightmapProbeGrid.
- Use the handles (red dots) to resize the grid.
- In the LightmapProbeGrid Inspector you can set the number of Light Probes on each axis with the minimum of 2. Press "Generate Probes" to apply the settings and place your grid of Light Probes in the Scene.
Now you can cut unwanted probes with the methods bellow.
## Cut Obstructed Probes
This method is designed to cut probes that are placed beyond visual limits such as the ground or the walls of a cave.
On LightmapProbeGrid Inscpector click on "Cut Obstructed Probes". It will test each Light Probe from the center of the grid to the probe and see if the line intercepts an object. The probe will be cut if there's something blocking the line.
## Cut probes inside objects
This method is designed to delete probes that are inside objects. It will test all 6 axis of each Light Probe: Up, Down, Left, Right, Forward and Backward by the distance indicated in `Max Object Size`.
If at least 4 of these lines hit something the probe will be cut. It considers only 4 hits to cut probes on long objects like pillars and trees.
## Cut probes far from objects
This method is designed to delete probes that are far away from any object. Normally these probes don't contain any relevant light information but use with care in places that have a high usage of spotlights.
When you click the button the area around the Light Probe is tested on various directions by the distance indicated in `Max Distance`. The probe will be cut if none of the rays intercept an object.
## Using masks
You can select which 3D render layers LightmapProbeGrid will interact on the section Visual Cull Mask. Only selected layers will be used on detection for the Cut methods above.
Use masks to filter out objects to not interact with the rays, like characters or moving objects.
# Limitations
LightmapProbeGrid is not designed to work with a huge number of Light Probes at once covering a vast area. It is designed to be placed multiple times in a scene with relatively small grids (less than 1,000 probes).
# Compatibility
LightmapProbeGrid is compatible with Godot 4.2 and there are plans to continue supporting onward.
# Ending notes
This tool was entirely made on my free time. If you want to support me, please make an awesome asset and publish for free to the community!
# Changelog
v2.0:
- Major changes: now uses GPU Raycast instead of Physics raycast
- This means that colliders are not needed anymore!
- The Cull Mask from v1.0 is not compatible with v2.0
v1.0:
- First release.

View File

@@ -0,0 +1,89 @@
@tool
extends Node
@export var probes_x: SpinBox
@export var probes_y: SpinBox
@export var probes_z: SpinBox
@export var planned_probes: RichTextLabel
@export var generate_button: Button
@export var far_distance: SpinBox
@export var object_size: SpinBox
var root_node: Node
var probe_grid: LightmapProbeGrid
func _ready() -> void:
root_node = EditorInterface.get_edited_scene_root()
if EditorInterface.get_selection().get_selected_nodes().size() == 1:
probe_grid = EditorInterface.get_selection().get_selected_nodes()[0] as LightmapProbeGrid
else:
return
# connecting signals
if not probe_grid.probes_changed.is_connected(_get_probes):
probe_grid.probes_changed.connect(_get_probes)
if not probe_grid.probes_changed.is_connected(planned_probes_text):
probe_grid.probes_changed.connect(planned_probes_text)
# initializing values
far_distance.value = probe_grid.far_distance
object_size.value = probe_grid.object_size
_get_probes()
planned_probes_text()
planned_probes.tooltip_text = "Maximum is %s" % probe_grid.max_probes
func planned_probes_text() -> void:
var total: int = probe_grid.planned_probes
var current: int = probe_grid.current_probes
var max_probes: int = probe_grid.max_probes
if total <= max_probes:
planned_probes.text = "Probes Planned/Current: " + str(total) + " / " + str(current)
generate_button.disabled = false
else:
planned_probes.text = "[color=red]Planned Probes: %s [/color] \
\nWarning: Max number of probes is %s" % [total, max_probes]
generate_button.disabled = true
func _set_probes_number(_value: float) -> void:
var number_of_probes: Vector3i = Vector3i.ONE
number_of_probes.x = int(probes_x.value)
number_of_probes.y = int(probes_y.value)
number_of_probes.z = int(probes_z.value)
probe_grid.probes_number = number_of_probes
func _on_generate_probes_pressed() -> void:
probe_grid.generate_probes()
func _get_probes() -> void:
var number: Vector3i = probe_grid.probes_number
probes_x.value = number.x
probes_y.value = number.y
probes_z.value = number.z
func _on_cut_by_mask_pressed() -> void:
probe_grid.cut_obstructed()
func _cut_far_probes():
probe_grid.cut_far()
func _set_far_distance(value):
probe_grid.far_distance = value
func _cut_inside():
probe_grid.cut_inside()
func _set_object_size(value):
probe_grid.object_size = value

View File

@@ -0,0 +1 @@
uid://l34dvbnsrsna

View File

@@ -0,0 +1,198 @@
[gd_scene load_steps=3 format=3 uid="uid://xp1820rv0uy"]
[ext_resource type="Script" path="res://addons/lightmap_probe_grid/UI.gd" id="1_4a60v"]
[ext_resource type="StyleBox" uid="uid://4nfudftbnexo" path="res://addons/lightmap_probe_grid/style_box_flat.tres" id="2_rdj4j"]
[node name="RootContainer" type="VBoxContainer" node_paths=PackedStringArray("probes_x", "probes_y", "probes_z", "planned_probes", "generate_button", "far_distance", "object_size")]
offset_right = 257.0
offset_bottom = 346.0
script = ExtResource("1_4a60v")
probes_x = NodePath("ProbesContainer/ProbesX")
probes_y = NodePath("ProbesContainer/ProbesY")
probes_z = NodePath("ProbesContainer/ProbesZ")
planned_probes = NodePath("PlannedLabel")
generate_button = NodePath("GenerateProbes")
far_distance = NodePath("CutFarProbesContainer/Distance")
object_size = NodePath("CutInsideContainer/Size")
[node name="ProbesLabel" type="Label" parent="."]
clip_contents = true
layout_mode = 2
tooltip_text = "Number of probes on each axis"
mouse_filter = 0
text = "Number of Probes"
vertical_alignment = 1
[node name="ProbesContainer" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="ProbesX" type="SpinBox" parent="ProbesContainer"]
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "Minimum is 2"
min_value = 2.0
max_value = 250.0
value = 2.0
alignment = 2
prefix = "x:"
select_all_on_focus = true
[node name="ProbesY" type="SpinBox" parent="ProbesContainer"]
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "Minimum is 2"
min_value = 2.0
max_value = 250.0
value = 2.0
alignment = 2
prefix = "y:"
select_all_on_focus = true
[node name="ProbesZ" type="SpinBox" parent="ProbesContainer"]
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "Minimum is 2"
min_value = 2.0
max_value = 250.0
value = 2.0
alignment = 2
prefix = "z:"
select_all_on_focus = true
[node name="PlannedLabel" type="RichTextLabel" parent="."]
layout_mode = 2
tooltip_text = "Maximum is xxxx"
bbcode_enabled = true
text = "Planned Probes: xxxx"
fit_content = true
[node name="GenerateProbes" type="Button" parent="."]
layout_mode = 2
theme_override_styles/normal = ExtResource("2_rdj4j")
text = "Generate Probes"
[node name="HSeparator" type="HSeparator" parent="."]
layout_mode = 2
[node name="ObscuredLabel" type="Label" parent="."]
layout_mode = 2
tooltip_text = "Test from center to each probe,
and cut the probe if the path is obstructed by an object.
Use Collision Mask to filter objects."
mouse_filter = 0
text = "Probes obscured from center"
vertical_alignment = 1
[node name="Cut by Mask" type="Button" parent="."]
layout_mode = 2
tooltip_text = "Test from center to each probe,
and cut the probe if the path is obstructed by an object.
Use Collision Mask to filter objects."
theme_override_styles/normal = ExtResource("2_rdj4j")
text = "Cut Obstructed Probes"
[node name="HSeparator2" type="HSeparator" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="."]
layout_mode = 2
tooltip_text = "For each probe, test if there is any object within an Max distance.
If there isn't any object the probe is cut.
Use Collision Mask to filter objects."
mouse_filter = 0
text = "Probes far from any object"
[node name="CutFarProbesContainer" type="HBoxContainer" parent="."]
layout_mode = 2
alignment = 1
[node name="DistanceLabel" type="Label" parent="CutFarProbesContainer"]
custom_minimum_size = Vector2(67, 0)
layout_mode = 2
tooltip_text = "The distance from the probe that objects will be detected"
mouse_filter = 0
text = "Max distance"
[node name="Distance" type="SpinBox" parent="CutFarProbesContainer"]
layout_mode = 2
tooltip_text = "The distance from the probe that objects will be detected"
step = 0.0
value = 1.0
allow_greater = true
suffix = "m"
custom_arrow_step = 1.0
select_all_on_focus = true
[node name="CutFarProbes" type="Button" parent="."]
custom_minimum_size = Vector2(148, 0)
layout_mode = 2
tooltip_text = "For each probe, test if there is any object within an Max distance.
If there isn't any object the probe is cut.
Use Collision Mask to filter objects."
theme_override_styles/normal = ExtResource("2_rdj4j")
text = "Cut Far Probes"
[node name="HSeparator3" type="HSeparator" parent="."]
layout_mode = 2
[node name="Label2" type="Label" parent="."]
layout_mode = 2
tooltip_text = "For each probe, test if the same object is intercepted by the yellow lines.
If the same object is detected 4 times or more,
the probe is considered to be inside and will be cut.
Only 4 lines are tested instead of 6 because is common for
objects to not have 2 faces, like pillars.
Use Collision Mask to filter objects."
mouse_filter = 0
text = "Probes inside objects"
[node name="CutInsideContainer" type="HBoxContainer" parent="."]
layout_mode = 2
alignment = 1
[node name="SizeLabel" type="Label" parent="CutInsideContainer"]
layout_mode = 2
tooltip_text = "Distance tested from the probes (size of yellow lines)"
mouse_filter = 0
text = "Max object size"
[node name="Size" type="SpinBox" parent="CutInsideContainer"]
layout_mode = 2
tooltip_text = "Distance tested from the probes (size of yellow lines)"
step = 0.0
value = 1.0
allow_greater = true
suffix = "m"
custom_arrow_step = 1.0
[node name="CutInsideObjects" type="Button" parent="."]
custom_minimum_size = Vector2(148, 0)
layout_mode = 2
tooltip_text = "For each probe, test if the same object is intercepted by the yellow lines.
If the same object is detected 4 times or more,
the probe is considered to be inside and will be cut.
Only 4 lines are tested instead of 6 because is common for
objects to not have 2 faces, like pillars.
Use Collision Mask to filter objects."
theme_override_styles/normal = ExtResource("2_rdj4j")
text = "Cut Inside Objects"
[connection signal="value_changed" from="ProbesContainer/ProbesX" to="." method="_set_probes_number"]
[connection signal="value_changed" from="ProbesContainer/ProbesY" to="." method="_set_probes_number"]
[connection signal="value_changed" from="ProbesContainer/ProbesZ" to="." method="_set_probes_number"]
[connection signal="pressed" from="GenerateProbes" to="." method="_on_generate_probes_pressed"]
[connection signal="pressed" from="Cut by Mask" to="." method="_on_cut_by_mask_pressed"]
[connection signal="value_changed" from="CutFarProbesContainer/Distance" to="." method="_set_far_distance"]
[connection signal="pressed" from="CutFarProbes" to="." method="_cut_far_probes"]
[connection signal="value_changed" from="CutInsideContainer/Size" to="." method="_set_object_size"]
[connection signal="pressed" from="CutInsideObjects" to="." method="_cut_inside"]

View File

@@ -0,0 +1,16 @@
extends EditorInspectorPlugin
var ui_control: PackedScene = preload("controls_scene.tscn")
var ui: Control = null
func _can_handle(object: Object) -> bool:
if object is LightmapProbeGrid:
return true
else:
return false
func _parse_category(_object: Object, category: String) -> void:
if category.begins_with("lightmap_probe_grid"):
if ui == null:
ui = ui_control.instantiate()
add_property_editor("LighmapProbeGrid", ui)

View File

@@ -0,0 +1 @@
uid://cyh1thwnyn2ra

View File

@@ -0,0 +1,159 @@
# my_custom_gizmo_plugin.gd
extends EditorNode3DGizmoPlugin
const handles_axis: PackedVector3Array = [
Vector3(1, 0, 0),
Vector3(0, 1, 0),
Vector3(0, 0, 1),
Vector3(-1, 0, 0),
Vector3(0, -1, 0),
Vector3(0, 0, -1)
]
const box_lines: PackedVector3Array = [
# plane -x
Vector3(-1, -1, -1), Vector3(-1, -1, 1),
Vector3(-1, -1, 1), Vector3(-1, 1, 1),
Vector3(-1, 1, 1), Vector3(-1, 1, -1),
Vector3(-1, 1, -1), Vector3(-1, -1, -1),
# plane +x
Vector3(1, -1, -1), Vector3(1, -1, 1),
Vector3(1, -1, 1), Vector3(1, 1, 1),
Vector3(1, 1, 1), Vector3(1, 1, -1),
Vector3(1, 1, -1), Vector3(1, -1, -1),
# connecting plane x with -x
Vector3(1, -1, -1), Vector3(-1, -1, -1),
Vector3(1, -1, 1), Vector3(-1, -1, 1),
Vector3(1, 1, -1), Vector3(-1, 1, -1),
Vector3(1, 1, 1), Vector3(-1, 1, 1),
]
var icon: Texture2D = preload("lightmap_probe_grid_icon.svg")
var timer: Timer = Timer.new()
var is_awayting: bool = false
func _get_gizmo_name() -> String:
return "LightmapProbeGrid"
func _init() -> void:
create_material("main_material", Color(0,0,0))
create_material("tool_material", Color(1, 0.9, 0))
create_handle_material("handles_material")
create_icon_material("icon_material", icon)
func _has_gizmo(node: Node3D) -> bool:
if node is LightmapProbeGrid:
if not node.size_changed.is_connected(node.update_gizmos):
node.size_changed.connect(node.update_gizmos)
if not node.probes_changed.is_connected(node.update_gizmos):
node.probes_changed.connect(node.update_gizmos)
return true
else:
return false
func _redraw(gizmo: EditorNode3DGizmo) -> void:
gizmo.clear()
var box: LightmapProbeGrid = gizmo.get_node_3d() as LightmapProbeGrid
var size: Vector3 = box.size
var icon_gizmo: Material = get_material("icon_material")
gizmo.add_unscaled_billboard(icon_gizmo, 0.05)
# Setting box lines
var lines: PackedVector3Array = []
for pos: Vector3 in box_lines:
var scaled: Vector3 = 0.5 * pos * size
lines.append(scaled)
gizmo.add_lines(lines, get_material("main_material", gizmo))
# Setting handles
var handles: PackedVector3Array = []
for pos: Vector3 in handles_axis:
var scaled: Vector3 = 0.5 * pos * size
handles.append(scaled)
gizmo.add_handles(handles, get_material("handles_material", gizmo), [])
# Setting extra tool lines from main script
var tool_lines: PackedVector3Array = box.gizmo_lines
if not tool_lines.is_empty():
gizmo.add_lines(tool_lines, get_material("tool_material", gizmo))
clear_tool_await(box)
# Wait 3 seconds before clear the main script gizmos. If called twice the timer is reset
func clear_tool_await(box: LightmapProbeGrid):
if timer == null:
timer = Timer.new()
# Add timer to the scene
if timer.get_parent() == null:
var root_node = EditorInterface.get_edited_scene_root()
root_node.add_child(timer)
timer.name = "lightmap_probe_grid_timer"
timer.wait_time = 3.0
timer.start()
if is_awayting:
return
is_awayting = true
await timer.timeout
is_awayting = false
timer.stop
box.gizmo_lines.clear()
box.update_gizmos()
# Based on github.com/godotengine/godot/blob/master/editor/plugins/gizmos/gizmo_3d_helper.cpp
# please, make it available to GDScript plugin developers...
func _set_handle(gizmo: EditorNode3DGizmo, index: int, _sec: bool, camera: Camera3D, point: Vector2) -> void:
var box: LightmapProbeGrid = gizmo.get_node_3d() as LightmapProbeGrid
var axis: Vector3 = handles_axis[index]
var axis_index: int = axis.abs().max_axis_index()
var inverse: Transform3D = box.global_transform.affine_inverse()
var ray_from: Vector3 = camera.project_ray_origin(point)
var ray_to: Vector3 = camera.project_ray_normal(point)
var camera_position: Vector3 = inverse * ray_from
var camera_to_mouse: Vector3 = inverse * (ray_from + ray_to * 5000)
var segment1: Vector3 = axis * 5000
var segment2: Vector3 = axis * -5000
var intersection: PackedVector3Array = Geometry3D.get_closest_points_between_segments(segment2,
segment1, camera_position, camera_to_mouse)
# Distance between the center and the handle (without scale)
var distance: float = intersection[0][axis_index]
# multiply axis signal to cancel distance signal
distance *= axis[axis_index]
var old_distance: float = 0.5 * box.size[axis_index]
# Defining new size and positions
var new_size: float = distance + old_distance
# Translate halfway through the size difference
var translate: Vector3 = 0.5 * (distance - old_distance) * axis
# Updating size and position
box.size[axis_index] = new_size
box.translate(translate)
# Update Gizmo
box.update_gizmos()
func _get_handle_name(_gizmo: EditorNode3DGizmo, _handle_id: int, _sec: bool) -> String:
return "Probe Grid Size"
func _get_handle_value(gizmo: EditorNode3DGizmo, _id: int, _sec: bool) -> Vector3:
var box: LightmapProbeGrid = gizmo.get_node_3d() as LightmapProbeGrid
return box.size

View File

@@ -0,0 +1 @@
uid://cww446exifamp

View File

@@ -0,0 +1,453 @@
@tool
extends Node3D
class_name LightmapProbeGrid
signal size_changed
signal probes_changed
const max_probes: int = 1000
## Only selected layers will be seen by LightmapProbeGrid. Works like Camera3D Cull Mask.[br][br]
## NOTE: NOT compatible with LightmapProbeGrid v1.0
@export_flags_3d_render var visual_cull_mask: int = 1048575
@export var size: Vector3 = Vector3.ONE:
set(value):
# size cannot be zero or negative
size = value.clamp(Vector3(1E-6, 1E-6, 1E-6), Vector3.INF)
size_changed.emit()
get:
return size
@onready var depth_shader: Shader = preload("Depth.gdshader")
var probes_number: Vector3i = Vector3i(2, 2, 2):
set(value):
probes_number = value
set_probes_number()
get:
return probes_number
var planned_probes: int = 8
var current_probes: int = 8
var old_size: Vector3 = Vector3.ONE
var old_scale: Vector3 = Vector3.ONE
var warned: bool = false
var far_distance: float = 1
var object_size: float = 1
var gizmo_lines: PackedVector3Array = []
func _get_property_list() -> Array[Dictionary]:
var properties: Array[Dictionary] = []
properties.append({
"name": "probes_number",
"type": TYPE_VECTOR3I,
"usage": PROPERTY_USAGE_STORAGE
})
properties.append({
"name": "far_distance",
"type": TYPE_FLOAT,
"usage": PROPERTY_USAGE_STORAGE
})
properties.append({
"name": "object_size",
"type": TYPE_FLOAT,
"usage": PROPERTY_USAGE_STORAGE
})
return properties
func _enter_tree() -> void:
if get_child_count() < 1:
generate_probes()
func _ready() -> void:
size_changed.connect(scale_probes)
set_notify_local_transform(true)
old_size = size
old_scale = scale
current_probes = get_child_count()
# Keep local scale fixed. Reflect in "size" if the user try to scale
func _notification(what: int) -> void:
if (what == NOTIFICATION_LOCAL_TRANSFORM_CHANGED) and not scale.is_equal_approx(Vector3.ONE):
if not warned:
printerr("LightmapProbeGrid: Resetting Scale, please use the handles (red dots) or ",
"the property \"Size\" in LightmapProbeGridsection")
warned = true
if(scale.x <= 0):
scale = Vector3.ONE
return
# TODO take a look on this workaround
var scale_diff: Vector3 = abs(scale - Vector3.ONE)
var size_sign: Vector3 = sign(scale - old_scale)
size += size_sign * scale_diff / 10.0
old_scale = scale
scale = Vector3.ONE
func _get_configuration_warnings() -> PackedStringArray:
var warnings: PackedStringArray = []
if planned_probes > max_probes:
var text: String = "LightmapProbeGrid: The maximum number of Probes must be " + \
str(max_probes) + ". Please consider add more instances of LightmapProbeGrid"
warnings.append(text)
printerr(text)
# Returning an empty array means "no warning".
return warnings
func set_probes_number() -> void:
planned_probes = probes_number.x * probes_number.y * probes_number.z
update_configuration_warnings()
probes_changed.emit()
func scale_probes() -> void:
var new_size: Vector3 = size / old_size
# Scaling all probes
for probe: Node3D in get_children():
probe.position *= new_size
old_size = size
func generate_probes() -> void:
# check number of probes
if planned_probes > max_probes:
return
# Clear all previews probes
for i: int in get_child_count():
get_child(i).queue_free()
# Wait for the last one to be cleaned
if i == get_child_count() -1:
await get_child(i).tree_exited
# Defining probe arrays
var probes_positions: Array[Vector3] = []
var probes_names: Array[String] = []
var probes_x: float = probes_number.x
var probes_y: float = probes_number.y
var probes_z: float = probes_number.z
# Distance between probes
var step_x: float = size.x / (probes_x - 1)
var step_y: float = size.y / (probes_y - 1)
var step_z: float = size.z / (probes_z - 1)
# Starting relative positions
var start_position: Vector3 = Vector3.ONE * size / 2.0
var current_position: Vector3 = Vector3.ZERO
# Defining Probes relative positions and names
for x: float in probes_x:
for y: float in probes_y:
for z: float in probes_z:
current_position.x = start_position.x - step_x * x
current_position.y = start_position.y - step_y * y
current_position.z = start_position.z - step_z * z
probes_positions.append(current_position)
probes_names.append("LightmapProbe %.f, %.f, %.f" % [x, y, z])
# Generating probes
var root_node: Node = get_tree().edited_scene_root
for i: int in range(probes_positions.size()):
var probe: LightmapProbe = LightmapProbe.new()
probe.position = probes_positions[i]
probe.name = probes_names[i]
add_child(probe)
probe.set_owner(root_node)
current_probes = probes_number.x * probes_number.y * probes_number.z
set_probes_number()
# Workaround to raycast without colliders. Consists in a camera with a filter in front that shows
# the depth texture. The camera.far is the "ray" lenght and camera rotation is the "ray" orientation
# https://docs.godotengine.org/en/stable/tutorials/shaders/advanced_postprocessing.html#depth-texture
func add_GPU_raycaster(probe: Node3D) -> void:
var root_node: Node = get_tree().edited_scene_root
# SubViewport that will host the camera
var sub_viewport: SubViewport = SubViewport.new()
sub_viewport.name = "GPUraycast"
sub_viewport.size = Vector2(2, 2)
sub_viewport.render_target_update_mode = SubViewport.UPDATE_DISABLED
sub_viewport.render_target_clear_mode = SubViewport.CLEAR_MODE_NEVER
sub_viewport.handle_input_locally = false
sub_viewport.debug_draw = Viewport.DEBUG_DRAW_UNSHADED
sub_viewport.positional_shadow_atlas_size = 0
sub_viewport.positional_shadow_atlas_quad_0 = Viewport.SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED
sub_viewport.positional_shadow_atlas_quad_1 = Viewport.SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED
sub_viewport.positional_shadow_atlas_quad_2 = Viewport.SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED
sub_viewport.positional_shadow_atlas_quad_3 = Viewport.SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED
probe.add_child(sub_viewport)
sub_viewport.set_owner(root_node)
# Camera for the viewport
var camera_3d: Camera3D = Camera3D.new()
camera_3d.projection = Camera3D.PROJECTION_ORTHOGONAL
camera_3d.size = 0.001
camera_3d.near = 0.001
camera_3d.far = 1.0
sub_viewport.add_child(camera_3d)
camera_3d.set_owner(root_node)
camera_3d.position = probe.global_position
camera_3d.rotation = Vector3.ZERO
camera_3d.cull_mask = visual_cull_mask
# Depth filter: A quad with a material that shows the Depth texture. This goes in front of the
# camera
var depth_material: ShaderMaterial = ShaderMaterial.new()
depth_material.shader = depth_shader
var depth_filter: MeshInstance3D = MeshInstance3D.new()
var depth_mesh: QuadMesh = QuadMesh.new()
depth_filter.mesh = depth_mesh
depth_mesh.material = depth_material
depth_mesh.size = Vector2.ONE * 0.001
camera_3d.add_child(depth_filter)
depth_filter.set_owner(root_node)
depth_filter.position = Vector3(0, 0, -0.002)
depth_filter.rotation = Vector3.ZERO
func generate_probes_raycasters(distance: float) -> void:
for probe in get_children():
add_GPU_raycaster(probe)
func remove_probes_raycasters() -> void:
for probe in get_children():
for child in probe.get_children():
child.queue_free();
# The function look_at not always work. Exceptions are handled here
func rotate_camera(camera: Camera3D, to: Vector3) -> void:
var from: Vector3 = camera.position
# look_at don't work if the node and target have the same position. You cannot look at yourself
if from == to:
return
# look_at don't work if the direction and rotation axix have same orientation. In this case,
# change the rotation axis
var direction: Vector3 = abs(to - from)
var mag = (direction.normalized() - Vector3.UP).length()
if mag > 0.001:
camera.look_at(to)
else:
camera.look_at(to, Vector3.RIGHT)
# Shoot rays from the center to all the probes. If any object is detected so the probe is
# obstructed and will be cut
func cut_obstructed() -> void:
await generate_probes_raycasters(far_distance)
var probes_array: Array[LightmapProbe] = []
var camera_array: Array[Camera3D] = []
var subViewport_array: Array[SubViewport] = []
var results_array: Array[float] = []
# Populating arrays
for probe: LightmapProbe in get_children():
probes_array.append(probe)
gizmo_lines.append_array([Vector3.ZERO, probe.position])
var sub_viewport: SubViewport = probe.get_child(0)
subViewport_array.append(sub_viewport)
var camera: Camera3D = sub_viewport.get_child(0)
camera_array.append(camera)
# Rotating cameras and updating sub_viewports
for i in range(camera_array.size()):
var camera: Camera3D = camera_array[i]
var probe_pos: Vector3 = probes_array[i].global_position
var sub_viewport: SubViewport = subViewport_array[i]
camera.position = position
# The lenght of the "Ray"
camera.far = (probe_pos - position).length()
# The direction of the "Ray"
rotate_camera(camera, probe_pos)
sub_viewport.render_target_update_mode = SubViewport.UPDATE_ONCE
# Getting the values
await RenderingServer.frame_post_draw
for i in range(subViewport_array.size()):
var sub_viewport = subViewport_array[i]
var texture: Image = sub_viewport.get_texture().get_image()
var color: Color = texture.get_pixel(0,0)
var colorValue: float = color.r
var result: float = colorValue
results_array.append(result)
# Cutting probes
for i in range(subViewport_array.size()):
var result: float = results_array[i]
if result < 1.0:
var probe = probes_array[i]
probe.queue_free()
current_probes -= 1
set_probes_number()
remove_probes_raycasters()
# Detect if the probe is far from any object. It will shoot rays on all 6 axis and 8 quadrants.
# If there aren't any objects the probe will be cut
func cut_far() -> void:
await generate_probes_raycasters(far_distance)
# 6 axis and 8 quadrants
var directions: Array[Vector3] = [
# 6 Axis
Vector3(0, 0, 1), Vector3(0, 1, 0), Vector3(1, 0, 0),
Vector3(0, 0, -1), Vector3(0, -1, 0), Vector3(-1, 0, 0),
# 8 Quadrants
Vector3(1, 1, 1).normalized(), Vector3(1, 1, -1).normalized(),
Vector3(1, -1, 1).normalized(), Vector3(1, -1, -1).normalized(),
Vector3(-1, 1, 1).normalized(), Vector3(-1, 1, -1).normalized(),
Vector3(-1, -1, 1).normalized(), Vector3(-1, -1, -1).normalized()
]
var probes_array: Array[LightmapProbe] = []
var camera_array: Array[Camera3D] = []
var subViewport_array: Array[SubViewport] = []
var collisions_number: Array[int] = []
# Populating arrays
for probe: LightmapProbe in get_children():
probes_array.append(probe)
var sub_viewport: SubViewport = probe.get_child(0)
subViewport_array.append(sub_viewport)
var camera: Camera3D = sub_viewport.get_child(0)
camera_array.append(camera)
collisions_number.resize(camera_array.size())
collisions_number.fill(0)
# Getting data for all cameras on each direction
for dir in directions:
# Rotating all cameras to the same direction, and updating viewport
for i in camera_array.size():
var probe: LightmapProbe = probes_array[i]
var sub_viewport: SubViewport = subViewport_array[i]
var camera: Camera3D = camera_array[i]
camera.position = probe.global_position
# The lenght of the "Ray"
camera.far = far_distance
# The direction of the "Ray"
rotate_camera(camera, probe.global_position + dir)
sub_viewport.render_target_update_mode = SubViewport.UPDATE_ONCE
gizmo_lines.append_array([probe.position, probe.position + dir * far_distance])
# Getting all values for the current direction
await RenderingServer.frame_post_draw
for i in range(subViewport_array.size()):
var sub_viewport = subViewport_array[i]
var texture: Image = sub_viewport.get_texture().get_image()
var color: Color = texture.get_pixel(0,0)
var colorValue: float = color.r
var result: float = colorValue
if result < 1.0:
collisions_number[i] += 1
# Cut probes if there are no collisions
for i in probes_array.size():
if collisions_number[i] < 1:
var probe = probes_array[i]
probe.queue_free()
current_probes -= 1
set_probes_number()
remove_probes_raycasters()
# Detect if probe is inside an object. It will shoot rays from all 6 axis to the probe. If at least
# 4 are obstructed, the probe will be cut
func cut_inside() -> void:
await generate_probes_raycasters(far_distance)
# 6 Axis
var axis: Array[Vector3] = [
Vector3(0, 0, 1), Vector3(0, 1, 0), Vector3(1, 0, 0),
Vector3(0, 0, -1), Vector3(0, -1, 0), Vector3(-1, 0, 0),
]
var probes_array: Array[LightmapProbe] = []
var camera_array: Array[Camera3D] = []
var subViewport_array: Array[SubViewport] = []
var collisions_number: Array[int] = []
# Populating arrays
for probe: LightmapProbe in get_children():
probes_array.append(probe)
var sub_viewport: SubViewport = probe.get_child(0)
subViewport_array.append(sub_viewport)
var camera: Camera3D = sub_viewport.get_child(0)
camera_array.append(camera)
collisions_number.resize(camera_array.size())
collisions_number.fill(0)
# Getting data for all cameras on each axis
for dir in axis:
# For each direction, position all cameras to look from outside
# to each probe in object_size distance
for i in camera_array.size():
var probe: LightmapProbe = probes_array[i]
var sub_viewport: SubViewport = subViewport_array[i]
var camera: Camera3D = camera_array[i]
camera.position = probe.global_position + dir * object_size
# The lenght of the "Ray"
camera.far = object_size
# The direction of the "Ray"
rotate_camera(camera, probe.global_position)
sub_viewport.render_target_update_mode = SubViewport.UPDATE_ONCE
gizmo_lines.append_array([probe.position, probe.position + dir * object_size])
# Getting all values for the current direction
await RenderingServer.frame_post_draw
for i in range(subViewport_array.size()):
var sub_viewport = subViewport_array[i]
var texture: Image = sub_viewport.get_texture().get_image()
var color: Color = texture.get_pixel(0,0)
var colorValue: float = color.r
var result: float = colorValue
if result < 1.0:
collisions_number[i] += 1
# Cut probes if there are more than 4 collisions
for i in probes_array.size():
if collisions_number[i] > 3:
var probe = probes_array[i]
probe.queue_free()
current_probes -= 1
set_probes_number()
remove_probes_raycasters()

View File

@@ -0,0 +1 @@
uid://dy5lhlfkbk5t6

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 16 16" width="16">
<path d="M7 10A1 1 0 0 0 13 10 1 1 0 0 0 7 10zM10 4A1 1 0 0 1 10 16 V14A1 1 0 0 0 10 6zM4 9h2v2H4z M5 6.6 6.4 5.2 7.8 6.6 6.4 8z M5 13.4 6.4 12 7.8 13.4 6.4 14.8z" fill="#fc7f7f"></path> <!-- Probe -->
<path d="M3.7 1 H12.3A2 2 0 1 1 12.3 3H3.7 A2 2 0 0 1 3 3.7 V12.3A2 2 0 1 1 1 12.3 V3.7A2 2 0 1 1 3.7 1z" fill="#fc7f7f"></path> <!-- Frame -->
</svg>

After

Width:  |  Height:  |  Size: 436 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dtmcycli3j3j1"
path="res://.godot/imported/lightmap_probe_grid_icon.svg-71f84c7339e4d62a065aeef79112e123.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/lightmap_probe_grid/lightmap_probe_grid_icon.svg"
dest_files=["res://.godot/imported/lightmap_probe_grid_icon.svg-71f84c7339e4d62a065aeef79112e123.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=0
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@@ -0,0 +1,7 @@
[plugin]
name="LightmapProbeGrid"
description="Create a grid of LightmapProbes, and cut unwanted ones!"
author="SpockBauru"
version="2.0"
script="plugin.gd"

View File

@@ -0,0 +1,25 @@
@tool
extends EditorPlugin
var custom_node: Script = preload("lightmap_probe_grid.gd")
var icon: Texture2D = preload("lightmap_probe_grid_icon.svg")
var inspector_script: Script = preload("editor_inspector_plugin.gd")
var inspector_plugin: EditorInspectorPlugin = inspector_script.new()
var gizmo_script: Script = preload("gizmo.gd")
var gizmo_plugin: EditorNode3DGizmoPlugin = gizmo_script.new()
func _get_plugin_name() -> String:
return "LightmapProbeGrid"
func _enter_tree() -> void:
add_custom_type("LightmapProbeGrid", "Node3D", custom_node, icon)
add_inspector_plugin(inspector_plugin)
add_node_3d_gizmo_plugin(gizmo_plugin)
func _exit_tree() -> void:
remove_custom_type("LightmapProbeGrid")
remove_inspector_plugin(inspector_plugin)
remove_node_3d_gizmo_plugin(gizmo_plugin)

View File

@@ -0,0 +1 @@
uid://df4lt60aa1ac8

View File

@@ -0,0 +1,13 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://4nfudftbnexo"]
[resource]
draw_center = false
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.5, 0.5, 0.5, 1)
corner_radius_top_left = 2
corner_radius_top_right = 2
corner_radius_bottom_right = 2
corner_radius_bottom_left = 2

27
default_bus_layout.tres Normal file
View File

@@ -0,0 +1,27 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://dykupbfl42kqe"]
[resource]
bus/1/name = &"Music"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/send = &"Master"
bus/2/name = &"Voice"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = 0.0
bus/2/send = &"Master"
bus/3/name = &"Effects"
bus/3/solo = false
bus/3/mute = false
bus/3/bypass_fx = false
bus/3/volume_db = 0.0
bus/3/send = &"Master"
bus/4/name = &"Environment"
bus/4/solo = false
bus/4/mute = false
bus/4/bypass_fx = false
bus/4/volume_db = 0.0
bus/4/send = &"Master"

View File

@@ -3,16 +3,21 @@
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
export_filter="exclude"
export_files=PackedStringArray("res://meshes/tailandia.glb")
include_filter=""
exclude_filter=""
export_path="C:/Users/Midnight/Desktop/export2/not_bar.exe"
export_path="C:/Users/Midnight/Desktop/export2/quacc.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.0.options]
@@ -20,14 +25,12 @@ custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/enable=true
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/timestamp_server_url="http://timestamp.digicert.com"
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
@@ -37,12 +40,14 @@ application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/company_name="MNXS"
application/product_name="Quacc"
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
application/export_d3d12=0
application/d3d12_agility_sdk_multiarch=true
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
@@ -60,43 +65,52 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
[preset.1]
name="Linux/X11"
platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="C:/Users/Midnight/Desktop/export2/not_bar.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.1.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
[preset.1]
name="Web"
platform="Web"
runnable=true
advanced_options=true
dedicated_server=false
custom_features=""
export_filter="scenes"
export_files=PackedStringArray("res://cloud_sky/clouds_material.tres", "res://meshes/characters/animations/idle.res", "res://cloud_sky/worlnoise.bmp", "res://cloud_sky/weather.bmp", "res://cloud_sky/transmittance_lut.tres", "res://cloud_sky/transmittance_lut.gd", "res://cloud_sky/transmittance-lut.glsl", "res://cloud_sky/sun.gd", "res://cloud_sky/sky_lut.tres", "res://cloud_sky/sky_lut.gd", "res://cloud_sky/sky-lut.glsl", "res://cloud_sky/perlworlnoise.tga", "res://cloud_sky/cloud_sky.gd", "res://cloud_sky/clouds_sky.tres", "res://meshes/characters/animations/Fast Run.fbx", "res://cloud_sky/clouds.gdshader", "res://cloud_sky/clouds.glsl", "res://meshes/characters/animations/Breathing Idle.fbx", "res://ui/main_menu.tscn", "res://ui/pause_menu.tscn", "res://ui/loading_screen.tscn", "res://scenes/world2.tscn")
include_filter=""
exclude_filter=""
export_path="../../export/index.html"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.1.options]
custom_template/debug="E:/godot/bin/godot.web.template_debug.wasm32.zip"
custom_template/release="E:/godot/bin/godot.web.template_release.wasm32.zip"
variant/extensions_support=false
variant/thread_support=true
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/ensure_cross_origin_isolation_headers=true
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)

BIN
fonts/AvQest.ttf Normal file

Binary file not shown.

35
fonts/AvQest.ttf.import Normal file
View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://clefrrtb0iqcs"
path="res://.godot/imported/AvQest.ttf-8a9bbbf8c014311bb9ece744c14defe9.fontdata"
[deps]
source_file="res://fonts/AvQest.ttf"
dest_files=["res://.godot/imported/AvQest.ttf-8a9bbbf8c014311bb9ece744c14defe9.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

BIN
fonts/metamorphous.ttf Normal file

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://dtm8cvgc4twhr"
path="res://.godot/imported/metamorphous.ttf-40928e049f9e7314a379893081234c51.fontdata"
[deps]
source_file="res://fonts/metamorphous.ttf"
dest_files=["res://.godot/imported/metamorphous.ttf-40928e049f9e7314a379893081234c51.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@@ -15,7 +15,7 @@ dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.cte
[params]
compress/mode=0
compress/mode=4
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1

6
materials/highlight.tres Normal file
View File

@@ -0,0 +1,6 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://db6w5h7nkrh"]
[resource]
transparency = 1
shading_mode = 0
albedo_color = Color(1, 1, 1, 0.196078)

24
prefabs/box.tscn Normal file
View File

@@ -0,0 +1,24 @@
[gd_scene load_steps=5 format=3 uid="uid://ch5futrap650a"]
[ext_resource type="Script" path="res://src/interactable.gd" id="1_n5lwj"]
[ext_resource type="Material" uid="uid://db6w5h7nkrh" path="res://materials/highlight.tres" id="2_ho87k"]
[sub_resource type="BoxShape3D" id="BoxShape3D_gru1n"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0fl8j"]
albedo_color = Color(0.027451, 0.0784314, 0.203922, 1)
[node name="Box" type="RigidBody3D" node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.68274, 0.831629, 0)
freeze_mode = 1
script = ExtResource("1_n5lwj")
action_label = "Pick up hexahedron"
can_be_picked_up = true
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("2_ho87k")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_gru1n")
[node name="CSGBox3D" type="CSGBox3D" parent="."]
material = SubResource("StandardMaterial3D_0fl8j")

View File

@@ -1,8 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://c4orppao35wg6"]
[gd_scene load_steps=8 format=3 uid="uid://c4orppao35wg6"]
[ext_resource type="Script" path="res://src/character/character_controller.gd" id="1_2yciu"]
[ext_resource type="Script" path="res://src/character/physics_interpolate.gd" id="2_jbufo"]
[ext_resource type="Script" path="res://src/character/character.gd" id="1_vj5gi"]
[ext_resource type="Script" path="res://src/character/physics_interpolator.gd" id="2_jbufo"]
[ext_resource type="Script" path="res://src/character/camera_controller.gd" id="3_i1tod"]
[ext_resource type="PackedScene" uid="uid://82ichxq5e8vn" path="res://prefabs/interactor.tscn" id="5_ww8qu"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_m1ch2"]
radius = 0.4
@@ -13,6 +15,7 @@ radius = 0.4
height = 1.8
[node name="Character" type="Node"]
script = ExtResource("1_vj5gi")
[node name="Physics" type="CharacterBody3D" parent="."]
script = ExtResource("1_2yciu")
@@ -30,7 +33,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.28439, 0)
[node name="CSGMesh3D" type="CSGMesh3D" parent="Visual"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
gi_mode = 0
gi_mode = 2
mesh = SubResource("CapsuleMesh_64ysj")
[node name="CameraArm" type="Node3D" parent="." node_paths=PackedStringArray("target")]
@@ -39,3 +42,5 @@ script = ExtResource("3_i1tod")
target = NodePath("../Visual/CameraTarget")
[node name="Camera3D" type="Camera3D" parent="CameraArm"]
[node name="Interactor" parent="CameraArm/Camera3D" instance=ExtResource("5_ww8qu")]

BIN
prefabs/crosshair001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bxjrbdprlgxct"
path="res://.godot/imported/crosshair001.png-5a77c6a19a8aec551adc95eddf196f48.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://prefabs/crosshair001.png"
dest_files=["res://.godot/imported/crosshair001.png-5a77c6a19a8aec551adc95eddf196f48.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

33
prefabs/interactor.tscn Normal file
View File

@@ -0,0 +1,33 @@
[gd_scene load_steps=3 format=3 uid="uid://82ichxq5e8vn"]
[ext_resource type="Script" path="res://src/interactor.gd" id="1_funnq"]
[ext_resource type="Texture2D" uid="uid://bxjrbdprlgxct" path="res://prefabs/crosshair001.png" id="2_ja03y"]
[node name="Interactor" type="RayCast3D"]
target_position = Vector3(0, 0, -2)
debug_shape_thickness = 4
script = ExtResource("1_funnq")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -32.0
offset_top = -32.0
offset_right = 32.0
offset_bottom = 32.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_ja03y")
[node name="ActionLabel" type="Label" parent="TextureRect"]
unique_name_in_owner = true
visible = false
layout_mode = 0
offset_left = 69.0
offset_top = 40.0
offset_right = 125.0
offset_bottom = 63.0
text = "(E) Pick up"

191
prefabs/npc.tscn Normal file
View File

@@ -0,0 +1,191 @@
[gd_scene load_steps=4 format=3 uid="uid://b5g7ddxfeppvx"]
[ext_resource type="Script" uid="uid://fuvfffq4q7ef" path="res://src/npc.gd" id="1_d0qpm"]
[ext_resource type="PackedScene" uid="uid://ct6p6ydhfl804" path="res://meshes/characters/T-Pose.fbx" id="2_0mk55"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1l2f7"]
radius = 0.4
height = 1.8
[node name="NPC" type="CharacterBody3D"]
physics_interpolation_mode = 2
script = ExtResource("1_d0qpm")
[node name="T-Pose" parent="." instance=ExtResource("2_0mk55")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00448216, 0)
[node name="GeneralSkeleton" parent="T-Pose" index="0"]
bones/1/position = Vector3(0, 0.0946559, -0.0117907)
bones/1/rotation = Quaternion(-0.061923, 0, 0, 0.998081)
bones/2/position = Vector3(0, 0.111285, 2.84894e-08)
bones/2/rotation = Quaternion(1.42729e-07, 0, 0, 1)
bones/3/position = Vector3(0, 0.127183, -3.52342e-08)
bones/3/rotation = Quaternion(-1.4774e-08, 0, 0, 1)
bones/4/position = Vector3(0, 0.143081, -3.33495e-08)
bones/5/position = Vector3(0, 0.0494095, 0.0249997)
bones/5/rotation = Quaternion(-1.13181e-07, 0, 0, 1)
bones/6/position = Vector3(0, 0.226388, 0.114546)
bones/6/rotation = Quaternion(0, 0, 0, 1)
bones/7/position = Vector3(0.0708039, 0.124583, -0.00243831)
bones/7/rotation = Quaternion(-0.549518, -0.440092, 0.568695, -0.425365)
bones/8/position = Vector3(1.64174e-08, 0.146701, -4.25559e-08)
bones/8/rotation = Quaternion(-0.11015, 0.00129146, -0.0116524, 0.993846)
bones/9/position = Vector3(2.39573e-08, 0.206401, 9.46234e-08)
bones/9/rotation = Quaternion(-0.0188662, -0.000742645, 0.0393264, 0.999048)
bones/10/position = Vector3(-6.083e-10, 0.270119, 6.64848e-09)
bones/10/rotation = Quaternion(0.0246826, 0.0864194, 0.0211101, 0.995729)
bones/10/scale = Vector3(1, 1, 0.999999)
bones/11/position = Vector3(-0.0296331, 0.0362177, 0.0149941)
bones/11/rotation = Quaternion(0.150473, 0.041319, 0.261549, 0.952493)
bones/11/scale = Vector3(1, 1, 1)
bones/12/position = Vector3(-0.00558544, 0.0389127, -8.83865e-09)
bones/12/rotation = Quaternion(0.0758692, 0, 1.2998e-15, 0.997118)
bones/13/position = Vector3(0.000380543, 0.0318881, -3.05415e-08)
bones/13/rotation = Quaternion(-0.101666, -2.22045e-16, -2.09205e-15, 0.994819)
bones/14/position = Vector3(0.00520489, 0.0237031, -8.4574e-09)
bones/14/rotation = Quaternion(-1.85354e-07, 1.87368e-08, 1.70666e-08, 1)
bones/15/position = Vector3(-0.0359067, 0.108951, -0.000933027)
bones/15/rotation = Quaternion(0.0937537, 0.00505781, 0.0536316, 0.994137)
bones/16/position = Vector3(2.13687e-05, 0.0315754, -1.88231e-08)
bones/16/rotation = Quaternion(-0.000366765, 8.08381e-16, 6.02611e-15, 1)
bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(2.13443e-05, 0.03027, 7.89213e-09)
bones/17/rotation = Quaternion(0.029664, 4.44089e-16, -8.53051e-15, 0.99956)
bones/18/position = Vector3(-4.27005e-05, 0.0260917, 2.99808e-08)
bones/18/rotation = Quaternion(1.92264e-07, -1.55263e-08, -1.73503e-07, 1)
bones/19/position = Vector3(-0.0121138, 0.111764, -0.00312779)
bones/19/rotation = Quaternion(0.0521865, -0.000730626, -0.0139798, 0.998539)
bones/19/scale = Vector3(1, 0.999999, 1)
bones/20/position = Vector3(3.88185e-05, 0.0324591, 1.28761e-09)
bones/20/rotation = Quaternion(0.0629448, -5.55112e-16, -8.10468e-16, 0.998017)
bones/21/position = Vector3(-7.87746e-06, 0.0318309, -1.11432e-08)
bones/21/rotation = Quaternion(0.0415088, 8.32667e-17, 6.31729e-16, 0.999138)
bones/21/scale = Vector3(1, 1, 1)
bones/22/position = Vector3(-3.09351e-05, 0.0269894, -1.8146e-08)
bones/22/rotation = Quaternion(-1.26141e-07, 2.52855e-08, -9.39375e-09, 1)
bones/22/scale = Vector3(1, 1, 0.999999)
bones/23/position = Vector3(0.0125747, 0.111394, -0.00249342)
bones/23/rotation = Quaternion(0.0901657, -0.00189277, -0.020902, 0.995706)
bones/23/scale = Vector3(1, 1, 1)
bones/24/position = Vector3(6.0861e-06, 0.0275166, 2.0708e-10)
bones/24/rotation = Quaternion(0.0454985, 2.19963e-15, 1.29236e-17, 0.998964)
bones/25/position = Vector3(-1.59501e-05, 0.02733, -3.19401e-08)
bones/25/rotation = Quaternion(-0.0573265, -1.08247e-15, 6.11988e-17, 0.998356)
bones/25/scale = Vector3(1, 1, 0.999999)
bones/26/position = Vector3(9.86724e-06, 0.0232578, 2.49986e-08)
bones/26/rotation = Quaternion(2.6651e-07, 9.35013e-09, 6.94633e-09, 1)
bones/27/position = Vector3(0.0354459, 0.111288, -0.00132103)
bones/27/rotation = Quaternion(0.116323, -0.000496744, -0.00424138, 0.993202)
bones/27/scale = Vector3(1, 0.999999, 1)
bones/28/position = Vector3(2.04901e-05, 0.0226638, -1.31721e-08)
bones/28/rotation = Quaternion(0.0671736, 2.56739e-16, 8.82181e-17, 0.997741)
bones/28/scale = Vector3(1, 1, 1)
bones/29/position = Vector3(-2.63039e-05, 0.0187958, -1.38333e-08)
bones/29/rotation = Quaternion(-0.111705, 2.22045e-16, 2.57535e-16, 0.993741)
bones/29/scale = Vector3(1, 1, 1)
bones/30/position = Vector3(5.83173e-06, 0.013525, 1.10174e-08)
bones/30/rotation = Quaternion(1.21056e-07, -1.17241e-08, 2.10356e-08, 1)
bones/30/scale = Vector3(1, 0.999999, 1)
bones/31/position = Vector3(-0.0708039, 0.12455, -0.00217417)
bones/31/rotation = Quaternion(0.550674, -0.43917, 0.567773, 0.426054)
bones/32/position = Vector3(-1.66065e-08, 0.146701, -3.89434e-08)
bones/32/rotation = Quaternion(-0.11373, -0.005173, 0.0451427, 0.992472)
bones/33/position = Vector3(-6.64912e-08, 0.207486, 8.37591e-08)
bones/33/rotation = Quaternion(-0.0136241, 0.00128459, -0.0938633, 0.995491)
bones/33/scale = Vector3(1, 1, 0.999999)
bones/34/position = Vector3(1.83398e-07, 0.270706, 2.17597e-08)
bones/34/rotation = Quaternion(0.0242138, -0.0809339, 0.00343991, 0.996419)
bones/35/position = Vector3(0.0277536, 0.0338319, 0.0134154)
bones/35/rotation = Quaternion(0.144393, -0.0397373, -0.262346, 0.953282)
bones/35/scale = Vector3(1, 1, 1)
bones/36/position = Vector3(0.00522835, 0.0362403, 2.45995e-08)
bones/36/rotation = Quaternion(0.0898731, -8.88178e-16, -8.90066e-16, 0.995953)
bones/37/position = Vector3(6.44886e-05, 0.033922, -1.21894e-08)
bones/37/rotation = Quaternion(-0.00971079, 1.54043e-15, -9.14928e-16, 0.999953)
bones/38/position = Vector3(-0.00529284, 0.0281232, -9.91702e-09)
bones/38/rotation = Quaternion(-6.96115e-08, -1.37624e-08, -2.92125e-08, 1)
bones/39/position = Vector3(0.0361521, 0.112448, -0.000865398)
bones/39/rotation = Quaternion(0.101104, -0.00551963, -0.0542322, 0.993381)
bones/39/scale = Vector3(1, 1, 1)
bones/40/position = Vector3(1.09527e-05, 0.0312823, 2.20154e-08)
bones/40/rotation = Quaternion(-0.00680271, 1.11022e-16, 1.47061e-15, 0.999977)
bones/40/scale = Vector3(0.999999, 1, 1)
bones/41/position = Vector3(-1.09194e-05, 0.0286288, -2.22716e-08)
bones/41/rotation = Quaternion(0.00352998, 0, -5.36496e-15, 0.999994)
bones/42/position = Vector3(-3.27257e-08, 0.024896, 8.33895e-09)
bones/42/rotation = Quaternion(8.36304e-08, -2.54468e-08, -1.34001e-07, 1)
bones/42/scale = Vector3(1, 1, 0.999999)
bones/43/position = Vector3(0.0113633, 0.11171, -0.00380454)
bones/43/rotation = Quaternion(0.0674643, 0.00106551, 0.0157557, 0.997597)
bones/43/scale = Vector3(1, 1, 1)
bones/44/position = Vector3(-4.98381e-05, 0.0331341, -5.19649e-09)
bones/44/rotation = Quaternion(0.0485227, 2.56739e-16, 2.25758e-18, 0.998822)
bones/44/scale = Vector3(1, 0.999999, 1)
bones/45/position = Vector3(3.24958e-05, 0.0320891, 2.62778e-08)
bones/45/rotation = Quaternion(-0.00719727, 0, 1.06293e-15, 0.999974)
bones/46/position = Vector3(1.73256e-05, 0.0274142, -2.83088e-08)
bones/46/rotation = Quaternion(-1.04717e-08, 2.64603e-08, 1.79778e-08, 1)
bones/47/position = Vector3(-0.0130033, 0.11305, -0.00347693)
bones/47/scale = Vector3(1, 1, 1)
bones/48/position = Vector3(3.75592e-05, 0.0273692, 4.85618e-09)
bones/48/rotation = Quaternion(0.0283073, -4.996e-16, -3.55853e-16, 0.999599)
bones/49/position = Vector3(7.48375e-05, 0.0273446, 5.56498e-09)
bones/49/rotation = Quaternion(-0.170363, -2.9976e-15, -1.91593e-17, 0.985381)
bones/50/position = Vector3(-0.0001124, 0.0232244, 2.50928e-09)
bones/50/rotation = Quaternion(-3.68732e-08, 5.22652e-09, -1.6046e-10, 1)
bones/51/position = Vector3(-0.0345121, 0.110545, -0.000652299)
bones/51/rotation = Quaternion(0.108203, 0.00270327, 0.0248287, 0.993815)
bones/51/scale = Vector3(1, 1, 1)
bones/52/position = Vector3(-9.74535e-05, 0.022956, 8.91163e-09)
bones/52/rotation = Quaternion(0.0636609, -7.97973e-16, 9.83177e-17, 0.997972)
bones/52/scale = Vector3(0.999999, 1, 1)
bones/53/position = Vector3(1.92768e-05, 0.0187969, -6.46676e-09)
bones/53/rotation = Quaternion(0.00868856, -1.94289e-16, -1.84944e-17, 0.999962)
bones/53/scale = Vector3(1, 1, 0.999999)
bones/54/position = Vector3(7.81744e-05, 0.0144151, 1.29186e-08)
bones/54/rotation = Quaternion(-1.26305e-08, -1.23625e-09, -5.18408e-09, 1)
bones/54/scale = Vector3(1, 0.999999, 1)
bones/55/position = Vector3(0.0983166, -0.0526747, -0.00602804)
bones/55/rotation = Quaternion(-0.000522738, -0.016105, 0.999344, -0.0324368)
bones/56/position = Vector3(9.70817e-09, 0.403269, 1.83691e-08)
bones/56/rotation = Quaternion(-0.0296365, 2.38372e-05, -0.000803968, 0.99956)
bones/56/scale = Vector3(1, 1, 1)
bones/57/position = Vector3(-1.29331e-08, 0.436716, -2.23544e-08)
bones/57/rotation = Quaternion(0.461439, -0.0247855, 0.0128979, 0.886732)
bones/58/position = Vector3(-2.21237e-08, 0.170605, 1.37787e-07)
bones/58/rotation = Quaternion(0.338196, -0.0542781, 0.0195428, 0.939306)
bones/59/position = Vector3(-2.68487e-09, 0.0631742, -1.0103e-07)
bones/59/rotation = Quaternion(1.45411e-08, -2.13903e-08, 2.13483e-08, 1)
bones/59/scale = Vector3(0.999999, 1, 1)
bones/60/position = Vector3(-0.0983166, -0.0526747, -0.00177373)
bones/60/rotation = Quaternion(0.000690124, -0.0212702, 0.999248, 0.0324212)
bones/61/position = Vector3(-2.12297e-08, 0.403424, 3.28663e-09)
bones/62/position = Vector3(2.86445e-08, 0.436795, -1.35928e-08)
bones/62/rotation = Quaternion(0.454934, 0.0258923, -0.0132344, 0.89005)
bones/63/position = Vector3(2.97813e-08, 0.167352, 9.66457e-08)
bones/63/rotation = Quaternion(0.345796, 0.0543638, -0.020073, 0.936518)
bones/63/scale = Vector3(1, 1, 1)
bones/64/position = Vector3(-1.0848e-08, 0.0615458, -7.80347e-08)
bones/64/rotation = Quaternion(-1.54572e-07, 1.46948e-08, -1.67451e-08, 1)
[node name="Ch35" parent="T-Pose/GeneralSkeleton" index="0"]
gi_mode = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
shape = SubResource("CapsuleShape3D_1l2f7")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
debug_enabled = true
[node name="Label" type="Label" parent="."]
auto_translate_mode = 1
offset_right = 133.0
offset_bottom = 62.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "uppsz"
[node name="CameraTarget" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.45037, 0)
[editable path="T-Pose"]

View File

@@ -13,19 +13,24 @@ config_version=5
config/name="3D Character Controller Template"
config/version="0.0.2"
config/tags=PackedStringArray("3d")
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
run/main_scene="res://ui/main_menu.tscn"
config/features=PackedStringArray("4.4", "Forward Plus")
boot_splash/bg_color=Color(0, 0, 0, 1)
config/icon="res://icon.svg"
[autoload]
DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
GameManager="*res://src/game_manager.gd"
SceneLoader="*res://src/loader/SceneLoader.gd"
DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
[display]
window/size/viewport_width=1920
window/size/viewport_height=1080
window/size/mode=4
window/vsync/vsync_mode=2
mouse_cursor/custom_image="res://ui/8_white.png"
[editor_plugins]
@@ -38,45 +43,60 @@ folder_colors={
"res://prefabs/": "green",
"res://scenes/": "blue",
"res://shaders/": "orange",
"res://sounds/": "purple",
"res://src/": "orange",
"res://ui/": "pink"
}
[global_group]
navigation_source=""
[gui]
theme/custom="res://ui/theme/ui_theme.tres"
[input]
ui_cancel={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194313,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
sprint={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
]
}
@@ -110,9 +130,46 @@ look_down={
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
]
}
toggle_fullscreen={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194341,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
interact={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
]
}
[internationalization]
locale/translations_pot_files=PackedStringArray("res://ui/pause_menu.tscn", "res://prefabs/box.tscn")
locale/test="hu"
pseudolocalization/replace_with_accents=false
[physics]
common/physics_jitter_fix=0.0
3d/physics_engine="Jolt Physics"
common/physics_interpolation=true
[rendering]
scaling_3d/mode=2
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
lights_and_shadows/directional_shadow/soft_shadow_filter_quality=3
reflections/sky_reflections/texture_array_reflections=false
camera/depth_of_field/depth_of_field_use_jitter=true
environment/ssao/quality=3
environment/ssao/half_size=false
environment/ssao/adaptive_target=1.0
environment/ssao/blur_passes=0
environment/ssil/quality=3
environment/ssil/half_size=false
environment/ssil/adaptive_target=1.0
environment/ssil/blur_passes=2
environment/glow/upscale_mode=0
environment/volumetric_fog/volume_size=512
environment/volumetric_fog/volume_depth=128
environment/defaults/default_clear_color=Color(0, 0, 0, 1)
environment/defaults/default_environment="res://scenes/main/main_environment.tres"
anti_aliasing/quality/screen_space_aa=1

Binary file not shown.

View File

@@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bvfmq3k66cfig"
path="res://.godot/imported/level_blockout.glb-64553bee7328cb2e3f4be5ac0bb253c6.scn"
[deps]
source_file="res://scenes/blockout/level_blockout.glb"
dest_files=["res://.godot/imported/level_blockout.glb-64553bee7328cb2e3f4be5ac0bb253c6.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=2
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=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://h2br251ks6aw"
path.s3tc="res://.godot/imported/level_blockout_0.png-925a57ebe80e7042f621bc58df579904.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "b37af0d37f42c985acd5bed9e9f1b62f"
}
[deps]
source_file="res://scenes/blockout/level_blockout_0.png"
dest_files=["res://.godot/imported/level_blockout_0.png-925a57ebe80e7042f621bc58df579904.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://drnhwl5lle7nj"
path.s3tc="res://.godot/imported/level_blockout_1.png-ff45cfa538cbb2b785135ce8305fe5c9.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "08a73e42bd2cc43741ad1322783b08da"
}
[deps]
source_file="res://scenes/blockout/level_blockout_1.png"
dest_files=["res://.godot/imported/level_blockout_1.png-ff45cfa538cbb2b785135ce8305fe5c9.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=1
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1
roughness/src_normal="res://scenes/blockout/level_blockout_1.png"
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

BIN
scenes/blockout/world2.exr Normal file

Binary file not shown.

View File

@@ -0,0 +1,28 @@
[remap]
importer="2d_array_texture"
type="CompressedTexture2DArray"
uid="uid://ppbb8tjng12h"
path="res://.godot/imported/world2.exr-b6b494ed63130eb40859d0f159ec58c5.ctexarray"
metadata={
"vram_texture": false
}
[deps]
source_file="res://scenes/blockout/world2.exr"
dest_files=["res://.godot/imported/world2.exr-b6b494ed63130eb40859d0f159ec58c5.ctexarray"]
[params]
compress/mode=3
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/channel_pack=1
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=1
slices/vertical=1

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

View File

@@ -0,0 +1,29 @@
[remap]
importer="2d_array_texture"
type="CompressedTexture2DArray"
uid="uid://c6646ccokvnit"
path.s3tc="res://.godot/imported/world2_shadow.png-aabe75c38a31dbdf666e29fa3290bae4.s3tc.ctexarray"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://scenes/blockout/world2_shadow.png"
dest_files=["res://.godot/imported/world2_shadow.png-aabe75c38a31dbdf666e29fa3290bae4.s3tc.ctexarray"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/channel_pack=1
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=1
slices/vertical=1

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf3u4fq6ockn7"
path.bptc="res://.godot/imported/kloofendal_43d_clear_1k.exr-7af1fbe739e24906450a27a52b5b4291.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://scenes/kloofendal_43d_clear_1k.exr"
dest_files=["res://.godot/imported/kloofendal_43d_clear_1k.exr-7af1fbe739e24906450a27a52b5b4291.bptc.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

View File

@@ -1,64 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://dgfh1lgxud87u"]
[ext_resource type="PackedScene" uid="uid://c4orppao35wg6" path="res://prefabs/character.tscn" id="2_v34ds"]
[ext_resource type="Script" path="res://src/spawner.gd" id="3_xxi2i"]
[sub_resource type="GDScript" id="GDScript_12xd3"]
script/source = "extends Node3D
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
"
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xxbnc"]
albedo_color = Color(0.266667, 0.145098, 0.0823529, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_uelfv"]
material = SubResource("StandardMaterial3D_xxbnc")
size = Vector2(50, 50)
[sub_resource type="BoxShape3D" id="BoxShape3D_vbj2x"]
size = Vector3(50, 1, 50)
[node name="Main" type="Node3D"]
script = SubResource("GDScript_12xd3")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.276457, -0.764665, 0.582116, 0.11662, 0.62794, 0.769474, -0.953924, -0.14484, 0.262774, 0, 0, 0)
light_energy = 2.0
shadow_enabled = true
directional_shadow_fade_start = 1.0
directional_shadow_max_distance = 50.0
[node name="Spawner" type="Node3D" parent="."]
script = ExtResource("3_xxi2i")
object_to_spawn = ExtResource("2_v34ds")
[node name="CSGMesh3D" type="CSGMesh3D" parent="."]
mesh = SubResource("PlaneMesh_uelfv")
[node name="StaticBody3D" type="StaticBody3D" parent="CSGMesh3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="CSGMesh3D/StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
shape = SubResource("BoxShape3D_vbj2x")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
use_collision = true
[node name="Box" type="CSGBox3D" parent="CSGCombiner3D"]
[node name="Box5" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.37539, 1.21157, -5.02753)
[node name="Box2" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)
[node name="Box4" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.06635, 1.17009, -1.15682)
size = Vector3(1, 1, 4.31364)
[node name="Box3" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.15636, 1.09924, 0.824171)
size = Vector3(3.28895, 0.716575, 1)

View File

@@ -1,34 +1,39 @@
[gd_resource type="Environment" load_steps=4 format=3 uid="uid://b8fqed8jo6yqj"]
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://b8fqed8jo6yqj"]
[ext_resource type="CompressedTexture3D" uid="uid://bus418i6c6y3w" path="res://luts/lut_saturated.png" id="1_3f5y7"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_yhaxv"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_rxwic"]
sky_top_color = Color(0.317647, 0.415686, 0.643137, 1)
sky_horizon_color = Color(0.878431, 0.929412, 1, 1)
ground_bottom_color = Color(0.439216, 0.290196, 0.239216, 1)
ground_horizon_color = Color(0.988235, 0.890196, 0.823529, 1)
sun_angle_max = 0.0
sun_curve = 1e-05
[sub_resource type="Sky" id="Sky_wbc5y"]
sky_material = SubResource("ProceduralSkyMaterial_rxwic")
[sub_resource type="Sky" id="Sky_v5osj"]
sky_material = SubResource("ProceduralSkyMaterial_yhaxv")
[resource]
background_mode = 2
sky = SubResource("Sky_wbc5y")
tonemap_mode = 2
sky = SubResource("Sky_v5osj")
tonemap_mode = 4
tonemap_exposure = 2.0
tonemap_white = 6.0
ssao_enabled = true
ssr_fade_in = 1e-05
ssr_fade_out = 1e-05
ssao_radius = 5.0
ssao_detail = 3.94
ssao_light_affect = 0.35
ssao_ao_channel_affect = 1.0
ssil_radius = 2.0
ssil_intensity = 1.5
sdfgi_use_occlusion = true
sdfgi_bounce_feedback = 0.9
glow_enabled = true
sdfgi_bounce_feedback = 0.98
sdfgi_min_cell_size = 0.390625
sdfgi_cascade0_distance = 25.0
sdfgi_max_distance = 400.0
sdfgi_energy = 1.3
glow_levels/4 = 1.0
glow_levels/6 = 1.0
glow_levels/7 = 1.0
glow_blend_mode = 4
fog_sun_scatter = 0.5
fog_aerial_perspective = 0.9
volumetric_fog_albedo = Color(0.960784, 0.984314, 1, 1)
adjustment_enabled = true
adjustment_color_correction = ExtResource("1_3f5y7")
fog_enabled = true
fog_light_color = Color(0.47, 0.390492, 0.3055, 1)
fog_sun_scatter = 0.2
fog_density = 0.001
fog_aerial_perspective = 0.35
volumetric_fog_density = 0.002
volumetric_fog_ambient_inject = 1.0
adjustment_contrast = 1.05

288
scenes/test.tscn Normal file

File diff suppressed because one or more lines are too long

242
scenes/world.tscn Normal file
View File

@@ -0,0 +1,242 @@
[gd_scene load_steps=25 format=3 uid="uid://dgfh1lgxud87u"]
[ext_resource type="Script" uid="uid://b516jj4kwrvho" path="res://src/world.gd" id="1_2kvs8"]
[ext_resource type="PackedScene" uid="uid://c4orppao35wg6" path="res://prefabs/character.tscn" id="2_v34ds"]
[ext_resource type="Script" uid="uid://b1roviltcxswt" path="res://src/interactable.gd" id="3_mxyfw"]
[ext_resource type="Script" uid="uid://blwx7468vta0e" path="res://src/spawner.gd" id="3_xxi2i"]
[ext_resource type="Material" uid="uid://db6w5h7nkrh" path="res://materials/highlight.tres" id="4_ujno1"]
[ext_resource type="AudioStream" uid="uid://brmgyma8s5cv0" path="res://sounds/quack.mp3" id="5_5p8s7"]
[ext_resource type="Environment" uid="uid://b8fqed8jo6yqj" path="res://scenes/main/main_environment.tres" id="6_p0lc8"]
[ext_resource type="Script" uid="uid://dyohpsoni5hdk" path="res://src/Actions/SceneChangeAction.gd" id="7_dpx6x"]
[ext_resource type="Script" uid="uid://flr0tadklbny" path="res://src/CompositorEffects/new_script.gd" id="9_p3c3q"]
[sub_resource type="BoxShape3D" id="BoxShape3D_vbj2x"]
size = Vector3(200, 1, 200)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jqeof"]
albedo_color = Color(0.380392, 0.235294, 0.0470588, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_03bca"]
material = SubResource("StandardMaterial3D_jqeof")
size = Vector2(200, 200)
[sub_resource type="Animation" id="Animation_jap08"]
resource_name = "button"
length = 0.2
tracks/0/type = "position_3d"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.1, 1, 0, 0, 0.0581902, 0.2, 1, 0, 0, 0)
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hqvaa"]
_data = {
&"button": SubResource("Animation_jap08")
}
[sub_resource type="GDScript" id="GDScript_ieo6a"]
script/source = "extends AudioStreamPlayer3D
func _on_static_body_3d_2_interacted() -> void:
play()
"
[sub_resource type="BoxShape3D" id="BoxShape3D_p7pa6"]
size = Vector3(0.1, 0.1, 0.1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_02n7n"]
albedo_color = Color(1, 0, 0, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_gru1n"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0fl8j"]
albedo_color = Color(0.027451, 0.0784314, 0.203922, 1)
[sub_resource type="PackedScene" id="PackedScene_acm8y"]
_bundled = {
"conn_count": 0,
"conns": PackedInt32Array(),
"editable_instances": [],
"names": PackedStringArray("Box", "RigidBody3D", "transform", "freeze_mode", "script", "action_label", "can_be_picked_up", "visual_mesh", "highlight_material", "CollisionShape3D", "CollisionShape3D", "shape", "CSGBox3D", "CSGBox3D", "material"),
"node_count": 3,
"node_paths": [NodePath("."), NodePath(".")],
"nodes": PackedInt32Array(-1, -1, 1, 0, -1, 7, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 1073741831, 5, 8, 6, 0, 1073741824, 0, 10, 9, -1, 1, 11, 7, 0, 1073741825, 0, 13, 12, -1, 1, 14, 8, 0),
"variants": [Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.68274, 0.831629, 0), 1, ExtResource("3_mxyfw"), "Pick up hexahedron", true, NodePath("CSGBox3D"), ExtResource("4_ujno1"), SubResource("BoxShape3D_gru1n"), SubResource("StandardMaterial3D_0fl8j")],
"version": 3
}
[sub_resource type="BoxShape3D" id="BoxShape3D_pk5j7"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jl3vg"]
albedo_color = Color(0.027451, 0.0784314, 0.203922, 1)
[sub_resource type="CompositorEffect" id="CompositorEffect_pcdkj"]
resource_local_to_scene = false
resource_name = ""
enabled = true
effect_callback_type = 4
needs_motion_vectors = false
needs_normal_roughness = false
script = ExtResource("9_p3c3q")
[sub_resource type="Compositor" id="Compositor_ip8ui"]
compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_pcdkj")])
[node name="Main" type="Node3D"]
script = ExtResource("1_2kvs8")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.671816, -0.457968, 0.582175, -0.273103, 0.577442, 0.769399, -0.688533, -0.675889, 0.262862, 0, 0, 0)
light_energy = 3.0
shadow_enabled = true
directional_shadow_mode = 1
directional_shadow_split_1 = 0.2
directional_shadow_split_2 = 0.1
directional_shadow_split_3 = 0.3
directional_shadow_fade_start = 1.0
directional_shadow_max_distance = 50.0
[node name="StaticBody3D" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.6174, 0, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
shape = SubResource("BoxShape3D_vbj2x")
[node name="CSGMesh3D" type="CSGMesh3D" parent="StaticBody3D"]
mesh = SubResource("PlaneMesh_03bca")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
use_collision = true
[node name="Box" type="CSGBox3D" parent="CSGCombiner3D"]
[node name="Box6" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.498871, -3.33969)
size = Vector3(1, 0.253906, 1)
[node name="Box7" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.138916, -3.84261)
size = Vector3(1, 0.253906, 1)
[node name="Box8" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0638185, -4.34447)
size = Vector3(1, 0.253906, 1)
[node name="Box9" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.276995, -4.88516)
size = Vector3(1, 0.253906, 1)
[node name="Box5" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.37539, 1.21157, -5.02753)
[node name="Box2" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)
[node name="Box4" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.06635, 1.17009, -1.15682)
size = Vector3(1, 1, 4.31364)
[node name="Box3" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.15636, 1.09924, 0.824171)
size = Vector3(3.28895, 0.716575, 1)
[node name="Spawner" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.24057, -4.76837e-07, -2.07045)
script = ExtResource("3_xxi2i")
object_to_spawn = ExtResource("2_v34ds")
[node name="StaticBody3D2" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.45341, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Quack"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")
[node name="AnimationPlayer" type="AnimationPlayer" parent="StaticBody3D2"]
root_node = NodePath("../CSGBox3D")
libraries = {
&"": SubResource("AnimationLibrary_hqvaa")
}
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="StaticBody3D2"]
stream = ExtResource("5_5p8s7")
script = SubResource("GDScript_ieo6a")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D2"]
shape = SubResource("BoxShape3D_p7pa6")
[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D2"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")
[node name="StaticBody3D3" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.78427, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Spawn Hexahedron"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D3"]
shape = SubResource("BoxShape3D_p7pa6")
[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D3"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")
[node name="Spawner" type="Node3D" parent="StaticBody3D3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.547359, 0.647922)
script = ExtResource("3_xxi2i")
object_to_spawn = SubResource("PackedScene_acm8y")
auto_spawn = false
[node name="StaticBody3D4" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.15809, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Move to next world"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")
[node name="SceneChangeAction" type="Node" parent="StaticBody3D4"]
script = ExtResource("7_dpx6x")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D4"]
shape = SubResource("BoxShape3D_p7pa6")
[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D4"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")
[node name="Box" type="RigidBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.68274, 0.831629, 0)
freeze_mode = 1
script = ExtResource("3_mxyfw")
action_label = "Pick up hexahedron"
can_be_picked_up = true
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Box"]
shape = SubResource("BoxShape3D_pk5j7")
[node name="CSGBox3D" type="CSGBox3D" parent="Box"]
material = SubResource("StandardMaterial3D_jl3vg")
[node name="CSGBox3D" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.35573, 0)
material = ExtResource("4_ujno1")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("6_p0lc8")
compositor = SubResource("Compositor_ip8ui")
[node name="LightmapGI" type="LightmapGI" parent="."]
[connection signal="interacted" from="StaticBody3D2" to="StaticBody3D2/AudioStreamPlayer3D" method="_on_static_body_3d_2_interacted"]
[connection signal="interacted" from="StaticBody3D2" to="StaticBody3D2/AnimationPlayer" method="play" binds= ["button"]]
[connection signal="interacted" from="StaticBody3D3" to="StaticBody3D3/Spawner" method="spawn"]
[connection signal="interacted" from="StaticBody3D4" to="StaticBody3D4/SceneChangeAction" method="perform_action"]

537
scenes/world2.tscn Normal file

File diff suppressed because one or more lines are too long

171
scenes/world3.tscn Normal file

File diff suppressed because one or more lines are too long

52
shaders/cam.gdshader Normal file
View File

@@ -0,0 +1,52 @@
shader_type canvas_item;
uniform float aspect = 1.0;
uniform float distortion = 1.0;
uniform float radius = 1.07;
uniform float alpha : hint_range(0.0, 1.0, 0.1) = 1.0;
uniform float crop = 0.943;
uniform vec4 crop_color : source_color = vec4(0,0,0,1);
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform float crop_feathering = 0.1;
const float base_distortion = 0.99;
uniform float channel_offset : hint_range(-0.1, 0.1, 0.001) = 0.005;
uniform float noise_strength = 5.0;
vec2 distort(vec2 p)
{
float d = length(p);
float z = sqrt(distortion + d * d * -distortion);
float r = atan(d, z) / 3.1415926535;
float phi = atan(p.y, p.x);
return vec2(r * cos(phi) * (1.0 / aspect) + 0.5, r * sin(phi) + 0.5);
}
void fragment()
{
vec2 xy = (SCREEN_UV * 2.0 - 1.0);
xy = vec2(xy.x * aspect, xy.y);
float d = length(xy);
vec4 tex;
if (d < radius)
{
vec2 distorted_uv_r = distort(xy * (base_distortion + 0.0 * channel_offset));
vec2 distorted_uv_g = distort(xy * (base_distortion + 1.0 * channel_offset));
vec2 distorted_uv_b = distort(xy * (base_distortion + 2.0 * channel_offset));
tex.r = texture(SCREEN_TEXTURE, distorted_uv_r).r;
tex.g = texture(SCREEN_TEXTURE, distorted_uv_g).g;
tex.b = texture(SCREEN_TEXTURE, distorted_uv_b).b;
float x = (UV.x + 4.0 ) * (UV.y + 4.0 ) * (TIME * 10.0);
tex = tex+vec4(mod((mod(x, 13.0) ) * (mod(x, 123.0) ), 0.01)-0.005) * noise_strength;
COLOR = tex;
COLOR.a = alpha;
}
if (d > crop)
{
float softness = smoothstep(crop, crop + crop_feathering, d);
COLOR = mix(tex, crop_color, softness);
COLOR.a = alpha;
}
}

1
shaders/cam.gdshader.uid Normal file
View File

@@ -0,0 +1 @@
uid://cpatgd4fw6c77

BIN
sounds/quack.mp3 Normal file

Binary file not shown.

19
sounds/quack.mp3.import Normal file
View File

@@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://brmgyma8s5cv0"
path="res://.godot/imported/quack.mp3-1cdab1c1ccb41db8f6af38b090ba5160.mp3str"
[deps]
source_file="res://sounds/quack.mp3"
dest_files=["res://.godot/imported/quack.mp3-1cdab1c1ccb41db8f6af38b090ba5160.mp3str"]
[params]
loop=false
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

4
src/Actions/Action.gd Normal file
View File

@@ -0,0 +1,4 @@
class_name Action extends Node
func perform_action():
pass

View File

@@ -0,0 +1 @@
uid://dko1j6fi0ua4f

View File

@@ -0,0 +1,4 @@
class_name SceneChangeAction extends Action
func perform_action():
SceneLoader.load_scene('res://scenes/th.tscn')

View File

@@ -0,0 +1 @@
uid://dyohpsoni5hdk

View File

@@ -0,0 +1,6 @@
class_name TestEffect
extends CompositorEffect
func _render_callback(effect_callback_type: int, render_data: RenderData) -> void:
print("hi")
pass

View File

@@ -0,0 +1 @@
uid://flr0tadklbny

View File

@@ -1,4 +1,4 @@
extends Node3D
class_name PlayerCameraController extends Node3D
@export var target : Node3D
@onready var camera = $Camera3D
@@ -23,7 +23,7 @@ func _process(delta):
global_position = target.global_position
rotation.x = clamp(rotation.x - lookInput.x * delta * 0.3, PI*-0.48, PI*0.2)
rotation.x = clamp(rotation.x - lookInput.x * delta * 0.3, PI*-0.48, PI*0.48)
rotation.y -= lookInput.y * delta * 0.3
lookInput = Vector2.ZERO

View File

@@ -0,0 +1 @@
uid://iftuobwwos2v

View File

@@ -0,0 +1,5 @@
class_name Character extends Node
var position: Vector3:
set(value):
$Physics.position = value

View File

@@ -0,0 +1 @@
uid://cojiog0s838qh

View File

@@ -0,0 +1 @@
uid://cpg4d47b02x5r

View File

@@ -1,4 +1,4 @@
extends Node3D
class_name PhysicsInterpolator extends Node3D
@export var physicsObject : PhysicsBody3D

View File

@@ -0,0 +1 @@
uid://dqr8q7pac0kyy

View File

@@ -0,0 +1,26 @@
class_name PlayerInput extends Node
var camera : Camera3D
func getInputVector() -> Vector3 :
var cam_basis = camera.global_transform.basis
cam_basis.x.y = 0
cam_basis.x = cam_basis.x.normalized()
cam_basis.z.y = 0
cam_basis.z = cam_basis.z.normalized()
var input = Input.get_vector("move_left", "move_right", "move_up", "move_down")
var relativeInput = Vector3.ZERO
relativeInput += input.x * cam_basis.x
relativeInput += input.y * cam_basis.z
return relativeInput
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@@ -0,0 +1 @@
uid://bf1ayjieir2u8

View File

@@ -5,7 +5,16 @@ var pause_menu: PauseMenu
func _ready() -> void:
pause_menu = pause_menu_res.instantiate()
get_tree().root.add_child.call_deferred(pause_menu)
func load_menu(initial: bool = false):
if not initial: pause_game(false)
SceneLoader.load_scene('res://ui/main_menu.tscn')
func start_new_game() -> void:
SceneLoader.load_scene('res://scenes/world2.tscn')
func world_loaded(_world: World) -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed('ui_cancel'):
@@ -15,6 +24,6 @@ func quit_game():
get_tree().quit()
func pause_game(pause = true):
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE if pause else Input.MOUSE_MODE_CAPTURED
get_tree().paused = pause
pause_menu.visible = pause
if pause: get_tree().root.add_child(pause_menu)
else: pause_menu.get_parent().remove_child(pause_menu)

1
src/game_manager.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://ure6c10abrg3

25
src/interactable.gd Normal file
View File

@@ -0,0 +1,25 @@
class_name Interactable extends PhysicsBody3D
signal interacted
@export_group('Interaction settings')
@export var action_label: String
@export var can_be_picked_up: bool = false
@export_group('Visual settings')
@export var visual_mesh: GeometryInstance3D
@export var highlight_material: Material
var highlighted: bool:
get: return highlighted
set(val):
highlighted = val
set_highlight_material(val)
func set_highlight_material(val: bool):
visual_mesh.material_overlay = highlight_material if val else null
func interact(interactor: Interactor):
interacted.emit()
if interactor and can_be_picked_up:
interactor.hold_object(self)

1
src/interactable.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://b1roviltcxswt

52
src/interactor.gd Normal file
View File

@@ -0,0 +1,52 @@
class_name Interactor extends RayCast3D
@onready var action_label: Label = %ActionLabel
var selected: Interactable:
get: return selected
set(val):
if val == selected: return
if(selected):
selected.highlighted = false
action_label.visible = false
selected = val
if(selected):
selected.highlighted = true
action_label.text = selected.action_label
action_label.visible = true
var held_object: Interactable
func _physics_process(_delta: float) -> void:
if not is_colliding() or held_object:
selected = null
return
var obj = get_collider()
selected = obj if obj is Interactable else null
func _input(event: InputEvent) -> void:
if not event.is_action_pressed('interact'): return
if selected:
selected.interact(self)
return
if held_object:
drop_object()
func hold_object(obj: Interactable):
held_object = obj
obj.process_mode = Node.PROCESS_MODE_DISABLED
obj.reparent(self)
#obj.position = Vector3(0,0,-1.2)
func drop_object():
if not held_object: return
held_object.reparent(get_tree().root)
held_object.process_mode = Node.PROCESS_MODE_INHERIT
held_object = null

1
src/interactor.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://s6ppluw6alti

47
src/loader/SceneLoader.gd Normal file
View File

@@ -0,0 +1,47 @@
extends Node
var loading_screen_scene: = preload('res://ui/loading_screen.tscn')
var loading_screen_instance: LoadingScreen
var _loading: String = ""
var progress: Array[float] = []
func _init() -> void:
process_mode = PROCESS_MODE_ALWAYS
func _ready() -> void:
loading_screen_instance = loading_screen_scene.instantiate()
func load_scene(path: String):
get_tree().paused = true
ResourceLoader.load_threaded_request(path, "", true)
var status := ResourceLoader.load_threaded_get_status(path, progress)
show_loading_screen()
if status != ResourceLoader.THREAD_LOAD_LOADED:
_loading = path
func show_loading_screen():
if not loading_screen_instance.get_parent(): add_child(loading_screen_instance)
func hide_loading_screen():
if not loading_screen_instance: return
await loading_screen_instance.fade_out()
if loading_screen_instance.get_parent(): loading_screen_instance.get_parent().remove_child(loading_screen_instance)
func _process(_delta: float) -> void:
if _loading == "": return
var status := ResourceLoader.load_threaded_get_status(_loading, progress)
if status != ResourceLoader.THREAD_LOAD_LOADED: return
var resource : PackedScene = ResourceLoader.load_threaded_get(_loading)
get_tree().change_scene_to_packed(resource)
hide_loading_screen()
get_tree().paused = false
_loading = ""

View File

@@ -0,0 +1 @@
uid://xkcvclatu2qy

37
src/npc.gd Normal file
View File

@@ -0,0 +1,37 @@
class_name NPC extends CharacterBody3D
@export var target : Node3D
@export var movement_speed: float = 4.0
@onready var navigation_agent: NavigationAgent3D = $NavigationAgent3D
@onready var label : Label = $Label
func _input(event: InputEvent) -> void:
if event.is_action_pressed('interact'):
set_movement_target(target.position)
func _ready() -> void:
navigation_agent.velocity_computed.connect(Callable(_on_velocity_computed))
func set_movement_target(movement_target: Vector3):
navigation_agent.set_target_position(movement_target)
func _physics_process(_delta):
if navigation_agent.is_navigation_finished():
return
var next_path_position: Vector3 = navigation_agent.get_next_path_position()
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * movement_speed
if navigation_agent.avoidance_enabled:
navigation_agent.velocity = new_velocity
else:
_on_velocity_computed(new_velocity)
func _on_velocity_computed(safe_velocity: Vector3):
label.text = "x:%f y:%f z:%f" % [safe_velocity.x, safe_velocity.y, safe_velocity.z]
safe_velocity.y = 0
var direction := safe_velocity.normalized()
if direction:
velocity = direction * movement_speed
look_at(global_position - direction)
move_and_slide()

1
src/npc.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://fuvfffq4q7ef

View File

@@ -0,0 +1,3 @@
shader_type spatial;
render_mode unshaded;
render_mode depth_draw_opaque;

View File

@@ -0,0 +1 @@
uid://b47aar6f3hfcm

View File

@@ -0,0 +1,35 @@
shader_type canvas_item;
render_mode blend_add;
#include "res://src/shaders/lib/clr.gdshaderinc"
uniform lowp sampler2D Screen_Sample : hint_screen_texture, filter_linear_mipmap_anisotropic;
uniform lowp sampler2D FlareMult;
uniform lowp sampler2D FlareMult2;
uniform float Blur = 2.5;
uniform float FlareThreshold;
uniform int Flares;
uniform float FlareSpacing;
uniform float Intensity;
uniform float Saturation_;
void fragment(){
vec2 FlippedUV = vec2(1.0) - SCREEN_UV;
vec2 FlareVector = (vec2(0.5) - SCREEN_UV) * FlareSpacing;
vec3 FinalFlare = vec3(0.0);
for (int i = 0; i < Flares; ++i){
vec2 SUV = fract(SCREEN_UV + FlareVector * vec2(float(i)));
float Dist = distance(SUV, vec2(0.5));
float Weight = 1.0 - smoothstep(0.0, 0.75, Dist);
vec3 BlurredScreen = texture(Screen_Sample, SUV, Blur).rgb;
BlurredScreen = ApplyThreshold(BlurredScreen, FlareThreshold);
FinalFlare += BlurredScreen * Weight;
}
FinalFlare *= texture(FlareMult, SCREEN_UV).rgb;
FinalFlare *= texture(FlareMult2, SCREEN_UV).rgb;
COLOR.rgb = FinalFlare * Intensity;
COLOR.rgb = Saturation(COLOR.rgb, Saturation_);
}

View File

@@ -0,0 +1 @@
uid://c2qvh4lbu3c3w

View File

@@ -0,0 +1,7 @@
vec3 ApplyThreshold(vec3 CLR, float Threshold){
return max(CLR - vec3(Threshold), vec3(0.0));
}
vec3 Saturation(vec3 InputCLR, float Saturation){
return mix(vec3(dot(InputCLR.rgb, vec3(0.299, 0.587, 0.114))), InputCLR.rgb, Saturation);
}

View File

@@ -0,0 +1 @@
uid://bb5ed7lqm6dh

View File

@@ -0,0 +1,67 @@
shader_type spatial;
render_mode cull_back;
uniform sampler2D DEPTH_TEXTURE : hint_depth_texture, filter_linear_mipmap;
void vertex() {
// Called for every vertex the material is visible on.
}
varying vec2 _screen_pos;
varying vec2 _pixel_size;
varying mat4 _inv_pr_mat;
varying mat4 _pr_mat;
void fragment() {
_screen_pos = SCREEN_UV;
_pixel_size = vec2(1.0,1.0);
_inv_pr_mat = INV_PROJECTION_MATRIX;
_pr_mat = PROJECTION_MATRIX;
}
float get_depth(vec2 uv) {
return textureLod(DEPTH_TEXTURE, uv, 0.0).r;
}
vec3 get_pos(vec2 uv) {
float depth = textureLod(DEPTH_TEXTURE, uv, 0.0).r;
vec4 upos = _inv_pr_mat * vec4(uv * 2.0 - 1.0, depth, 1.0);
return upos.xyz / upos.w;
}
const int MAX_STEPS = 1000;
float RayTrace(vec3 ro, vec3 rd, vec2 vp_size) {
vec2 step_dir = 1.0 * rd.xy / vp_size;
float step_len = length(step_dir);
ro.xy /= vp_size;
ro.z = get_depth(ro.xy);
vec3 od = get_pos(ro.xy);
float d = .0;
for (int i = 0; i < MAX_STEPS; i++) {
vec2 uv = ro.xy + step_dir * d;
vec3 pos = get_pos(uv);
if(normalize(pos - od).z > rd.z) return 0.0;
if(length(pos-od) > 0.05) return 1.0;
d += 1.0;
}
return 1.0;
}
float calculate_light(vec3 normal, vec3 light) {
return max(dot(normal, light),0);
}
float screen_shadows(vec3 normal, vec3 light, vec3 screen_pos, vec2 vp_size) {
// WHY????
light.y *= -1.0;
return RayTrace(screen_pos, light, vp_size);
}
void light() {
//DIFFUSE_LIGHT = vec3(get_pos(FRAGCOORD.xy / VIEWPORT_SIZE).z * -1.0);
DIFFUSE_LIGHT += screen_shadows(NORMAL, LIGHT, FRAGCOORD.xyz, VIEWPORT_SIZE) * calculate_light(NORMAL, LIGHT);
}

View File

@@ -0,0 +1 @@
uid://ckngyodfpr6cw

Some files were not shown because too many files have changed in this diff Show More