Loads of stuff

This commit is contained in:
Dan Baker 2025-06-23 19:39:55 +01:00
parent f3af522683
commit 66ce3ff503
413 changed files with 14802 additions and 0 deletions

View file

@ -0,0 +1,63 @@
[gd_resource type="BoneMap" load_steps=2 format=3 uid="uid://jsmvf7l3e2tg"]
[sub_resource type="SkeletonProfileHumanoid" id="SkeletonProfileHumanoid_eq0yh"]
[resource]
profile = SubResource("SkeletonProfileHumanoid_eq0yh")
bonemap = null
bone_map/Root = &""
bone_map/Hips = &"mixamorig_Hips"
bone_map/Spine = &"mixamorig_Spine"
bone_map/Chest = &"mixamorig_Spine1"
bone_map/UpperChest = &"mixamorig_Spine2"
bone_map/Neck = &"mixamorig_Neck"
bone_map/Head = &"mixamorig_Head"
bone_map/LeftEye = &""
bone_map/RightEye = &""
bone_map/Jaw = &""
bone_map/LeftShoulder = &"mixamorig_LeftShoulder"
bone_map/LeftUpperArm = &"mixamorig_LeftArm"
bone_map/LeftLowerArm = &"mixamorig_LeftForeArm"
bone_map/LeftHand = &"mixamorig_LeftHand"
bone_map/LeftThumbMetacarpal = &"mixamorig_LeftHandThumb2"
bone_map/LeftThumbProximal = &"mixamorig_LeftHandThumb3"
bone_map/LeftThumbDistal = &"mixamorig_LeftHandThumb4"
bone_map/LeftIndexProximal = &"mixamorig_LeftHandIndex2"
bone_map/LeftIndexIntermediate = &"mixamorig_LeftHandIndex3"
bone_map/LeftIndexDistal = &"mixamorig_LeftHandIndex4"
bone_map/LeftMiddleProximal = &"mixamorig_LeftHandMiddle2"
bone_map/LeftMiddleIntermediate = &"mixamorig_LeftHandMiddle3"
bone_map/LeftMiddleDistal = &"mixamorig_LeftHandMiddle4"
bone_map/LeftRingProximal = &"mixamorig_LeftHandRing2"
bone_map/LeftRingIntermediate = &"mixamorig_LeftHandRing3"
bone_map/LeftRingDistal = &"mixamorig_LeftHandRing4"
bone_map/LeftLittleProximal = &"mixamorig_LeftHandPinky2"
bone_map/LeftLittleIntermediate = &"mixamorig_LeftHandPinky3"
bone_map/LeftLittleDistal = &"mixamorig_LeftHandPinky4"
bone_map/RightShoulder = &"mixamorig_RightShoulder"
bone_map/RightUpperArm = &"mixamorig_RightArm"
bone_map/RightLowerArm = &"mixamorig_RightForeArm"
bone_map/RightHand = &"mixamorig_RightHand"
bone_map/RightThumbMetacarpal = &"mixamorig_RightHandThumb2"
bone_map/RightThumbProximal = &"mixamorig_RightHandThumb3"
bone_map/RightThumbDistal = &"mixamorig_RightHandThumb4"
bone_map/RightIndexProximal = &"mixamorig_RightHandIndex2"
bone_map/RightIndexIntermediate = &"mixamorig_RightHandIndex3"
bone_map/RightIndexDistal = &"mixamorig_RightHandIndex4"
bone_map/RightMiddleProximal = &"mixamorig_RightHandMiddle2"
bone_map/RightMiddleIntermediate = &"mixamorig_RightHandMiddle3"
bone_map/RightMiddleDistal = &"mixamorig_RightHandMiddle4"
bone_map/RightRingProximal = &"mixamorig_RightHandRing2"
bone_map/RightRingIntermediate = &"mixamorig_RightHandRing3"
bone_map/RightRingDistal = &"mixamorig_RightHandRing4"
bone_map/RightLittleProximal = &"mixamorig_RightHandPinky2"
bone_map/RightLittleIntermediate = &"mixamorig_RightHandPinky3"
bone_map/RightLittleDistal = &"mixamorig_RightHandPinky4"
bone_map/LeftUpperLeg = &"mixamorig_LeftUpLeg"
bone_map/LeftLowerLeg = &"mixamorig_LeftLeg"
bone_map/LeftFoot = &"mixamorig_LeftFoot"
bone_map/LeftToes = &"mixamorig_LeftToeBase"
bone_map/RightUpperLeg = &"mixamorig_RightUpLeg"
bone_map/RightLowerLeg = &"mixamorig_RightLeg"
bone_map/RightFoot = &"mixamorig_RightFoot"
bone_map/RightToes = &"mixamorig_RightToeBase"

Binary file not shown.

View file

@ -0,0 +1,43 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://cpfj1pxueabmh"
path="res://.godot/imported/YbotPacked.glb-130f94c236840a667089df3d8e3daf02.scn"
[deps]
source_file="res://Common/animations/YbotPacked.glb"
dest_files=["res://.godot/imported/YbotPacked.glb-130f94c236840a667089df3d8e3daf02.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=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"nodes": {
"PATH:Armature/Skeleton3D": {
"retarget/bone_map": Resource("res://common/animations/Mixamo BoneMap.tres")
}
}
}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

View file

@ -0,0 +1,90 @@
shader_type spatial;
render_mode unshaded;
uniform sampler2D screen_texture : source_color, hint_screen_texture, filter_nearest;
uniform sampler2D depth_texture : source_color, hint_depth_texture, filter_nearest;
uniform sampler2D normal_texture : source_color, hint_normal_roughness_texture, filter_nearest;
uniform float depth_threshold : hint_range(0, 1) = 0.05;
uniform float reverse_depth_threshold : hint_range(0, 1) = 0.25;
uniform float normal_threshold : hint_range(0, 1) = 0.6;
uniform float darken_amount : hint_range(0, 1, 0.01) = 0.3;
uniform float lighten_amount : hint_range(0, 10, 0.01) = 1.5;
uniform vec3 normal_edge_bias = vec3(1, 1, 1);
uniform vec3 light_direction = vec3(-0.96, -0.18, 0.2);
float get_depth(vec2 screen_uv, mat4 inv_projection_matrix) {
float depth = texture(depth_texture, screen_uv).r;
vec3 ndc = vec3(screen_uv * 2.0 - 1.0, depth);
vec4 view = inv_projection_matrix * vec4(ndc, 1.0);
view.xyz /= view.w;
return -view.z;
}
void vertex() {
POSITION = vec4(VERTEX.xy, 1.0, 1.0);
}
void fragment() {
float depth = get_depth(SCREEN_UV, INV_PROJECTION_MATRIX);
vec3 normal = texture(normal_texture, SCREEN_UV).xyz * 2.0 - 1.0;
vec2 texel_size = 1.0 / VIEWPORT_SIZE.xy;
vec2 uvs[4];
uvs[0] = vec2(SCREEN_UV.x, min(1.0 - 0.001, SCREEN_UV.y + texel_size.y));
uvs[1] = vec2(SCREEN_UV.x, max(0.0, SCREEN_UV.y - texel_size.y));
uvs[2] = vec2(min(1.0 - 0.001, SCREEN_UV.x + texel_size.x), SCREEN_UV.y);
uvs[3] = vec2(max(0.0, SCREEN_UV.x - texel_size.x), SCREEN_UV.y);
float depth_diff = 0.0;
float depth_diff_reversed = 0.0;
float nearest_depth = depth;
vec2 nearest_uv = SCREEN_UV;
float normal_sum = 0.0;
for (int i = 0; i < 4; i++) {
float d = get_depth(uvs[i], INV_PROJECTION_MATRIX);
depth_diff += depth - d;
depth_diff_reversed += d - depth;
if (d < nearest_depth) {
nearest_depth = d;
nearest_uv = uvs[i];
}
vec3 n = texture(normal_texture, uvs[i]).xyz * 2.0 - 1.0;
vec3 normal_diff = normal - n;
// Edge pixels should yield to the normal closest to the bias direction
float normal_bias_diff = dot(normal_diff, normal_edge_bias);
float normal_indicator = smoothstep(-0.01, 0.01, normal_bias_diff);
normal_sum += dot(normal_diff, normal_diff) * normal_indicator;
}
float depth_edge = step(depth_threshold, depth_diff);
// The reverse depth sum produces depth lines inside of the object, but they don't look as nice as the normal depth_diff
// Instead, we can use this value to mask the normal edge along the outside of the object
float reverse_depth_edge = step(reverse_depth_threshold, depth_diff_reversed);
float indicator = sqrt(normal_sum);
float normal_edge = step(normal_threshold, indicator - reverse_depth_edge);
vec3 original = texture(screen_texture, SCREEN_UV).rgb;
vec3 nearest = texture(screen_texture, nearest_uv).rgb;
mat3 view_to_world_normal_mat = mat3(
INV_VIEW_MATRIX[0].xyz,
INV_VIEW_MATRIX[1].xyz,
INV_VIEW_MATRIX[2].xyz
);
float ld = dot((view_to_world_normal_mat * normal), normalize(light_direction));
vec3 depth_col = nearest * darken_amount;
vec3 normal_col = original * (ld > 0.0 ? darken_amount : lighten_amount);
vec3 edge_mix = mix(normal_col, depth_col, depth_edge);
ALBEDO = mix(original, edge_mix, (depth_edge > 0.0 ? depth_edge : normal_edge));
}

View file

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

View file

@ -0,0 +1,43 @@
[gd_scene load_steps=7 format=3 uid="uid://bwcevwwphdvq"]
[ext_resource type="Script" uid="uid://bq7hia2dit80y" path="res://Entities/GroundTile/ground_tile.gd" id="1_uwxqs"]
[ext_resource type="PackedScene" uid="uid://ckesk3bs6g7tt" path="res://Stages/Test3D/assets/fish.glb" id="2_h4g11"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oqd8f"]
albedo_color = Color(0.171, 0.57, 0.24415, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_oqd8f"]
[sub_resource type="BoxShape3D" id="BoxShape3D_h4g11"]
size = Vector3(2, 2, 2)
[sub_resource type="ViewportTexture" id="ViewportTexture_h4g11"]
viewport_path = NodePath("DebugText")
[node name="GroundTile" type="Node3D"]
script = ExtResource("1_uwxqs")
[node name="Ground" type="MeshInstance3D" parent="."]
material_override = SubResource("StandardMaterial3D_oqd8f")
mesh = SubResource("PlaneMesh_oqd8f")
[node name="GroundCollision" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="GroundCollision"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
shape = SubResource("BoxShape3D_h4g11")
[node name="fish2" parent="." instance=ExtResource("2_h4g11")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00713956, 0, 0.0313604)
[node name="DebugText" type="SubViewport" parent="."]
size = Vector2i(50, 50)
[node name="DebugTextLabel" type="Label" parent="DebugText"]
offset_right = 40.0
offset_bottom = 23.0
text = "Hello world"
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0939356)
texture = SubResource("ViewportTexture_h4g11")

View file

@ -0,0 +1,26 @@
extends Node3D
@onready var debug_text: Label = $DebugText/DebugTextLabel
var grid_x: int
var grid_z: int
var cell_info: CellDataResource
func _ready() -> void:
if cell_info != null:
update_text_label()
func set_grid_location(x, z) -> void:
grid_x = x
grid_z = z
cell_info = MapData.get_map_data(grid_x, grid_z)
var debug_dict = {}
if cell_info.get_script():
var script_properties = cell_info.get_script().get_script_property_list()
for prop in script_properties:
debug_dict[prop.name] = cell_info.get(prop.name)
Log.pr(debug_dict)
func update_text_label() -> void:
debug_text.text = str(grid_x) + ', ' + str(grid_z) + ', ' + str(cell_info.cell_seed)

View file

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

591
Entities/Player/Player.tscn Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -0,0 +1,53 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b8eo2wxpmpsn3"
path="res://.godot/imported/PlayerCharacter.glb-4183cc8dd55ffc9d207c3c8910d89126.scn"
[deps]
source_file="res://Entities/Player/assets/PlayerCharacter.glb"
dest_files=["res://.godot/imported/PlayerCharacter.glb-4183cc8dd55ffc9d207c3c8910d89126.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=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"meshes": {
"PlayerCharacter_mergedBlocksmesh": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"save_to_file/enabled": true,
"save_to_file/path": ""
}
},
"nodes": {
"PATH:Armature/Skeleton3D": {
"retarget/bone_map": Resource("res://common/animations/Mixamo BoneMap.tres")
}
}
}
gltf/naming_version=1
gltf/embedded_image_handling=1

View file

@ -0,0 +1,51 @@
extends CharacterBody3D
@export var speed = 2
@export var fall_acceleration = 75
var target_velocity = Vector3.ZERO
func _ready() -> void:
position = Vector3.ZERO
func _physics_process(delta):
%MultiMesh3D.set("instance_shader_parameters/player_position", position)
%TileGround.update_chunks(position)
# We create a local variable to store the input direction.
var direction = Vector3.ZERO
# We check for each move input and update the direction accordingly.
if Input.is_action_pressed("move_right"):
direction.x += 1
if Input.is_action_pressed("move_left"):
direction.x -= 1
if Input.is_action_pressed("move_back"):
# Notice how we are working with the vector's x and z axes.
# In 3D, the XZ plane is the ground plane.
direction.z += 1
if Input.is_action_pressed("move_forward"):
direction.z -= 1
if direction != Vector3.ZERO:
direction = direction.normalized()
# Setting the basis property will affect the rotation of the node.
$Pivot.basis = Basis.looking_at(-direction)
# Ground Velocity
target_velocity.x = direction.x * speed
target_velocity.z = direction.z * speed
# Vertical Velocity
if not is_on_floor(): # If in the air, fall towards the floor. Literally gravity
target_velocity.y = target_velocity.y - (fall_acceleration * delta)
# Moving the Character
velocity = target_velocity
if direction != Vector3.ZERO:
%PlayerAnimationPlayer.play('basic-movement/walk')
else:
%PlayerAnimationPlayer.play('basic-movement/idle')
move_and_slide()

View file

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

View file

@ -0,0 +1,11 @@
class_name CellDataResource
extends Resource
@export var cell_seed: int = randi()
@export var x: int = 0
@export var z: int = 0
@export var vegetation_density: float = 0.5
@export var ground_compaction: float = 0.0
@export var water: float = 0
@export var moisture_level: float = 0.6

View file

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

View file

@ -0,0 +1,47 @@
class_name MapDataClass
extends Node
var map_data: Array
var cell_data: CellDataResource
func _init() -> void:
map_data.resize(500) # First resize the main array
for y in range(500):
map_data[y] = []
map_data[y].resize(500)
func _ready() -> void:
Log.pr('MapData class ready...')
func setup_cell_data(x, z, density, path = false, water = false):
var cell_data_res = CellDataResource.new()
cell_data_res.x = x
cell_data_res.z = z
if path or water:
cell_data_res.vegetation_density = 0
else:
cell_data_res.vegetation_density = density
if path:
cell_data_res.ground_compaction = 1
# Set water level
if water:
cell_data_res.water = 100
cell_data_res.moisture_level = 100
map_data[x][z] = cell_data_res
func get_map_data(x, z) -> CellDataResource:
if x < map_data.size() and x >= 0:
if z < map_data[x].size() and z >= 0:
return map_data[x][z]
else:
Log.pr("Z index out of bounds")
else:
Log.pr("X index out of bounds")
return CellDataResource.new()

View file

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

View file

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

View file

@ -0,0 +1,715 @@
class_name MapGenerationClass
extends Node
# Map settings
@export var map_width: int = 500
@export var map_height: int = 500
# Path generation settings
@export var num_horizontal_paths: int = 3
@export var num_vertical_paths: int = 2
@export var path_wander_strength: float = 0.3 # How much paths can deviate (0-1)
@export var path_smoothing_passes: int = 2 # Number of smoothing iterations
@export var branch_probability: float = 0.6 # Chance of creating branches (0-1)
@export var max_branches_per_path: int = 3 # Maximum branches per main path
@export var dead_end_probability: float = 0.3 # Chance for branches to be dead ends (0-1)
@export var min_branch_length_ratio: float = 0.2 # Minimum branch length as ratio of main path
@export var max_branch_length_ratio: float = 0.4 # Maximum branch length as ratio of main path
# Water generation settings
@export var num_water_bodies: int = 5 # Number of water bodies to generate
@export var min_water_size: int = 15 # Minimum radius of water bodies
@export var max_water_size: int = 34 # Maximum radius of water bodies
@export var water_placement_attempts: int = 50 # Max attempts to place each water body
# Image export settings
@export var tile_size: int = 8 # Size of each tile in pixels (square)
@export var export_image: bool = true # Whether to export image
@export var image_filename: String = "generated_map.png" # Output filename
var noise: FastNoiseLite
var map: Array = []
var map_data: Array = []
var path_data: Array = [] # Separate array to track paths
var water_data: Array = [] # Separate array to track water bodies
# New data structures for enhanced path generation
var path_segments: Array = [] # Store all path segments for better branching
var path_id_counter: int = 0
func _ready():
pass
generate_map()
generate_paths()
generate_water_bodies()
generate_final_map_data()
#print_visual_map_to_console()
#if export_image:
# export_map_as_image()
func generate_final_map_data():
for y in range(map_height):
for x in range(map_width):
MapData.setup_cell_data(y, x, map_data[y][x], is_path_at(x, y), is_water_at(x, y))
func generate_map():
# Initialize noise
noise = FastNoiseLite.new()
noise.seed = randi()
noise.frequency = 0.01
noise.noise_type = FastNoiseLite.TYPE_SIMPLEX_SMOOTH
# Fractal settings for organic paths
noise.fractal_type = FastNoiseLite.FRACTAL_RIDGED
noise.fractal_octaves = 2
noise.fractal_lacunarity = 4.0
noise.fractal_gain = 0.2
noise.fractal_weighted_strength = 1
noise.fractal_ping_pong_strength = 2.0
# Domain warp for natural winding
noise.domain_warp_enabled = true
noise.domain_warp_type = FastNoiseLite.DOMAIN_WARP_BASIC_GRID
noise.domain_warp_amplitude = 20
noise.domain_warp_frequency = 0.01
# Generate map data
map_data.resize(map_height)
path_data.resize(map_height)
water_data.resize(map_height)
for y in range(map_height):
map_data[y] = []
path_data[y] = []
water_data[y] = []
map_data[y].resize(map_width)
path_data[y].resize(map_width)
water_data[y].resize(map_width)
for x in range(map_width):
# Get noise value (-1 to 1) and normalize to (0 to 1)
var noise_value = noise.get_noise_2d(x, y)
var normalized_value = (noise_value + 1.0) / 2.0
map_data[y][x] = round(normalized_value * 10.0) / 10.0
path_data[y][x] = false # Initialize path data
water_data[y][x] = false # Initialize water data
func generate_paths():
print("Generating natural paths with branching...")
path_segments.clear()
path_id_counter = 0
# Generate main organic paths
for i in range(num_horizontal_paths):
generate_main_path(i, "horizontal")
for i in range(num_vertical_paths):
generate_main_path(i, "vertical")
# Generate branches for existing paths
generate_path_branches()
# Smooth and connect paths
smooth_paths()
func generate_main_path(path_index: int, direction: String):
var path_points = []
# Set up start and end points based on direction
var start_point: Vector2
var end_point: Vector2
if direction == "horizontal":
# Horizontal paths go from left edge to right edge
var y_pos = (map_height / (num_horizontal_paths + 1)) * (path_index + 1)
y_pos += randi_range(-map_height / 8, map_height / 8) # Add some vertical variation
start_point = Vector2(0, clamp(y_pos, 5, map_height - 5))
end_point = Vector2(map_width - 1, clamp(y_pos + randi_range(-map_height / 4, map_height / 4), 5, map_height - 5))
else:
# Vertical paths go from top edge to bottom edge
var x_pos = (map_width / (num_vertical_paths + 1)) * (path_index + 1)
x_pos += randi_range(-map_width / 8, map_width / 8) # Add some horizontal variation
start_point = Vector2(clamp(x_pos, 5, map_width - 5), 0)
end_point = Vector2(clamp(x_pos + randi_range(-map_width / 4, map_width / 4), 5, map_width - 5), map_height - 1)
# Generate control points for smooth curves
var control_points = [start_point]
# Add several intermediate control points for natural curves
var num_control_points = randi_range(3, 6)
for i in range(1, num_control_points):
var t = float(i) / float(num_control_points)
# Interpolate between start and end
var base_point = start_point.lerp(end_point, t)
# Add random offset for natural wandering
var max_offset = min(map_width, map_height) * 0.3 * path_wander_strength
var offset = Vector2(
randf_range(-max_offset, max_offset),
randf_range(-max_offset, max_offset)
)
var control_point = base_point + offset
control_point.x = clamp(control_point.x, 0, map_width - 1)
control_point.y = clamp(control_point.y, 0, map_height - 1)
control_points.append(control_point)
control_points.append(end_point)
# Create main path and store segment info
var path_id = path_id_counter
path_id_counter += 1
var segment_info = {
"id": path_id,
"type": "main",
"direction": direction,
"control_points": control_points,
"parent_id": - 1,
"branch_points": [] # Points where branches can spawn
}
path_segments.append(segment_info)
create_spline_path(control_points, path_id, true) # true = is_main_path
func generate_path_branches():
print("Generating path branches...")
# Create branches for each main path
for segment in path_segments:
if segment.type == "main":
generate_branches_for_segment(segment)
func generate_branches_for_segment(main_segment: Dictionary):
var num_branches = 0
var max_attempts = 5
# Try to create branches up to the maximum allowed
while num_branches < max_branches_per_path and max_attempts > 0:
max_attempts -= 1
if randf() < branch_probability:
create_branch_from_segment(main_segment, num_branches)
num_branches += 1
func create_branch_from_segment(parent_segment: Dictionary, branch_index: int):
# Pick a random point along the parent path to branch from
var branch_start_t = randf_range(0.2, 0.8) # Don't branch too close to ends
var branch_start_point = evaluate_catmull_rom_spline(parent_segment.control_points, branch_start_t)
# Determine branch direction based on parent direction and some randomness
var branch_direction = get_branch_direction(parent_segment.direction, branch_start_point)
# Calculate branch length
var main_path_length = estimate_path_length(parent_segment.control_points)
var branch_length_ratio = randf_range(min_branch_length_ratio, max_branch_length_ratio)
var target_branch_length = main_path_length * branch_length_ratio
# Determine if this should be a dead end
var is_dead_end = randf() < dead_end_probability
# Generate branch end point
var branch_end_point: Vector2
if is_dead_end:
# Dead end - create a point that doesn't reach map edge
branch_end_point = create_dead_end_point(branch_start_point, branch_direction, target_branch_length)
else:
# Through branch - try to reach map edge or connect to another path
branch_end_point = create_through_branch_point(branch_start_point, branch_direction, target_branch_length)
# Generate branch control points
var branch_control_points = generate_branch_control_points(branch_start_point, branch_end_point, branch_direction)
# Create the branch
var branch_id = path_id_counter
path_id_counter += 1
var branch_segment = {
"id": branch_id,
"type": "branch",
"direction": branch_direction,
"control_points": branch_control_points,
"parent_id": parent_segment.id,
"is_dead_end": is_dead_end
}
path_segments.append(branch_segment)
create_spline_path(branch_control_points, branch_id, false) # false = not main path
func get_branch_direction(parent_direction: String, branch_point: Vector2) -> String:
# Determine branch direction based on parent and position
var directions = []
if parent_direction == "horizontal":
directions = ["north", "south"]
# Add some bias based on position
if branch_point.y < map_height * 0.3:
directions.append("south") # Bias toward south if in upper area
elif branch_point.y > map_height * 0.7:
directions.append("north") # Bias toward north if in lower area
else: # vertical
directions = ["east", "west"]
# Add some bias based on position
if branch_point.x < map_width * 0.3:
directions.append("east") # Bias toward east if in left area
elif branch_point.x > map_width * 0.7:
directions.append("west") # Bias toward west if in right area
return directions[randi() % directions.size()]
func create_dead_end_point(start_point: Vector2, direction: String, target_length: float) -> Vector2:
# Create a point for a dead end that doesn't reach the map edge
var direction_vector = get_direction_vector(direction)
var max_distance = target_length * randf_range(0.5, 0.9) # Dead ends are shorter
# Add some randomness to the direction
var angle_variation = randf_range(-PI / 4, PI / 4) # ±45 degrees
direction_vector = direction_vector.rotated(angle_variation)
var end_point = start_point + direction_vector * max_distance
# Ensure the end point stays within map bounds with some margin
var margin = 20
end_point.x = clamp(end_point.x, margin, map_width - margin)
end_point.y = clamp(end_point.y, margin, map_height - margin)
return end_point
func create_through_branch_point(start_point: Vector2, direction: String, target_length: float) -> Vector2:
# Create a point that tries to reach toward a map edge
var direction_vector = get_direction_vector(direction)
# Add some wandering to make it more natural
var angle_variation = randf_range(-PI / 6, PI / 6) # ±30 degrees
direction_vector = direction_vector.rotated(angle_variation)
var end_point = start_point + direction_vector * target_length
# Try to reach toward the appropriate map edge
match direction:
"north":
end_point.y = max(5, end_point.y)
"south":
end_point.y = min(map_height - 5, end_point.y)
"east":
end_point.x = min(map_width - 5, end_point.x)
"west":
end_point.x = max(5, end_point.x)
# Clamp to map bounds
end_point.x = clamp(end_point.x, 5, map_width - 5)
end_point.y = clamp(end_point.y, 5, map_height - 5)
return end_point
func get_direction_vector(direction: String) -> Vector2:
match direction:
"north":
return Vector2(0, -1)
"south":
return Vector2(0, 1)
"east":
return Vector2(1, 0)
"west":
return Vector2(-1, 0)
_:
return Vector2(0, 1) # Default to south
func generate_branch_control_points(start_point: Vector2, end_point: Vector2, direction: String) -> Array:
var control_points = [start_point]
# Add fewer control points for branches to make them simpler
var num_control_points = randi_range(2, 4)
for i in range(1, num_control_points):
var t = float(i) / float(num_control_points)
var base_point = start_point.lerp(end_point, t)
# Less wandering for branches
var max_offset = min(map_width, map_height) * 0.15 * path_wander_strength
var offset = Vector2(
randf_range(-max_offset, max_offset),
randf_range(-max_offset, max_offset)
)
var control_point = base_point + offset
control_point.x = clamp(control_point.x, 0, map_width - 1)
control_point.y = clamp(control_point.y, 0, map_height - 1)
control_points.append(control_point)
control_points.append(end_point)
return control_points
func estimate_path_length(control_points: Array) -> float:
# Rough estimate of path length for branch sizing
var total_length = 0.0
for i in range(control_points.size() - 1):
total_length += control_points[i].distance_to(control_points[i + 1])
return total_length
func create_spline_path(control_points: Array, path_id: int, is_main_path: bool = false):
# Create a smooth path using Catmull-Rom spline interpolation
var path_resolution = max(map_width, map_height) * 2 # High resolution for smooth curves
# Reduce resolution for branches to make them less dense
if not is_main_path:
path_resolution = int(path_resolution * 0.7)
for i in range(path_resolution):
var t = float(i) / float(path_resolution - 1)
var point = evaluate_catmull_rom_spline(control_points, t)
# Place path segments along the spline
var x = int(round(point.x))
var y = int(round(point.y))
if x >= 0 and x < map_width and y >= 0 and y < map_height:
place_organic_path_segment(x, y, path_id, is_main_path)
func evaluate_catmull_rom_spline(points: Array, t: float) -> Vector2:
var n = points.size()
if n < 2:
return points[0] if n > 0 else Vector2.ZERO
# Handle edge cases
if t <= 0.0:
return points[0]
if t >= 1.0:
return points[n - 1]
# Find the segment
var segment_length = 1.0 / float(n - 1)
var segment_index = int(t / segment_length)
segment_index = clamp(segment_index, 0, n - 2)
# Local t within the segment
var local_t = (t - segment_index * segment_length) / segment_length
# Get control points (with clamping for edge segments)
var p0 = points[max(0, segment_index - 1)]
var p1 = points[segment_index]
var p2 = points[min(n - 1, segment_index + 1)]
var p3 = points[min(n - 1, segment_index + 2)]
# Catmull-Rom spline interpolation
var t2 = local_t * local_t
var t3 = t2 * local_t
var result = Vector2.ZERO
result += p0 * (-0.5 * t3 + t2 - 0.5 * local_t)
result += p1 * (1.5 * t3 - 2.5 * t2 + 1.0)
result += p2 * (-1.5 * t3 + 2.0 * t2 + 0.5 * local_t)
result += p3 * (0.5 * t3 - 0.5 * t2)
return result
func place_organic_path_segment(x: int, y: int, path_id: int, is_main_path: bool = false):
# Base path placement - always place the center tile
path_data[y][x] = true
if is_main_path:
# Main paths can be wider (2-3 tiles)
var width_noise = FastNoiseLite.new()
width_noise.seed = randi() + path_id * 5000
width_noise.frequency = 0.1
width_noise.noise_type = FastNoiseLite.TYPE_SIMPLEX_SMOOTH
# Add organic width variation for main paths only
var width_value = width_noise.get_noise_2d(x, y)
var base_width = 1 + int((width_value + 1.0) * 1.0) # Width 1-3 tiles for main paths
var path_width = max(1, base_width)
# Place path tiles in organic pattern around the center for main paths
for dy in range(-path_width, path_width + 1):
for dx in range(-path_width, path_width + 1):
var distance = sqrt(dx * dx + dy * dy)
if distance <= path_width:
var nx = x + dx
var ny = y + dy
if nx >= 0 and nx < map_width and ny >= 0 and ny < map_height:
# Use noise to create organic edges
var edge_noise = width_noise.get_noise_2d(nx, ny)
var edge_chance = 1.0 - (distance / float(path_width))
edge_chance += edge_noise * 0.3
if edge_chance > 0.4:
path_data[ny][nx] = true
# For branches (is_main_path = false), only the center tile is placed above
func smooth_paths():
# Apply smoothing passes to make paths more natural
for pass_num in range(path_smoothing_passes):
var new_path_data = path_data.duplicate(true)
for y in range(1, map_height - 1):
for x in range(1, map_width - 1):
if path_data[y][x]:
# Check neighbors and potentially expand path
var neighbor_count = 0
for dy in range(-1, 2):
for dx in range(-1, 2):
if dx == 0 and dy == 0:
continue
if path_data[y + dy][x + dx]:
neighbor_count += 1
# If isolated path point, try to connect it
if neighbor_count < 2 and randf() > 0.5:
# Find nearest path point and create connection
for radius in range(1, 4):
var connected = false
for dy in range(-radius, radius + 1):
for dx in range(-radius, radius + 1):
var ny = y + dy
var nx = x + dx
if ny >= 0 and ny < map_height and nx >= 0 and nx < map_width:
if path_data[ny][nx] and (abs(dx) + abs(dy)) <= radius:
# Create connection
var steps = max(abs(dx), abs(dy))
for step in range(steps + 1):
var interp_x = x + int(float(dx * step) / float(steps))
var interp_y = y + int(float(dy * step) / float(steps))
if interp_x >= 0 and interp_x < map_width and interp_y >= 0 and interp_y < map_height:
new_path_data[interp_y][interp_x] = true
connected = true
break
if connected:
break
if connected:
break
path_data = new_path_data
func generate_water_bodies():
print("Generating water bodies...")
for i in range(num_water_bodies):
generate_single_water_body(i)
func generate_single_water_body(body_index: int):
var attempts = 0
var placed = false
while attempts < water_placement_attempts and not placed:
# Random center position
var center_x = randi_range(max_water_size, map_width - max_water_size)
var center_y = randi_range(max_water_size, map_height - max_water_size)
# Random size within configured range
var water_radius = randi_range(min_water_size, max_water_size)
# Check if this location is valid (no paths in the area)
if is_valid_water_location(center_x, center_y, water_radius):
place_water_body(center_x, center_y, water_radius, body_index)
placed = true
print("Water body ", body_index + 1, " placed at (", center_x, ",", center_y, ") with radius ", water_radius)
attempts += 1
if not placed:
print("Could not place water body ", body_index + 1, " after ", water_placement_attempts, " attempts")
func is_valid_water_location(center_x: int, center_y: int, radius: int) -> bool:
# Check if any paths would be intersected by this water body
# Use a slightly larger radius for safety buffer
var safety_buffer = 2
var check_radius = radius + safety_buffer
for y in range(center_y - check_radius, center_y + check_radius + 1):
for x in range(center_x - check_radius, center_x + check_radius + 1):
if x >= 0 and x < map_width and y >= 0 and y < map_height:
# Check if this position has a path
if path_data[y][x]:
var distance = sqrt(pow(x - center_x, 2) + pow(y - center_y, 2))
if distance <= check_radius:
return false
# Also check if there's already water here (prevent overlap)
if water_data[y][x]:
var distance = sqrt(pow(x - center_x, 2) + pow(y - center_y, 2))
if distance <= check_radius:
return false
return true
func place_water_body(center_x: int, center_y: int, radius: int, body_index: int):
# Simple approach: start with basic circle, then use noise to make edges organic
var water_noise = FastNoiseLite.new()
water_noise.seed = randi() + body_index * 3000
water_noise.frequency = 0.1
water_noise.noise_type = FastNoiseLite.TYPE_SIMPLEX_SMOOTH
# Place water in roughly circular area with noise-modified edges
for y in range(center_y - radius - 2, center_y + radius + 3):
for x in range(center_x - radius - 2, center_x + radius + 3):
if x >= 0 and x < map_width and y >= 0 and y < map_height:
if path_data[y][x]: # Don't place water on paths
continue
# Calculate distance from center
var distance = sqrt(pow(x - center_x, 2) + pow(y - center_y, 2))
# Use noise to modify the effective radius at this position
var noise_value = water_noise.get_noise_2d(x, y)
var radius_modifier = noise_value * radius * 0.4 # 40% variation
var effective_radius = radius + radius_modifier
# Place water if within the noise-modified radius
if distance <= effective_radius:
water_data[y][x] = true
func print_visual_map_to_console():
print("")
print("==================================================")
print("VISUAL MAP WITH BRANCHING PATHS AND DEAD ENDS")
print("==================================================")
print("Path Statistics:")
print("- Total path segments: ", path_segments.size())
var main_paths = path_segments.filter(func(seg): return seg.type == "main")
var branches = path_segments.filter(func(seg): return seg.type == "branch")
var dead_ends = branches.filter(func(seg): return seg.get("is_dead_end", false))
print("- Main paths: ", main_paths.size())
print("- Branches: ", branches.size())
print("- Dead ends: ", dead_ends.size())
print("")
print_block_map_with_paths_safe()
func print_block_map_with_paths_safe():
print("Block character map with paths (X = paths, W = water):")
print("")
# Print in smaller chunks
var chunk_size = 10
for chunk_start in range(0, map_height, chunk_size):
var chunk_end = min(chunk_start + chunk_size, map_height)
for y in range(chunk_start, chunk_end):
var row_string = ""
for x in range(map_width):
# Check priority: paths first, then water, then terrain
if path_data[y][x]:
row_string += "X"
elif water_data[y][x]:
row_string += "W"
else:
var value = map_data[y][x]
var block_char = get_block_character(value)
row_string += block_char
print(row_string)
# Brief pause between chunks
if chunk_end < map_height:
await get_tree().process_frame
func get_block_character(value: float) -> String:
# Use Unicode block characters for different densities
if value >= 0.8:
return "" # Full block
elif value >= 0.6:
return "" # Dark shade
elif value >= 0.4:
return "" # Medium shade
elif value >= 0.2:
return "" # Light shade
else:
return " " # Empty space
# Enhanced utility functions
func is_path_at(x: int, y: int) -> bool:
if x >= 0 and x < map_width and y >= 0 and y < map_height:
return path_data[y][x]
return false
func is_water_at(x: int, y: int) -> bool:
if x >= 0 and x < map_width and y >= 0 and y < map_height:
return water_data[y][x]
return false
func get_terrain_at(x: int, y: int) -> float:
if x >= 0 and x < map_width and y >= 0 and y < map_height:
return map_data[y][x]
return 0.0
func get_tile_type_at(x: int, y: int) -> String:
if is_path_at(x, y):
return "path"
elif is_water_at(x, y):
return "water"
else:
return "terrain"
func get_path_segments() -> Array:
return path_segments
func get_main_paths() -> Array:
return path_segments.filter(func(seg): return seg.type == "main")
func get_branches() -> Array:
return path_segments.filter(func(seg): return seg.type == "branch")
func get_dead_ends() -> Array:
var branches = get_branches()
return branches.filter(func(seg): return seg.get("is_dead_end", false))
func export_map_as_image():
print("Exporting map as image...")
# Calculate image dimensions
var image_width = map_width * tile_size
var image_height = map_height * tile_size
# Create image
var image = Image.create(image_width, image_height, false, Image.FORMAT_RGB8)
# Generate the image pixel by pixel
for map_y in range(map_height):
for map_x in range(map_width):
var color = get_tile_color(map_x, map_y)
# Fill the tile area with the color (each tile is tile_size x tile_size pixels)
for pixel_y in range(tile_size):
for pixel_x in range(tile_size):
var image_x = map_x * tile_size + pixel_x
var image_y = map_y * tile_size + pixel_y
image.set_pixel(image_x, image_y, color)
# Save the image - you can choose different locations:
var file_path = "user://" + image_filename
print("User data directory: ", OS.get_user_data_dir())
print("Saving image to: ", file_path)
var error = image.save_png(file_path)
if error == OK:
print("Map image saved successfully!")
print("Image dimensions: ", image_width, "x", image_height, " pixels")
print("Map dimensions: ", map_width, "x", map_height, " tiles")
print("Tile size: ", tile_size, "x", tile_size, " pixels per tile")
else:
print("Error saving image: ", error)
func get_tile_color(x: int, y: int) -> Color:
if is_path_at(x, y):
# Brown color for paths
return Color(0.6, 0.4, 0.2) # Brown
elif is_water_at(x, y):
# Blue color for water
return Color(0.2, 0.4, 0.8) # Blue
else:
# Terrain - dark green to light green based on height
var terrain_value = get_terrain_at(x, y)
# Create gradient from dark green to light green
# Dark green for low values, light green for high values
var dark_green = Color(0.1, 0.3, 0.1) # Dark green
var light_green = Color(0.4, 0.7, 0.3) # Light green
# Interpolate between dark and light green based on terrain value
return dark_green.lerp(light_green, terrain_value)

View file

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

View file

@ -0,0 +1,21 @@
# MIT License
Copyright © 2023-present Hugo Locurcio and contributors
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,479 @@
extends CanvasLayer
@export var fps: Label
@export var frame_time: Label
@export var frame_number: Label
@export var frame_history_total_avg: Label
@export var frame_history_total_min: Label
@export var frame_history_total_max: Label
@export var frame_history_total_last: Label
@export var frame_history_cpu_avg: Label
@export var frame_history_cpu_min: Label
@export var frame_history_cpu_max: Label
@export var frame_history_cpu_last: Label
@export var frame_history_gpu_avg: Label
@export var frame_history_gpu_min: Label
@export var frame_history_gpu_max: Label
@export var frame_history_gpu_last: Label
@export var fps_graph: Panel
@export var total_graph: Panel
@export var cpu_graph: Panel
@export var gpu_graph: Panel
@export var information: Label
@export var settings: Label
## The number of frames to keep in history for graph drawing and best/worst calculations.
## Currently, this also affects how FPS is measured.
const HISTORY_NUM_FRAMES = 150
const GRAPH_SIZE = Vector2(150, 25)
const GRAPH_MIN_FPS = 10
const GRAPH_MAX_FPS = 160
const GRAPH_MIN_FRAMETIME = 1.0 / GRAPH_MIN_FPS
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.
}
## The style to use when drawing the debug menu.
var style := Style.HIDDEN:
set(value):
style = value
match style:
Style.HIDDEN:
visible = false
Style.VISIBLE_COMPACT, Style.VISIBLE_DETAILED:
visible = true
frame_number.visible = style == Style.VISIBLE_DETAILED
$DebugMenu/VBoxContainer/FrameTimeHistory.visible = style == Style.VISIBLE_DETAILED
$DebugMenu/VBoxContainer/FPSGraph.visible = style == Style.VISIBLE_DETAILED
$DebugMenu/VBoxContainer/TotalGraph.visible = style == Style.VISIBLE_DETAILED
$DebugMenu/VBoxContainer/CPUGraph.visible = style == Style.VISIBLE_DETAILED
$DebugMenu/VBoxContainer/GPUGraph.visible = style == Style.VISIBLE_DETAILED
information.visible = style == Style.VISIBLE_DETAILED
settings.visible = style == Style.VISIBLE_DETAILED
# Value of `Time.get_ticks_usec()` on the previous frame.
var last_tick := 0
var thread := Thread.new()
## Returns the sum of all values of an array (use as a parameter to `Array.reduce()`).
var sum_func := func avg(accum: float, number: float) -> float: return accum + number
# History of the last `HISTORY_NUM_FRAMES` rendered frames.
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 frametime_avg := GRAPH_MIN_FRAMETIME
var frametime_cpu_avg := GRAPH_MAX_FRAMETIME
var frametime_gpu_avg := GRAPH_MIN_FRAMETIME
var frames_per_second := float(GRAPH_MIN_FPS)
var frame_time_gradient := Gradient.new()
func _init() -> void:
# This must be done here instead of `_ready()` to avoid having `visibility_changed` be emitted immediately.
visible = false
if not InputMap.has_action("cycle_debug_menu"):
# Create default input action if no user-defined override exists.
# We can't do it in the editor plugin's activation code as it doesn't seem to work there.
InputMap.add_action("cycle_debug_menu")
var event := InputEventKey.new()
event.keycode = KEY_F3
InputMap.action_add_event("cycle_debug_menu", event)
func _ready() -> void:
fps_graph.draw.connect(_fps_graph_draw)
total_graph.draw.connect(_total_graph_draw)
cpu_graph.draw.connect(_cpu_graph_draw)
gpu_graph.draw.connect(_gpu_graph_draw)
fps_history.resize(HISTORY_NUM_FRAMES)
frame_history_total.resize(HISTORY_NUM_FRAMES)
frame_history_cpu.resize(HISTORY_NUM_FRAMES)
frame_history_gpu.resize(HISTORY_NUM_FRAMES)
# NOTE: Both FPS and frametimes are colored following FPS logic
# (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
get_viewport().size_changed.connect(update_settings_label)
# Display loading text while information is being queried,
# in case the user toggles the full debug menu just after starting the project.
information.text = "Loading hardware information...\n\n "
settings.text = "Loading project information..."
thread.start(
func():
# Disable thread safety checks as they interfere with this add-on.
# This only affects this particular thread, not other thread instances in the project.
# See <https://github.com/godotengine/godot/pull/78000> for details.
# Use a Callable so that this can be ignored on Godot 4.0 without causing a script error
# (thread safety checks were added in Godot 4.1).
if Engine.get_version_info()["hex"] >= 0x040100:
Callable(Thread, "set_thread_safety_checks_enabled").call(false)
# Enable required time measurements to display CPU/GPU frame time information.
# These lines are time-consuming operations, so run them in a separate thread.
RenderingServer.viewport_set_measure_render_time(get_viewport().get_viewport_rid(), true)
update_information_label()
update_settings_label()
)
func _input(event: InputEvent) -> void:
if event.is_action_pressed("cycle_debug_menu"):
style = wrapi(style + 1, 0, Style.MAX) as Style
func _exit_tree() -> void:
thread.wait_to_finish()
## Update hardware information label (this can change at runtime based on window
## size and graphics settings). This is only called when the window is resized.
## To update when graphics settings are changed, the function must be called manually
## using `DebugMenu.update_settings_label()`.
func update_settings_label() -> void:
settings.text = ""
if ProjectSettings.has_setting("application/config/version"):
settings.text += "Project Version: %s\n" % ProjectSettings.get_setting("application/config/version")
var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method"))
var rendering_method_string := rendering_method
match rendering_method:
"forward_plus":
rendering_method_string = "Forward+"
"mobile":
rendering_method_string = "Forward Mobile"
"gl_compatibility":
rendering_method_string = "Compatibility"
settings.text += "Rendering Method: %s\n" % rendering_method_string
var viewport := get_viewport()
# The size of the viewport rendering, which determines which resolution 3D is rendered at.
var viewport_render_size := Vector2i()
if viewport.content_scale_mode == Window.CONTENT_SCALE_MODE_VIEWPORT:
viewport_render_size = viewport.get_visible_rect().size
settings.text += "Viewport: %d×%d, Window: %d×%d\n" % [viewport.get_visible_rect().size.x, viewport.get_visible_rect().size.y, viewport.size.x, viewport.size.y]
else:
# Window size matches viewport size.
viewport_render_size = viewport.size
settings.text += "Viewport: %d×%d\n" % [viewport.size.x, viewport.size.y]
# Display 3D settings only if relevant.
if viewport.get_camera_3d():
var scaling_3d_mode_string := "(unknown)"
match viewport.scaling_3d_mode:
Viewport.SCALING_3D_MODE_BILINEAR:
scaling_3d_mode_string = "Bilinear"
Viewport.SCALING_3D_MODE_FSR:
scaling_3d_mode_string = "FSR 1.0"
Viewport.SCALING_3D_MODE_FSR2:
scaling_3d_mode_string = "FSR 2.2"
var antialiasing_3d_string := ""
if viewport.scaling_3d_mode == Viewport.SCALING_3D_MODE_FSR2:
# The FSR2 scaling mode includes its own temporal antialiasing implementation.
antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FSR 2.2"
if viewport.scaling_3d_mode != Viewport.SCALING_3D_MODE_FSR2 and viewport.use_taa:
# Godot's own TAA is ignored when using FSR2 scaling mode, as FSR2 provides its own TAA implementation.
antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "TAA"
if viewport.msaa_3d >= Viewport.MSAA_2X:
antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "%d× MSAA" % pow(2, viewport.msaa_3d)
if viewport.screen_space_aa == Viewport.SCREEN_SPACE_AA_FXAA:
antialiasing_3d_string += (" + " if not antialiasing_3d_string.is_empty() else "") + "FXAA"
settings.text += "3D scale (%s): %d%% = %d×%d" % [
scaling_3d_mode_string,
viewport.scaling_3d_scale * 100,
viewport_render_size.x * viewport.scaling_3d_scale,
viewport_render_size.y * viewport.scaling_3d_scale,
]
if not antialiasing_3d_string.is_empty():
settings.text += "\n3D Antialiasing: %s" % antialiasing_3d_string
var environment := viewport.get_camera_3d().get_world_3d().environment
if environment:
if environment.ssr_enabled:
settings.text += "\nSSR: %d Steps" % environment.ssr_max_steps
if environment.ssao_enabled:
settings.text += "\nSSAO: On"
if environment.ssil_enabled:
settings.text += "\nSSIL: On"
if environment.sdfgi_enabled:
settings.text += "\nSDFGI: %d Cascades" % environment.sdfgi_cascades
if environment.glow_enabled:
settings.text += "\nGlow: On"
if environment.volumetric_fog_enabled:
settings.text += "\nVolumetric Fog: On"
var antialiasing_2d_string := ""
if viewport.msaa_2d >= Viewport.MSAA_2X:
antialiasing_2d_string = "%d× MSAA" % pow(2, viewport.msaa_2d)
if not antialiasing_2d_string.is_empty():
settings.text += "\n2D Antialiasing: %s" % antialiasing_2d_string
## Update hardware/software information label (this never changes at runtime).
func update_information_label() -> void:
var adapter_string := ""
# Make "NVIDIA Corporation" and "NVIDIA" be considered identical (required when using OpenGL to avoid redundancy).
if RenderingServer.get_video_adapter_vendor().trim_suffix(" Corporation") in RenderingServer.get_video_adapter_name():
# Avoid repeating vendor name before adapter name.
# Trim redundant suffix sometimes reported by NVIDIA graphics cards when using OpenGL.
adapter_string = RenderingServer.get_video_adapter_name().trim_suffix("/PCIe/SSE2")
else:
adapter_string = RenderingServer.get_video_adapter_vendor() + " - " + RenderingServer.get_video_adapter_name().trim_suffix("/PCIe/SSE2")
# Graphics driver version information isn't always availble.
var driver_info := OS.get_video_adapter_driver_info()
var driver_info_string := ""
if driver_info.size() >= 2:
driver_info_string = driver_info[1]
else:
driver_info_string = "(unknown)"
var release_string := ""
if OS.has_feature("editor"):
# Editor build (implies `debug`).
release_string = "editor"
elif OS.has_feature("debug"):
# Debug export template build.
release_string = "debug"
else:
# Release export template build.
release_string = "release"
var rendering_method := str(ProjectSettings.get_setting_with_override("rendering/renderer/rendering_method"))
var rendering_driver := str(ProjectSettings.get_setting_with_override("rendering/rendering_device/driver"))
var graphics_api_string := rendering_driver
if rendering_method != "gl_compatibility":
if rendering_driver == "d3d12":
graphics_api_string = "Direct3D 12"
elif rendering_driver == "metal":
graphics_api_string = "Metal"
elif rendering_driver == "vulkan":
if OS.has_feature("macos") or OS.has_feature("ios"):
graphics_api_string = "Vulkan via MoltenVK"
else:
graphics_api_string = "Vulkan"
else:
if rendering_driver == "opengl3_angle":
graphics_api_string = "OpenGL via ANGLE"
elif OS.has_feature("mobile") or rendering_driver == "opengl3_es":
graphics_api_string = "OpenGL ES"
elif OS.has_feature("web"):
graphics_api_string = "WebGL"
elif rendering_driver == "opengl3":
graphics_api_string = "OpenGL"
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]
)
func _fps_graph_draw() -> void:
var fps_polyline := PackedVector2Array()
fps_polyline.resize(HISTORY_NUM_FRAMES)
for fps_index in fps_history.size():
fps_polyline[fps_index] = Vector2(
remap(fps_index, 0, fps_history.size(), 0, GRAPH_SIZE.x),
remap(clampf(fps_history[fps_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
)
# Don't use antialiasing to speed up line drawing, but use a width that scales with
# viewport scale to keep the line easily readable on hiDPI displays.
fps_graph.draw_polyline(fps_polyline, frame_time_gradient.sample(remap(frames_per_second, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
func _total_graph_draw() -> void:
var total_polyline := PackedVector2Array()
total_polyline.resize(HISTORY_NUM_FRAMES)
for total_index in frame_history_total.size():
total_polyline[total_index] = Vector2(
remap(total_index, 0, frame_history_total.size(), 0, GRAPH_SIZE.x),
remap(clampf(frame_history_total[total_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
)
# Don't use antialiasing to speed up line drawing, but use a width that scales with
# viewport scale to keep the line easily readable on hiDPI displays.
total_graph.draw_polyline(total_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
func _cpu_graph_draw() -> void:
var cpu_polyline := PackedVector2Array()
cpu_polyline.resize(HISTORY_NUM_FRAMES)
for cpu_index in frame_history_cpu.size():
cpu_polyline[cpu_index] = Vector2(
remap(cpu_index, 0, frame_history_cpu.size(), 0, GRAPH_SIZE.x),
remap(clampf(frame_history_cpu[cpu_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
)
# Don't use antialiasing to speed up line drawing, but use a width that scales with
# viewport scale to keep the line easily readable on hiDPI displays.
cpu_graph.draw_polyline(cpu_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_cpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
func _gpu_graph_draw() -> void:
var gpu_polyline := PackedVector2Array()
gpu_polyline.resize(HISTORY_NUM_FRAMES)
for gpu_index in frame_history_gpu.size():
gpu_polyline[gpu_index] = Vector2(
remap(gpu_index, 0, frame_history_gpu.size(), 0, GRAPH_SIZE.x),
remap(clampf(frame_history_gpu[gpu_index], GRAPH_MIN_FPS, GRAPH_MAX_FPS), GRAPH_MIN_FPS, GRAPH_MAX_FPS, GRAPH_SIZE.y, 0.0)
)
# Don't use antialiasing to speed up line drawing, but use a width that scales with
# viewport scale to keep the line easily readable on hiDPI displays.
gpu_graph.draw_polyline(gpu_polyline, frame_time_gradient.sample(remap(1000.0 / frametime_gpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0)), 1.0)
func _process(_delta: float) -> void:
if visible:
fps_graph.queue_redraw()
total_graph.queue_redraw()
cpu_graph.queue_redraw()
gpu_graph.queue_redraw()
# Difference between the last two rendered frames in milliseconds.
var frametime := (Time.get_ticks_usec() - last_tick) * 0.001
frame_history_total.push_back(frametime)
if frame_history_total.size() > HISTORY_NUM_FRAMES:
frame_history_total.pop_front()
# Frametimes are colored following FPS logic (red = 10 FPS, yellow = 60 FPS, green = 110 FPS, cyan = 160 FPS).
# This makes the color gradient non-linear.
frametime_avg = frame_history_total.reduce(sum_func) / frame_history_total.size()
frame_history_total_avg.text = str(frametime_avg).pad_decimals(2)
frame_history_total_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_min: float = frame_history_total.min()
frame_history_total_min.text = str(frametime_min).pad_decimals(2)
frame_history_total_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_max: float = frame_history_total.max()
frame_history_total_max.text = str(frametime_max).pad_decimals(2)
frame_history_total_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
frame_history_total_last.text = str(frametime).pad_decimals(2)
frame_history_total_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var viewport_rid := get_viewport().get_viewport_rid()
var frametime_cpu := RenderingServer.viewport_get_measured_render_time_cpu(viewport_rid) + RenderingServer.get_frame_setup_time_cpu()
frame_history_cpu.push_back(frametime_cpu)
if frame_history_cpu.size() > HISTORY_NUM_FRAMES:
frame_history_cpu.pop_front()
frametime_cpu_avg = frame_history_cpu.reduce(sum_func) / frame_history_cpu.size()
frame_history_cpu_avg.text = str(frametime_cpu_avg).pad_decimals(2)
frame_history_cpu_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_cpu_min: float = frame_history_cpu.min()
frame_history_cpu_min.text = str(frametime_cpu_min).pad_decimals(2)
frame_history_cpu_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_cpu_max: float = frame_history_cpu.max()
frame_history_cpu_max.text = str(frametime_cpu_max).pad_decimals(2)
frame_history_cpu_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
frame_history_cpu_last.text = str(frametime_cpu).pad_decimals(2)
frame_history_cpu_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_cpu, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_gpu := RenderingServer.viewport_get_measured_render_time_gpu(viewport_rid)
frame_history_gpu.push_back(frametime_gpu)
if frame_history_gpu.size() > HISTORY_NUM_FRAMES:
frame_history_gpu.pop_front()
frametime_gpu_avg = frame_history_gpu.reduce(sum_func) / frame_history_gpu.size()
frame_history_gpu_avg.text = str(frametime_gpu_avg).pad_decimals(2)
frame_history_gpu_avg.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_avg, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_gpu_min: float = frame_history_gpu.min()
frame_history_gpu_min.text = str(frametime_gpu_min).pad_decimals(2)
frame_history_gpu_min.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_min, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
var frametime_gpu_max: float = frame_history_gpu.max()
frame_history_gpu_max.text = str(frametime_gpu_max).pad_decimals(2)
frame_history_gpu_max.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu_max, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
frame_history_gpu_last.text = str(frametime_gpu).pad_decimals(2)
frame_history_gpu_last.modulate = frame_time_gradient.sample(remap(1000.0 / frametime_gpu, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
frames_per_second = 1000.0 / frametime_avg
fps_history.push_back(frames_per_second)
if fps_history.size() > HISTORY_NUM_FRAMES:
fps_history.pop_front()
fps.text = str(floor(frames_per_second)) + " FPS"
var frame_time_color := frame_time_gradient.sample(remap(frames_per_second, GRAPH_MIN_FPS, GRAPH_MAX_FPS, 0.0, 1.0))
fps.modulate = frame_time_color
frame_time.text = str(frametime).pad_decimals(2) + " mspf"
frame_time.modulate = frame_time_color
var vsync_string := ""
match DisplayServer.window_get_vsync_mode():
DisplayServer.VSYNC_ENABLED:
vsync_string = "V-Sync"
DisplayServer.VSYNC_ADAPTIVE:
vsync_string = "Adaptive V-Sync"
DisplayServer.VSYNC_MAILBOX:
vsync_string = "Mailbox V-Sync"
if Engine.max_fps > 0 or OS.low_processor_usage_mode:
# Display FPS cap determined by `Engine.max_fps` or low-processor usage mode sleep duration
# (the lowest FPS cap is used).
var low_processor_max_fps := roundi(1000000.0 / OS.low_processor_usage_mode_sleep_usec)
var fps_cap := low_processor_max_fps
if Engine.max_fps > 0:
fps_cap = mini(Engine.max_fps, low_processor_max_fps)
frame_time.text += " (cap: " + str(fps_cap) + " FPS"
if not vsync_string.is_empty():
frame_time.text += " + " + vsync_string
frame_time.text += ")"
else:
if not vsync_string.is_empty():
frame_time.text += " (" + vsync_string + ")"
frame_number.text = "Frame: " + str(Engine.get_frames_drawn())
last_tick = Time.get_ticks_usec()
func _on_visibility_changed() -> void:
if visible:
# Reset graphs to prevent them from looking strange before `HISTORY_NUM_FRAMES` frames
# have been drawn.
var frametime_last := (Time.get_ticks_usec() - last_tick) * 0.001
fps_history.resize(HISTORY_NUM_FRAMES)
fps_history.fill(1000.0 / frametime_last)
frame_history_total.resize(HISTORY_NUM_FRAMES)
frame_history_total.fill(frametime_last)
frame_history_cpu.resize(HISTORY_NUM_FRAMES)
var viewport_rid := get_viewport().get_viewport_rid()
frame_history_cpu.fill(RenderingServer.viewport_get_measured_render_time_cpu(viewport_rid) + RenderingServer.get_frame_setup_time_cpu())
frame_history_gpu.resize(HISTORY_NUM_FRAMES)
frame_history_gpu.fill(RenderingServer.viewport_get_measured_render_time_gpu(viewport_rid))

View file

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

View file

@ -0,0 +1,401 @@
[gd_scene load_steps=3 format=3 uid="uid://cggqb75a8w8r"]
[ext_resource type="Script" path="res://addons/debug_menu/debug_menu.gd" id="1_p440y"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ki0n8"]
bg_color = Color(0, 0, 0, 0.25098)
[node name="CanvasLayer" type="CanvasLayer" 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")]
layer = 128
script = ExtResource("1_p440y")
fps = NodePath("DebugMenu/VBoxContainer/FPS")
frame_time = NodePath("DebugMenu/VBoxContainer/FrameTime")
frame_number = NodePath("DebugMenu/VBoxContainer/FrameNumber")
frame_history_total_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalAvg")
frame_history_total_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalMin")
frame_history_total_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalMax")
frame_history_total_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/TotalLast")
frame_history_cpu_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUAvg")
frame_history_cpu_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUMin")
frame_history_cpu_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPUMax")
frame_history_cpu_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/CPULast")
frame_history_gpu_avg = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUAvg")
frame_history_gpu_min = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUMin")
frame_history_gpu_max = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPUMax")
frame_history_gpu_last = NodePath("DebugMenu/VBoxContainer/FrameTimeHistory/GPULast")
fps_graph = NodePath("DebugMenu/VBoxContainer/FPSGraph/Graph")
total_graph = NodePath("DebugMenu/VBoxContainer/TotalGraph/Graph")
cpu_graph = NodePath("DebugMenu/VBoxContainer/CPUGraph/Graph")
gpu_graph = NodePath("DebugMenu/VBoxContainer/GPUGraph/Graph")
information = NodePath("DebugMenu/VBoxContainer/Information")
settings = NodePath("DebugMenu/VBoxContainer/Settings")
[node name="DebugMenu" type="Control" parent="."]
custom_minimum_size = Vector2(400, 400)
layout_mode = 3
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -416.0
offset_top = 8.0
offset_right = -16.0
offset_bottom = 408.0
grow_horizontal = 0
size_flags_horizontal = 8
size_flags_vertical = 4
mouse_filter = 2
[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
mouse_filter = 2
theme_override_constants/separation = 0
[node name="FPS" type="Label" parent="DebugMenu/VBoxContainer"]
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_font_sizes/font_size = 18
text = "60 FPS"
horizontal_alignment = 2
[node name="FrameTime" type="Label" parent="DebugMenu/VBoxContainer"]
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 = 3
theme_override_font_sizes/font_size = 12
text = "16.67 mspf (cap: 123 FPS + Adaptive V-Sync)"
horizontal_alignment = 2
[node name="FrameNumber" type="Label" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Frame: 1234"
horizontal_alignment = 2
[node name="FrameTimeHistory" type="GridContainer" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 8
mouse_filter = 2
theme_override_constants/h_separation = 0
theme_override_constants/v_separation = 0
columns = 5
[node name="Spacer" type="Control" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(60, 0)
layout_mode = 2
mouse_filter = 2
[node name="AvgHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Average"
horizontal_alignment = 2
[node name="MinHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Best"
horizontal_alignment = 2
[node name="MaxHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Worst"
horizontal_alignment = 2
[node name="LastHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Last"
horizontal_alignment = 2
[node name="TotalHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Total:"
horizontal_alignment = 2
[node name="TotalAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="TotalMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="TotalMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="TotalLast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="CPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "CPU:"
horizontal_alignment = 2
[node name="CPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="CPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "12.34"
horizontal_alignment = 2
[node name="CPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="CPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="GPUHeader" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "GPU:"
horizontal_alignment = 2
[node name="GPUAvg" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="GPUMin" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "1.23"
horizontal_alignment = 2
[node name="GPUMax" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="GPULast" type="Label" parent="DebugMenu/VBoxContainer/FrameTimeHistory"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "123.45"
horizontal_alignment = 2
[node name="FPSGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
alignment = 2
[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/FPSGraph"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
size_flags_horizontal = 8
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "FPS: ↑"
vertical_alignment = 1
[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/FPSGraph"]
custom_minimum_size = Vector2(150, 25)
layout_mode = 2
size_flags_vertical = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
[node name="TotalGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
alignment = 2
[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/TotalGraph"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
size_flags_horizontal = 8
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Total: ↓"
vertical_alignment = 1
[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/TotalGraph"]
custom_minimum_size = Vector2(150, 25)
layout_mode = 2
size_flags_vertical = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
[node name="CPUGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
alignment = 2
[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/CPUGraph"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
size_flags_horizontal = 8
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "CPU: ↓"
vertical_alignment = 1
[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/CPUGraph"]
custom_minimum_size = Vector2(150, 25)
layout_mode = 2
size_flags_vertical = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
[node name="GPUGraph" type="HBoxContainer" parent="DebugMenu/VBoxContainer"]
layout_mode = 2
mouse_filter = 2
alignment = 2
[node name="Title" type="Label" parent="DebugMenu/VBoxContainer/GPUGraph"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
size_flags_horizontal = 8
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "GPU: ↓"
vertical_alignment = 1
[node name="Graph" type="Panel" parent="DebugMenu/VBoxContainer/GPUGraph"]
custom_minimum_size = Vector2(150, 25)
layout_mode = 2
size_flags_vertical = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ki0n8")
[node name="Information" type="Label" parent="DebugMenu/VBoxContainer"]
modulate = Color(1, 1, 1, 0.752941)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "12th Gen Intel(R) Core(TM) i0-1234K
Windows 12 64-bit (double precision), Vulkan 1.2.34
NVIDIA GeForce RTX 1234, 123.45.67"
horizontal_alignment = 2
[node name="Settings" type="Label" parent="DebugMenu/VBoxContainer"]
modulate = Color(0.8, 0.84, 1, 0.752941)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 12
text = "Project Version: 1.2.3
Rendering Method: Forward+
Window: 1234×567, Viewport: 1234×567
3D Scale (FSR 1.0): 100% = 1234×567
3D Antialiasing: TAA + 2× MSAA + FXAA
SSR: 123 Steps
SSAO: On
SSIL: On
SDFGI: 1 Cascades
Glow: On
Volumetric Fog: On
2D Antialiasing: 2× MSAA"
horizontal_alignment = 2
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]

View file

@ -0,0 +1,7 @@
[plugin]
name="Debug Menu"
description="In-game debug menu displaying performance metrics and hardware information"
author="Calinou"
version="1.2.0"
script="plugin.gd"

View file

@ -0,0 +1,29 @@
@tool
extends EditorPlugin
func _enter_tree() -> void:
add_autoload_singleton("DebugMenu", "res://addons/debug_menu/debug_menu.tscn")
# FIXME: This appears to do nothing.
# if not ProjectSettings.has_setting("application/config/version"):
# ProjectSettings.set_setting("application/config/version", "1.0.0")
#
# ProjectSettings.set_initial_value("application/config/version", "1.0.0")
# ProjectSettings.add_property_info({
# name = "application/config/version",
# type = TYPE_STRING,
# })
#
# if not InputMap.has_action("cycle_debug_menu"):
# InputMap.add_action("cycle_debug_menu")
# var event := InputEventKey.new()
# event.keycode = KEY_F3
# InputMap.action_add_event("cycle_debug_menu", event)
#
# ProjectSettings.save()
func _exit_tree() -> void:
remove_autoload_singleton("DebugMenu")
# Don't remove the project setting's value and input map action,
# as the plugin may be re-enabled in the future.

View file

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

702
addons/log/log.gd Normal file
View file

@ -0,0 +1,702 @@
## Log.gd - colorized pretty printing functions
##
## [code]Log.pr(...)[/code] and [code]Log.prn(...)[/code] are drop-in replacements for [code]print(...)[/code].
##
## [br][br]
## You can also [code]Log.warn(...)[/code] or [code]Log.error(...)[/code] to both print and push_warn/push_error.
##
## [br][br]
## Custom object output is supported by implementing [code]to_pretty()[/code] on the object.
##
## [br][br]
## For objects you don't own (built-ins or addons you don't want to edit),
## there is a [code]register_type_overwrite(key, handler)[/code] helper.
##
## [br][br]
## You can find up to date docs and examples in the Log.gd repo and docs site:
## [br]
## - https://github.com/russmatney/log.gd
## [br]
## - https://russmatney.github.io/log.gd
##
@tool
extends Object
class_name Log
# helpers ####################################
static func assoc(opts: Dictionary, key: String, val: Variant) -> Dictionary:
var _opts: Dictionary = opts.duplicate(true)
_opts[key] = val
return _opts
# config ####################################
const KEY_PREFIX: String = "log_gd/config"
static var is_config_setup: bool = false
const KEY_COLOR_THEME: String = "%s/color_theme" % KEY_PREFIX
const KEY_DISABLE_COLORS: String = "%s/disable_colors" % KEY_PREFIX
const KEY_MAX_ARRAY_SIZE: String = "%s/max_array_size" % KEY_PREFIX
const KEY_SKIP_KEYS: String = "%s/dictionary_skip_keys" % KEY_PREFIX
static func setup_config(opts: Dictionary = {}) -> void:
var keys: Array = opts.get("keys", [
KEY_COLOR_THEME,
KEY_DISABLE_COLORS,
KEY_MAX_ARRAY_SIZE,
KEY_SKIP_KEYS,
])
for key: String in keys:
if ProjectSettings.has_setting(key):
Log.config[key] = ProjectSettings.get_setting(key)
else:
var val: Variant = Log.config[key]
if val != null:
ProjectSettings.set_setting(key, val)
ProjectSettings.set_initial_value(key, val)
Log.is_config_setup = true
static var config: Dictionary = {
KEY_COLOR_THEME: LOG_THEME_TERMSAFE,
KEY_DISABLE_COLORS: false,
KEY_MAX_ARRAY_SIZE: 20,
KEY_SKIP_KEYS: [
"layer_0/tile_data", # skip huge tilemap arrays
],
}
# config getters ###################################################################
static func get_max_array_size() -> int:
return Log.config.get(KEY_MAX_ARRAY_SIZE, 20)
static func get_dictionary_skip_keys() -> Array:
return Log.config.get(KEY_SKIP_KEYS, [])
static func get_disable_colors() -> bool:
return Log.config.get(KEY_DISABLE_COLORS, false)
static func get_config_color_theme() -> Dictionary:
var theme_id: String = Log.config.get(KEY_COLOR_THEME, LOG_THEME_TERMSAFE)
match theme_id:
LOG_THEME_TERMSAFE:
return Log.COLORS_TERMINAL_SAFE
LOG_THEME_PRETTY_DARK_V1:
return Log.COLORS_PRETTY_DARK_V1
LOG_THEME_PRETTY_LIGHT_V1:
return Log.COLORS_PRETTY_LIGHT_V1
_:
print("Unknown LOG_THEME '%s', using fallback" % theme_id)
return Log.COLORS_TERMINAL_SAFE
# config setters ###################################################################
## Disable color-wrapping output.
##
## [br][br]
## Useful to declutter the output if the environment does not support colors.
## Note that some environments support only a subset of colors - you may prefer
## [code]set_colors_termsafe()[/code] or otherwise setting the theme to 'TERMSAFE'.
static func disable_colors() -> void:
Log.config[KEY_DISABLE_COLORS] = true
## Re-enable color-wrapping output.
static func enable_colors() -> void:
Log.config[KEY_DISABLE_COLORS] = false
## DEPRECATED
static func set_color_scheme(theme: String) -> void:
set_color_theme(theme)
static func set_color_theme(theme: String) -> void:
Log.config[KEY_COLOR_THEME] = theme
## colors ###########################################################################
# terminal safe colors:
# - black
# - red
# - green
# - yellow
# - blue
# - magenta
# - pink
# - purple
# - cyan
# - white
# - orange
# - gray
const LOG_THEME_TERMSAFE: String = "TERMSAFE"
const LOG_THEME_PRETTY_DARK_V1: String = "PRETTY_V1"
const LOG_THEME_PRETTY_LIGHT_V1: String = "PRETTY_LIGHT_V1"
static var COLORS_TERMINAL_SAFE: Dictionary = {
"SRC": "cyan",
"ADDONS": "red",
"TEST": "green",
",": "red",
"(": "red",
")": "red",
"[": "red",
"]": "red",
"{": "red",
"}": "red",
"&": "orange",
"^": "orange",
"dict_key": "magenta",
"vector_value": "green",
"class_name": "magenta",
TYPE_NIL: "pink",
TYPE_BOOL: "pink",
TYPE_INT: "green",
TYPE_FLOAT: "green",
TYPE_STRING: "pink",
TYPE_VECTOR2: "green",
TYPE_VECTOR2I: "green",
TYPE_RECT2: "green",
TYPE_RECT2I: "green",
TYPE_VECTOR3: "green",
TYPE_VECTOR3I: "green",
TYPE_TRANSFORM2D: "pink",
TYPE_VECTOR4: "green",
TYPE_VECTOR4I: "green",
TYPE_PLANE: "pink",
TYPE_QUATERNION: "pink",
TYPE_AABB: "pink",
TYPE_BASIS: "pink",
TYPE_TRANSFORM3D: "pink",
TYPE_PROJECTION: "pink",
TYPE_COLOR: "pink",
TYPE_STRING_NAME: "pink",
TYPE_NODE_PATH: "pink",
TYPE_RID: "pink",
TYPE_OBJECT: "pink",
TYPE_CALLABLE: "pink",
TYPE_SIGNAL: "pink",
TYPE_DICTIONARY: "pink",
TYPE_ARRAY: "pink",
TYPE_PACKED_BYTE_ARRAY: "pink",
TYPE_PACKED_INT32_ARRAY: "pink",
TYPE_PACKED_INT64_ARRAY: "pink",
TYPE_PACKED_FLOAT32_ARRAY: "pink",
TYPE_PACKED_FLOAT64_ARRAY: "pink",
TYPE_PACKED_STRING_ARRAY: "pink",
TYPE_PACKED_VECTOR2_ARRAY: "pink",
TYPE_PACKED_VECTOR3_ARRAY: "pink",
TYPE_PACKED_COLOR_ARRAY: "pink",
TYPE_MAX: "pink",
}
static var COLORS_PRETTY_DARK_V1: Dictionary = {
"SRC": "aquamarine",
"ADDONS": "peru",
"TEST": "green_yellow",
",": "crimson",
"(": "crimson",
")": "crimson",
"[": "crimson",
"]": "crimson",
"{": "crimson",
"}": "crimson",
"&": "coral",
"^": "coral",
"dict_key": "cadet_blue",
"vector_value": "cornflower_blue",
"class_name": "cadet_blue",
TYPE_NIL: "coral",
TYPE_BOOL: "pink",
TYPE_INT: "cornflower_blue",
TYPE_FLOAT: "cornflower_blue",
TYPE_STRING: "dark_gray",
TYPE_VECTOR2: "cornflower_blue",
TYPE_VECTOR2I: "cornflower_blue",
TYPE_RECT2: "cornflower_blue",
TYPE_RECT2I: "cornflower_blue",
TYPE_VECTOR3: "cornflower_blue",
TYPE_VECTOR3I: "cornflower_blue",
TYPE_TRANSFORM2D: "pink",
TYPE_VECTOR4: "cornflower_blue",
TYPE_VECTOR4I: "cornflower_blue",
TYPE_PLANE: "pink",
TYPE_QUATERNION: "pink",
TYPE_AABB: "pink",
TYPE_BASIS: "pink",
TYPE_TRANSFORM3D: "pink",
TYPE_PROJECTION: "pink",
TYPE_COLOR: "pink",
TYPE_STRING_NAME: "pink",
TYPE_NODE_PATH: "pink",
TYPE_RID: "pink",
TYPE_OBJECT: "pink",
TYPE_CALLABLE: "pink",
TYPE_SIGNAL: "pink",
TYPE_DICTIONARY: "pink",
TYPE_ARRAY: "pink",
TYPE_PACKED_BYTE_ARRAY: "pink",
TYPE_PACKED_INT32_ARRAY: "pink",
TYPE_PACKED_INT64_ARRAY: "pink",
TYPE_PACKED_FLOAT32_ARRAY: "pink",
TYPE_PACKED_FLOAT64_ARRAY: "pink",
TYPE_PACKED_STRING_ARRAY: "pink",
TYPE_PACKED_VECTOR2_ARRAY: "pink",
TYPE_PACKED_VECTOR3_ARRAY: "pink",
TYPE_PACKED_COLOR_ARRAY: "pink",
TYPE_MAX: "pink",
}
static var COLORS_PRETTY_LIGHT_V1: Dictionary = {
"SRC": "dark_cyan",
"ADDONS": "dark_red",
"TEST": "dark_green",
",": "crimson",
"(": "crimson",
")": "crimson",
"[": "crimson",
"]": "crimson",
"{": "crimson",
"}": "crimson",
"&": "coral",
"^": "coral",
"dict_key": "dark_slate_blue",
"vector_value": "dark_orchid",
"class_name": "cadet_blue",
TYPE_NIL: "coral",
TYPE_BOOL: "dark_red",
TYPE_INT: "dark_orchid",
TYPE_FLOAT: "dark_orchid",
TYPE_STRING: "dark_red",
TYPE_VECTOR2: "cornflower_blue",
TYPE_VECTOR2I: "cornflower_blue",
TYPE_RECT2: "cornflower_blue",
TYPE_RECT2I: "cornflower_blue",
TYPE_VECTOR3: "cornflower_blue",
TYPE_VECTOR3I: "cornflower_blue",
TYPE_TRANSFORM2D: "dark_red",
TYPE_VECTOR4: "dark_orchid",
TYPE_VECTOR4I: "dark_orchid",
TYPE_PLANE: "dark_red",
TYPE_QUATERNION: "dark_red",
TYPE_AABB: "dark_red",
TYPE_BASIS: "dark_red",
TYPE_TRANSFORM3D: "dark_red",
TYPE_PROJECTION: "dark_red",
TYPE_COLOR: "dark_red",
TYPE_STRING_NAME: "dark_red",
TYPE_NODE_PATH: "dark_red",
TYPE_RID: "dark_red",
TYPE_OBJECT: "dark_red",
TYPE_CALLABLE: "dark_red",
TYPE_SIGNAL: "dark_red",
TYPE_DICTIONARY: "dark_red",
TYPE_ARRAY: "dark_red",
TYPE_PACKED_BYTE_ARRAY: "dark_red",
TYPE_PACKED_INT32_ARRAY: "dark_red",
TYPE_PACKED_INT64_ARRAY: "dark_red",
TYPE_PACKED_FLOAT32_ARRAY: "dark_red",
TYPE_PACKED_FLOAT64_ARRAY: "dark_red",
TYPE_PACKED_STRING_ARRAY: "dark_red",
TYPE_PACKED_VECTOR2_ARRAY: "dark_red",
TYPE_PACKED_VECTOR3_ARRAY: "dark_red",
TYPE_PACKED_COLOR_ARRAY: "dark_red",
TYPE_MAX: "dark_red",
}
## set color theme ####################################
## Use the terminal safe color scheme, which should handle colors in most tty-like environments.
static func set_colors_termsafe() -> void:
set_color_theme(LOG_THEME_TERMSAFE)
## Use prettier colors - looks nice in most dark godot themes.
##
## [br][br]
## Hopefully we'll support more themes (including light themes) soon!
static func set_colors_pretty() -> void:
set_color_theme(LOG_THEME_PRETTY_DARK_V1)
static var theme_overwrites: Dictionary = {}
## Merge per type color adjustments.
##
## [br][br]
## Expects a Dictionary from [code]{typeof(obj): Color}[/code].
## See [code]COLORS_TERMINAL_SAFE[/code] for an example.
static func merge_theme_overwrites(colors: Dictionary) -> void:
theme_overwrites.merge(colors, true)
static func clear_theme_overwrites() -> void:
theme_overwrites = {}
static func get_color_theme(opts: Dictionary = {}) -> Dictionary:
var theme: Dictionary = opts.get("color_theme", {})
# fill in any missing vals with the set theme, then the term-safe fallbacks
theme.merge(Log.theme_overwrites)
theme.merge(Log.get_config_color_theme())
theme.merge(Log.COLORS_TERMINAL_SAFE)
return theme
static func should_use_color(opts: Dictionary = {}) -> bool:
if Log.get_disable_colors():
return false
# supports per-print color skipping
if opts.get("disable_colors", false):
return false
return true
static func color_wrap(s: Variant, opts: Dictionary = {}) -> String:
# don't rebuild the theme every time
var colors: Dictionary = opts.get("built_color_theme", get_color_theme(opts))
if not should_use_color(opts):
return str(s)
var color: String = opts.get("color", "")
if color == "":
var s_type: Variant = opts.get("typeof", typeof(s))
if s_type is String:
# type overwrites
color = colors.get(s_type)
elif s_type is int and s_type == TYPE_STRING:
# specific strings/punctuation
var s_trimmed: String = str(s).strip_edges()
if s_trimmed in colors:
color = colors.get(s_trimmed)
else:
# fallback string color
color = colors.get(s_type)
else:
# all other types
color = colors.get(s_type)
if color == "":
print("Log.gd could not determine color for object: %s type: (%s)" % [str(s), typeof(s)])
return "[color=%s]%s[/color]" % [color, s]
## overwrites ###########################################################################
static var type_overwrites: Dictionary = {}
## Register a single type overwrite.
##
## [br][br]
## The key should be either obj.get_class() or typeof(var). (Note that using typeof(var) may overwrite more broadly than expected).
##
## [br][br]
## The handler is called with the object and an options dict.
## [code]func(obj): return {name=obj.name}[/code]
static func register_type_overwrite(key: String, handler: Callable) -> void:
# TODO warning on key exists? support multiple handlers for same type?
# validate the key/handler somehow?
type_overwrites[key] = handler
## Register a dictionary of type overwrite.
##
## [br][br]
## Expects a Dictionary like [code]{obj.get_class(): func(obj): return {key=obj.get_key()}}[/code].
##
## [br][br]
## It depends on [code]obj.get_class()[/code] then [code]typeof(obj)[/code] for the key.
## The handler is called with the object as the only argument. (e.g. [code]func(obj): return {name=obj.name}[/code]).
static func register_type_overwrites(overwrites: Dictionary) -> void:
type_overwrites.merge(overwrites, true)
static func clear_type_overwrites() -> void:
type_overwrites = {}
## to_pretty ###########################################################################
## Returns the passed object as a bb-colorized string.
##
## [br][br]
## Useful for feeding directly into a RichTextLabel, but also the core
## of Log.gd's functionality.
static func to_pretty(msg: Variant, opts: Dictionary = {}) -> String:
var newlines: bool = opts.get("newlines", false)
var indent_level: int = opts.get("indent_level", 0)
if not "indent_level" in opts:
opts["indent_level"] = indent_level
var theme: Dictionary = opts.get("built_color_theme", get_color_theme(opts))
if not "built_color_theme" in opts:
opts["built_color_theme"] = theme
if not is_instance_valid(msg) and typeof(msg) == TYPE_OBJECT:
return str("invalid instance: ", msg)
if msg == null:
return Log.color_wrap(msg, opts)
if msg is Object and (msg as Object).get_class() in type_overwrites:
var fn: Callable = type_overwrites.get((msg as Object).get_class())
return Log.to_pretty(fn.call(msg), opts)
elif typeof(msg) in type_overwrites:
var fn: Callable = type_overwrites.get(typeof(msg))
return Log.to_pretty(fn.call(msg), opts)
# objects
if msg is Object and (msg as Object).has_method("to_pretty"):
# using a cast and `call.("blah")` here it's "type safe"
return Log.to_pretty((msg as Object).call("to_pretty"), opts)
if msg is Object and (msg as Object).has_method("data"):
return Log.to_pretty((msg as Object).call("data"), opts)
# DEPRECATED
if msg is Object and (msg as Object).has_method("to_printable"):
return Log.to_pretty((msg as Object).call("to_printable"), opts)
# arrays
if msg is Array or msg is PackedStringArray:
var msg_array: Array = msg
if len(msg) > Log.get_max_array_size():
pr("[DEBUG]: truncating large array. total:", len(msg))
msg_array = msg_array.slice(0, Log.get_max_array_size() - 1)
if newlines:
msg_array.append("...")
var tmp: String = Log.color_wrap("[ ", opts)
var last: int = len(msg) - 1
for i: int in range(len(msg)):
if newlines and last > 1:
tmp += "\n\t"
tmp += Log.to_pretty(msg[i],
# duplicate here to prevent indenting-per-msg
# e.g. when printing an array of dictionaries
opts.duplicate(true))
if i != last:
tmp += Log.color_wrap(", ", opts)
tmp += Log.color_wrap(" ]", opts)
return tmp
# dictionary
elif msg is Dictionary:
var tmp: String = Log.color_wrap("{ ", opts)
var ct: int = len(msg)
var last: Variant
if len(msg) > 0:
last = (msg as Dictionary).keys()[-1]
for k: Variant in (msg as Dictionary).keys():
var val: Variant
if k in Log.get_dictionary_skip_keys():
val = "..."
else:
opts.indent_level += 1
val = Log.to_pretty(msg[k], opts)
if newlines and ct > 1:
tmp += "\n\t" \
+ range(indent_level)\
.map(func(_i: int) -> String: return "\t")\
.reduce(func(a: String, b: Variant) -> String: return str(a, b), "")
var key: String = Log.color_wrap('"%s"' % k, Log.assoc(opts, "typeof", "dict_key"))
tmp += "%s: %s" % [key, val]
if last and str(k) != str(last):
tmp += Log.color_wrap(", ", opts)
tmp += Log.color_wrap(" }", opts)
return tmp
# strings
elif msg is String:
if msg == "":
return '""'
if "[color=" in msg and "[/color]" in msg:
# assumes the string is already colorized
# NOT PERFECT! could use a regex for something more robust
return msg
return Log.color_wrap(msg, opts)
elif msg is StringName:
return str(Log.color_wrap("&", opts), '"%s"' % msg)
elif msg is NodePath:
return str(Log.color_wrap("^", opts), '"%s"' % msg)
# vectors
elif msg is Vector2 or msg is Vector2i:
return '%s%s%s%s%s' % [
Log.color_wrap("(", opts),
Log.color_wrap(msg.x, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.y, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(")", opts),
]
elif msg is Vector3 or msg is Vector3i:
return '%s%s%s%s%s%s%s' % [
Log.color_wrap("(", opts),
Log.color_wrap(msg.x, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.y, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.z, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(")", opts),
]
elif msg is Vector4 or msg is Vector4i:
return '%s%s%s%s%s%s%s%s%s' % [
Log.color_wrap("(", opts),
Log.color_wrap(msg.x, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.y, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.z, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(",", opts),
Log.color_wrap(msg.w, Log.assoc(opts, "typeof", "vector_value")),
Log.color_wrap(")", opts),
]
# packed scene
elif msg is PackedScene:
var msg_ps: PackedScene = msg
if msg_ps.resource_path != "":
return str(Log.color_wrap("PackedScene:", opts), '%s' % msg_ps.resource_path.get_file())
elif msg_ps.get_script() != null and msg_ps.get_script().resource_path != "":
var path: String = msg_ps.get_script().resource_path
return Log.color_wrap(path.get_file(), Log.assoc(opts, "typeof", "class_name"))
else:
return Log.color_wrap(msg_ps, opts)
# resource
elif msg is Resource:
var msg_res: Resource = msg
if msg_res.get_script() != null and msg_res.get_script().resource_path != "":
var path: String = msg_res.get_script().resource_path
return Log.color_wrap(path.get_file(), Log.assoc(opts, "typeof", "class_name"))
elif msg_res.resource_path != "":
var path: String = msg_res.resource_path
return str(Log.color_wrap("Resource:", opts), '%s' % path.get_file())
else:
return Log.color_wrap(msg_res, opts)
# refcounted
elif msg is RefCounted:
var msg_ref: RefCounted = msg
if msg_ref.get_script() != null and msg_ref.get_script().resource_path != "":
var path: String = msg_ref.get_script().resource_path
return Log.color_wrap(path.get_file(), Log.assoc(opts, "typeof", "class_name"))
else:
return Log.color_wrap(msg_ref.get_class(), Log.assoc(opts, "typeof", "class_name"))
# fallback to primitive-type lookup
else:
return Log.color_wrap(msg, opts)
## to_printable ###########################################################################
static func log_prefix(stack: Array) -> String:
if len(stack) > 1:
var call_site: Dictionary = stack[1]
var call_site_source: String = call_site.get("source", "")
var basename: String = call_site_source.get_file().get_basename()
var line_num: String = str(call_site.get("line", 0))
if call_site_source.match("*/test/*"):
return "{" + basename + ":" + line_num + "}: "
elif call_site_source.match("*/addons/*"):
return "<" + basename + ":" + line_num + ">: "
else:
return "[" + basename + ":" + line_num + "]: "
return ""
static func to_printable(msgs: Array, opts: Dictionary = {}) -> String:
if not Log.is_config_setup:
setup_config()
if not msgs is Array:
msgs = [msgs]
var stack: Array = opts.get("stack", [])
var pretty: bool = opts.get("pretty", true)
var m: String = ""
if len(stack) > 0:
var prefix: String = Log.log_prefix(stack)
var prefix_type: String
if prefix != null and prefix[0] == "[":
prefix_type = "SRC"
elif prefix != null and prefix[0] == "{":
prefix_type = "TEST"
elif prefix != null and prefix[0] == "<":
prefix_type = "ADDONS"
if pretty:
m += Log.color_wrap(prefix, Log.assoc(opts, "typeof", prefix_type))
else:
m += prefix
for msg: Variant in msgs:
# add a space between msgs
if pretty:
m += "%s " % Log.to_pretty(msg, opts)
else:
m += "%s " % str(msg)
return m.trim_suffix(" ")
## public print fns ###########################################################################
static func is_not_default(v: Variant) -> bool:
return not v is String or (v is String and v != "ZZZDEF")
## Pretty-print the passed arguments in a single line.
static func pr(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var m: String = Log.to_printable(msgs, {stack=get_stack()})
print_rich(m)
## Pretty-print the passed arguments in a single line.
static func info(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var m: String = Log.to_printable(msgs, {stack=get_stack()})
print_rich(m)
## Pretty-print the passed arguments in a single line.
static func log(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var m: String = Log.to_printable(msgs, {stack=get_stack()})
print_rich(m)
## Pretty-print the passed arguments, expanding dictionaries and arrays with newlines and indentation.
static func prn(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var m: String = Log.to_printable(msgs, {stack=get_stack(), newlines=true})
print_rich(m)
## Like [code]Log.prn()[/code], but also calls push_warning() with the pretty string.
static func warn(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var rich_msgs: Array = msgs.duplicate()
rich_msgs.push_front("[color=yellow][WARN][/color]")
print_rich(Log.to_printable(rich_msgs, {stack=get_stack(), newlines=true}))
var m: String = Log.to_printable(msgs, {stack=get_stack(), newlines=true, pretty=false})
push_warning(m)
## Like [code]Log.prn()[/code], but prepends a "[TODO]" and calls push_warning() with the pretty string.
static func todo(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
msgs.push_front("[TODO]")
var rich_msgs: Array = msgs.duplicate()
rich_msgs.push_front("[color=yellow][WARN][/color]")
print_rich(Log.to_printable(rich_msgs, {stack=get_stack(), newlines=true}))
var m: String = Log.to_printable(msgs, {stack=get_stack(), newlines=true, pretty=false})
push_warning(m)
## Like [code]Log.prn()[/code], but also calls push_error() with the pretty string.
static func err(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var rich_msgs: Array = msgs.duplicate()
rich_msgs.push_front("[color=red][ERR][/color]")
print_rich(Log.to_printable(rich_msgs, {stack=get_stack(), newlines=true}))
var m: String = Log.to_printable(msgs, {stack=get_stack(), newlines=true, pretty=false})
push_error(m)
## Like [code]Log.prn()[/code], but also calls push_error() with the pretty string.
static func error(msg: Variant, msg2: Variant = "ZZZDEF", msg3: Variant = "ZZZDEF", msg4: Variant = "ZZZDEF", msg5: Variant = "ZZZDEF", msg6: Variant = "ZZZDEF", msg7: Variant = "ZZZDEF") -> void:
var msgs: Array = [msg, msg2, msg3, msg4, msg5, msg6, msg7]
msgs = msgs.filter(Log.is_not_default)
var rich_msgs: Array = msgs.duplicate()
rich_msgs.push_front("[color=red][ERR][/color]")
print_rich(Log.to_printable(rich_msgs, {stack=get_stack(), newlines=true}))
var m: String = Log.to_printable(msgs, {stack=get_stack(), newlines=true, pretty=false})
push_error(m)

1
addons/log/log.gd.uid Normal file
View file

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

14
addons/log/plugin.cfg Normal file
View file

@ -0,0 +1,14 @@
[plugin]
name="Log.gd"
description="A pretty-printing debug logger.
Log.pr(\"some str\", some_object)
- Colorizes printed data based on datatype
- Recurses through nested data structures (Arrays and Dictionaries)
- Prefixes logs with the callsite's source file and line_number
"
author="Russell Matney"
version="v0.0.7"
script="plugin.gd"

8
addons/log/plugin.gd Normal file
View file

@ -0,0 +1,8 @@
@tool
extends EditorPlugin
func _enter_tree():
ProjectSettings.settings_changed.connect(on_settings_changed)
func on_settings_changed():
Log.setup_config()

1
addons/log/plugin.gd.uid Normal file
View file

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

59
grass.gdshader Normal file
View file

@ -0,0 +1,59 @@
shader_type spatial;
render_mode cull_disabled, diffuse_toon, specular_schlick_ggx;
// Nice Shader by @_Malido ^^
uniform vec3 top_color: source_color;
uniform vec3 bottom_color: source_color;
uniform float ambient_occlusion_factor: hint_range(0.0, 1.0, 0.01) = 0.3;
uniform float specular_strength: hint_range(0.0, 1.0, 0.01) = 0.4;
uniform float player_displacement_strength: hint_range(0.0, 1.0, 0.01) = 0.4;
uniform float player_displacement_size: hint_range(0.0, 2.0, 0.01) = 1.0;
uniform vec3 wind_direction; // Use a negative y component to give it an extra touch (For displacement effect and noise scroll direction)
uniform float wind_strength: hint_range(0.0, 1.0, 0.01) = 0.3;
uniform sampler2D wind_noise; // Periln FBM Noise looks Best
uniform float wind_noise_size: hint_range(0.0, 1.0, 0.001) = 0.05; // high values dont work well
uniform float wind_noise_speed: hint_range(0.0, 1.0, 0.001) = 0.1;
// Instance the Player Position through a GDScript in the _physics_process
instance uniform vec3 player_position;
void vertex() {
vec3 world_position = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
vec3 wind_texture = texture(wind_noise, world_position.xz * wind_noise_size + normalize(-wind_direction.xz) * (TIME + UV.y / 2.5) * wind_noise_speed).rgb;
vec3 wind_vector = (vec4(wind_texture * normalize(wind_direction) * wind_strength, 0.0) * MODEL_MATRIX).xyz;
float player_height = smoothstep(1.0, 0.0, length(player_position.y - world_position.y + 0.3));
vec3 push_direction = vec3(world_position - player_position) * vec3(1 , -0.3 ,1);
float player_position_factor = smoothstep(player_displacement_size, 0.0, length(push_direction));
vec3 player_push_vector = (vec4(normalize(push_direction), 0.0) * MODEL_MATRIX).xyz;
// Apply Player Position displacement
VERTEX += player_push_vector * (1.0 - UV.y) * player_position_factor * player_displacement_strength * player_height;
// Apply Wind displacement linearly
VERTEX += wind_vector * (1.0 - UV.y) * (1.0 - player_position_factor * 0.7);
// A new normal correction, which aligns the normals of the mesh facing upwards no matter the original direction.
NORMAL = vec3(0.0, 1.0, 0.0);
}
void fragment() {
vec3 color = mix(bottom_color, top_color, 1.0 - UV.y);
// Add fake ambient occlusion by darkening the base of the mesh
float ao_fallof = pow(UV.y, 5.0);
vec3 ao_color = bottom_color * (1.0 - ambient_occlusion_factor);
ALBEDO = mix(color, ao_color, ao_fallof);
ROUGHNESS = 0.4;
// Increase the Specular with Grass Height
SPECULAR *= (1.0 - UV.y) * specular_strength;
// Just removing some funny shading
if (!FRONT_FACING) {
NORMAL = -NORMAL;
}
}

1
grass.gdshader.uid Normal file
View file

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

View file

@ -11,5 +11,48 @@ config_version=5
[application] [application]
config/name="Nature Sim" config/name="Nature Sim"
run/main_scene="uid://bwsugg4p50fjr"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[autoload]
DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
MapGeneration="*res://Utilities/MapGeneration/MapGeneration.gd"
MapData="*res://Utilities/MapData/MapData.gd"
[editor_plugins]
enabled=PackedStringArray("res://addons/debug_menu/plugin.cfg", "res://addons/log/plugin.cfg")
[filesystem]
import/blender/enabled=false
[input]
move_left={
"deadzone": 0.2,
"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)
]
}
move_right={
"deadzone": 0.2,
"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)
]
}
move_forward={
"deadzone": 0.2,
"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)
]
}
move_back={
"deadzone": 0.2,
"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)
]
}
jump={
"deadzone": 0.2,
"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)
]
}

1025
stages/Test3D/Test3d.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,405 @@
[gd_scene load_steps=55 format=3 uid="uid://csy4cnun445ll"]
[ext_resource type="PackedScene" uid="uid://c2j36m8yplc10" path="res://stages/test3d/assets/2d/sky.tscn" id="1_xryot"]
[ext_resource type="PackedScene" uid="uid://c7crietgpayka" path="res://stages/test3d/assets/2d/mr_g_2d/mr_g_2d.tscn" id="2_17ouh"]
[ext_resource type="Texture2D" uid="uid://d26dqni8x0b2t" path="res://stages/test3d/assets/2d/tree.svg" id="3_1q0kp"]
[ext_resource type="Texture2D" uid="uid://ipid46pblo45" path="res://stages/test3d/assets/2d/ground.svg" id="4_r8rqa"]
[ext_resource type="PackedScene" uid="uid://dna0b10cybbc7" path="res://stages/test3d/assets/2d/portal/portal.tscn" id="5_cswu5"]
[ext_resource type="Texture2D" uid="uid://h336p4t83xnv" path="res://stages/test3d/assets/2d/particles/drop.svg" id="6_qvt14"]
[ext_resource type="Texture2D" uid="uid://beavff75c01jb" path="res://stages/test3d/assets/2d/campfire/campfire_base.png" id="6_xr7mf"]
[ext_resource type="Texture2D" uid="uid://dgeu415vt1niw" path="res://stages/test3d/assets/2d/particles/smoke_single.png" id="7_jjcs8"]
[ext_resource type="Texture2D" uid="uid://b8l748mradwnb" path="res://stages/test3d/assets/2d/particles/smoke_01.tga" id="8_66i0n"]
[ext_resource type="Texture2D" uid="uid://dl1qf45csr2rn" path="res://stages/test3d/assets/2d/particles/flamelet.png" id="9_mbcu3"]
[ext_resource type="Texture2D" uid="uid://qx22k0dplrvo" path="res://stages/test3d/assets/2d/particles/smokelet.png" id="10_gpqsy"]
[sub_resource type="Shader" id="Shader_gbrrg"]
code = "shader_type canvas_item;
void vertex() {
if (UV.y < 0.5) {
UV.x += 0.01 * sin(TIME);
}
}
void fragment() {
// Called for every pixel the material is visible on.
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_g2ytl"]
shader = SubResource("Shader_gbrrg")
[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_y1i7d"]
polygon = PackedVector2Array(756, 645, 797, 582, 873, 555, 882, 600, 938, 490, 1003, 539, 1059, 523, 1088, 546, 1122, 591, 1095, 701, 1062, 732, 810, 741, 754, 676)
[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_ikche"]
polygon = PackedVector2Array(-257.311, -55.8003, -22.0328, -51.5407, 108.328, -50.6888, 209.049, -52.3926, 255.213, -52.3926, 273.311, 96.692, -271.213, 103.507)
[sub_resource type="Curve" id="Curve_2hu1r"]
min_value = -1.0
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_owjr5"]
curve = SubResource("Curve_2hu1r")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4ia6b"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(900, 1, 1)
direction = Vector3(0.1, 1, 0)
spread = 0.0
initial_velocity_min = 600.0
initial_velocity_max = 850.0
gravity = Vector3(0, 98, 0)
scale_min = 0.2
hue_variation_curve = SubResource("CurveTexture_owjr5")
collision_mode = 2
sub_emitter_mode = 3
sub_emitter_amount_at_collision = 4
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_6qrss"]
particle_flag_align_y = true
particle_flag_disable_z = true
direction = Vector3(0, -1, 0)
spread = 20.227
initial_velocity_min = 50.0
initial_velocity_max = 60.0
gravity = Vector3(0, 98, 0)
scale_min = 0.1
scale_max = 0.2
[sub_resource type="Curve" id="Curve_gfg4a"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.147482, 1), 0.0, 0.0, 0, 0, Vector2(0.815348, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_4rsyc"]
curve = SubResource("Curve_gfg4a")
[sub_resource type="Curve" id="Curve_jmb2d"]
min_value = -1.0
_data = [Vector2(0, -0.00100791), 0.0, -1.93048, 0, 0, Vector2(0.107914, -0.677081), 0.0, 0.0, 0, 0, Vector2(0.311751, 0.798226), 0.0, 0.0, 0, 0, Vector2(0.565947, -0.768797), 0.0, 0.0, 0, 0, Vector2(0.793765, 0.452328), 0.0, 0.0, 0, 0, Vector2(1, -0.496271), -4.5996, 0.0, 1, 0]
point_count = 6
[sub_resource type="CurveTexture" id="CurveTexture_o7kp8"]
curve = SubResource("Curve_jmb2d")
[sub_resource type="Gradient" id="Gradient_h3v1k"]
offsets = PackedFloat32Array(0, 0.228093, 0.490979, 0.738402, 1)
colors = PackedColorArray(1, 1, 1, 1, 0.815686, 0.831373, 0, 1, 0.839216, 0.435294, 0.321569, 1, 0.750984, 0.165365, 0.0330983, 1, 0, 0, 0, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_7u11d"]
gradient = SubResource("Gradient_h3v1k")
[sub_resource type="Curve" id="Curve_o1582"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 1, Vector2(0.411271, 1), 0.0, 0.0, 0, 0, Vector2(0.773381, 0.851945), 0.0, 0.0, 0, 0, Vector2(1, 0.220419), -2.78673, 0.0, 1, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_et6at"]
curve = SubResource("Curve_o1582")
[sub_resource type="Curve" id="Curve_r7r4o"]
_data = [Vector2(0, 0.525701), 0.0, 0.0, 0, 0, Vector2(0.143885, 0.960693), 0.0, 0.0, 0, 0, Vector2(0.311751, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_c2jej"]
curve = SubResource("Curve_r7r4o")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_qb72e"]
particle_flag_disable_z = true
emission_shape_offset = Vector3(0, 120, 0)
emission_shape_scale = Vector3(1, 0.3, 1)
emission_shape = 6
emission_ring_axis = Vector3(0, 0, 1)
emission_ring_height = 1.0
emission_ring_radius = 50.0
emission_ring_inner_radius = 0.0
angle_min = -20.0
angle_max = 20.0
angle_curve = SubResource("CurveTexture_o7kp8")
gravity = Vector3(0, -8, 0)
radial_accel_min = -100.0
radial_accel_max = -50.0
radial_accel_curve = SubResource("CurveTexture_et6at")
tangential_accel_min = -20.0
tangential_accel_max = -20.0
scale_min = 0.01
scale_max = 0.2
scale_curve = SubResource("CurveTexture_c2jej")
color_ramp = SubResource("GradientTexture1D_7u11d")
alpha_curve = SubResource("CurveTexture_4rsyc")
turbulence_noise_strength = 0.73
turbulence_influence_min = 0.061
[sub_resource type="Curve" id="Curve_kspcf"]
min_value = -1.0
_data = [Vector2(0, -0.00100791), 0.0, 0.0, 0, 0, Vector2(0.226619, 0.496876), 0.0, 0.0, 0, 0, Vector2(0.545564, -0.48841), 0.0, 0.0, 0, 0, Vector2(0.756595, 0.444467), 0.0, 0.0, 0, 0, Vector2(0.994005, 0.0094738), 0.0, 0.0, 0, 0]
point_count = 5
[sub_resource type="CurveTexture" id="CurveTexture_rlvjc"]
curve = SubResource("Curve_kspcf")
[sub_resource type="Gradient" id="Gradient_vyxxc"]
offsets = PackedFloat32Array(0, 0.856959, 1)
colors = PackedColorArray(0.80284, 0.371503, 0.278563, 0.983323, 0.737255, 0.717647, 1, 0.764706, 0.737255, 0.717647, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_30t3y"]
gradient = SubResource("Gradient_vyxxc")
[sub_resource type="Curve" id="Curve_feids"]
_data = [Vector2(0, 0), 0.0, 2.95773, 0, 0, Vector2(1, 1), 0.195446, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_qiv4u"]
curve = SubResource("Curve_feids")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_0glfk"]
particle_flag_disable_z = true
angle_max = 10.0
angle_curve = SubResource("CurveTexture_rlvjc")
direction = Vector3(0.1, 1, 0)
spread = 74.595
initial_velocity_min = 1.0
initial_velocity_max = 2.0
angular_velocity_max = 20.0
gravity = Vector3(0.5, -8, 0)
tangential_accel_min = 2.0
tangential_accel_max = 5.0
scale_min = 0.3
scale_max = 0.8
scale_curve = SubResource("CurveTexture_qiv4u")
color_ramp = SubResource("GradientTexture1D_30t3y")
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_lsoa5"]
particles_animation = true
particles_anim_h_frames = 8
particles_anim_v_frames = 8
particles_anim_loop = true
[sub_resource type="Curve" id="Curve_sa4kr"]
min_value = -1.0
_data = [Vector2(0, -0.00100791), 0.0, 0.0, 0, 0, Vector2(0.226619, 0.496876), 0.0, 0.0, 0, 0, Vector2(0.545564, -0.48841), 0.0, 0.0, 0, 0, Vector2(0.756595, 0.444467), 0.0, 0.0, 0, 0, Vector2(0.994005, 0.0094738), 0.0, 0.0, 0, 0]
point_count = 5
[sub_resource type="CurveTexture" id="CurveTexture_di55o"]
curve = SubResource("Curve_sa4kr")
[sub_resource type="Gradient" id="Gradient_3y2ac"]
offsets = PackedFloat32Array(0, 0.856959, 1)
colors = PackedColorArray(0.80284, 0.371503, 0.278563, 0.983323, 0.737255, 0.717647, 1, 0.764706, 0.737255, 0.717647, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_qsiar"]
gradient = SubResource("Gradient_3y2ac")
[sub_resource type="Curve" id="Curve_k7dye"]
_data = [Vector2(0, 0), 0.0, 2.95773, 0, 0, Vector2(1, 1), 0.195446, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_tkdsx"]
curve = SubResource("Curve_k7dye")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_anr2h"]
particle_flag_disable_z = true
angle_max = 10.0
angle_curve = SubResource("CurveTexture_di55o")
direction = Vector3(0.1, 1, 0)
spread = 74.595
initial_velocity_min = 1.0
initial_velocity_max = 2.0
angular_velocity_max = 20.0
gravity = Vector3(0.5, -8, 0)
tangential_accel_min = 2.0
tangential_accel_max = 5.0
scale_min = 0.3
scale_max = 0.8
scale_curve = SubResource("CurveTexture_tkdsx")
color_ramp = SubResource("GradientTexture1D_qsiar")
anim_speed_min = 3.0
anim_speed_max = 3.0
anim_offset_max = 1.0
[sub_resource type="Gradient" id="Gradient_irrl4"]
offsets = PackedFloat32Array(0, 0.300258, 0.748711)
colors = PackedColorArray(0.788235, 0.286275, 0.160784, 1, 0.560784, 0.560784, 0.576471, 1, 0.831373, 0.831373, 0.831373, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_pi5io"]
gradient = SubResource("Gradient_irrl4")
[sub_resource type="Curve" id="Curve_27h30"]
min_value = -1.0
_data = [Vector2(0, -0.00100791), 0.0, 0.0, 0, 0, Vector2(0.0863309, 1), 0.0, 0.0, 0, 0, Vector2(0.184652, -0.957468), 0.0, 0.0, 0, 0, Vector2(0.378897, 0.981657), 0.0, 0.0, 0, 0, Vector2(0.515588, -0.973191), 0.0, 0.0, 0, 0, Vector2(0.63789, 1), 0.0, 0.0, 0, 0, Vector2(0.781775, -0.978432), 0.0, 0.0, 0, 0, Vector2(0.930456, 0.069744), 0.0, 0.0, 0, 0]
point_count = 8
[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_jfvma"]
curve_x = SubResource("Curve_27h30")
[sub_resource type="Curve" id="Curve_tbmxb"]
_data = [Vector2(0, 0.111671), 0.0, 0.0, 0, 0, Vector2(0.347722, 0.731405), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_blo62"]
curve = SubResource("Curve_tbmxb")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_djshu"]
particle_flag_disable_z = true
direction = Vector3(0.2, -1, 0)
spread = 4.689
initial_velocity_min = 30.0
initial_velocity_max = 50.0
directional_velocity_min = -30.0
directional_velocity_max = 30.0
directional_velocity_curve = SubResource("CurveXYZTexture_jfvma")
gravity = Vector3(0, 0, 0)
scale_max = 3.0
scale_curve = SubResource("CurveTexture_blo62")
color_ramp = SubResource("GradientTexture1D_pi5io")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kyh4q"]
size = Vector2(1920, 500)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ejnsg"]
size = Vector2(184, 1040)
[node name="Node2D" type="Node2D"]
position = Vector2(-67, 0)
[node name="Sky" parent="." instance=ExtResource("1_xryot")]
[node name="Tree" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_g2ytl")
position = Vector2(974, 674)
scale = Vector2(1.17969, 1.1889)
texture = ExtResource("3_1q0kp")
[node name="Tree Occluder" type="LightOccluder2D" parent="Tree"]
visible = false
position = Vector2(-825.641, -566.911)
scale = Vector2(0.84768, 0.841114)
occluder = SubResource("OccluderPolygon2D_y1i7d")
[node name="Ground Occluder" type="LightOccluder2D" parent="."]
position = Vector2(951, 962)
scale = Vector2(3.8125, 2.34766)
occluder = SubResource("OccluderPolygon2D_ikche")
[node name="Rain" type="GPUParticles2D" parent="."]
visible = false
modulate = Color(1, 1, 1, 0.45098)
position = Vector2(916, -104)
amount = 800
sub_emitter = NodePath("../Splash")
process_material = SubResource("ParticleProcessMaterial_4ia6b")
texture = ExtResource("6_qvt14")
lifetime = 5.0
preprocess = 10.0
collision_base_size = 5.08
visibility_rect = Rect2(-900, 0, 1800, 900)
[node name="Splash" type="GPUParticles2D" parent="."]
visible = false
modulate = Color(1, 1, 1, 0.45098)
position = Vector2(782, 838)
amount = 6400
process_material = SubResource("ParticleProcessMaterial_6qrss")
texture = ExtResource("6_qvt14")
explosiveness = 1.0
[node name="MrG2D" parent="." instance=ExtResource("2_17ouh")]
position = Vector2(212, 824)
[node name="Portal Left" parent="." instance=ExtResource("5_cswu5")]
visible = false
position = Vector2(520, 849)
target = NodePath("../Portal Right/ExitPoint")
[node name="ExitPoint" type="Marker2D" parent="Portal Left"]
position = Vector2(-134, -121)
[node name="Portal Right" parent="." instance=ExtResource("5_cswu5")]
visible = false
position = Vector2(1326, 849)
target = NodePath("../Portal Left/ExitPoint")
[node name="ExitPoint" type="Marker2D" parent="Portal Right"]
position = Vector2(117, -110)
[node name="Campfire" type="Node2D" parent="."]
position = Vector2(471, 737)
[node name="CampfireBase" type="Sprite2D" parent="Campfire"]
texture = ExtResource("6_xr7mf")
[node name="Fire" type="GPUParticles2D" parent="Campfire"]
position = Vector2(0, -20)
scale = Vector2(0.8, 0.8)
amount = 1500
process_material = SubResource("ParticleProcessMaterial_qb72e")
texture = ExtResource("9_mbcu3")
lifetime = 1.7
preprocess = 20.0
[node name="Smoke Static" type="GPUParticles2D" parent="Campfire"]
visible = false
modulate = Color(1, 1, 1, 0.435294)
position = Vector2(6, 31)
amount = 300
process_material = SubResource("ParticleProcessMaterial_0glfk")
texture = ExtResource("7_jjcs8")
lifetime = 15.0
preprocess = 20.0
visibility_rect = Rect2(-129.159, -1001.58, 775.325, 1129.79)
[node name="Smoke Animated" type="GPUParticles2D" parent="Campfire"]
visible = false
modulate = Color(1, 1, 1, 0.435294)
material = SubResource("CanvasItemMaterial_lsoa5")
amount = 300
process_material = SubResource("ParticleProcessMaterial_anr2h")
texture = ExtResource("8_66i0n")
lifetime = 15.0
preprocess = 20.0
visibility_rect = Rect2(-129.159, -1001.58, 775.325, 1129.79)
[node name="Smoke Stylized" type="GPUParticles2D" parent="Campfire"]
position = Vector2(14, 7)
amount = 12
process_material = SubResource("ParticleProcessMaterial_djshu")
texture = ExtResource("10_gpqsy")
lifetime = 15.0
preprocess = 20.0
trail_enabled = true
trail_lifetime = 5.0
trail_sections = 32
trail_section_subdivisions = 32
[node name="GroundCollider" type="StaticBody2D" parent="."]
position = Vector2(-4, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundCollider"]
position = Vector2(964, 1104)
shape = SubResource("RectangleShape2D_kyh4q")
[node name="Ground" type="Sprite2D" parent="."]
modulate = Color(0.527083, 0.527083, 0.527083, 1)
position = Vector2(951, 962)
scale = Vector2(3.8125, 2.34766)
texture = ExtResource("4_r8rqa")
[node name="LeftCollider" type="StaticBody2D" parent="."]
position = Vector2(76, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="LeftCollider"]
position = Vector2(-100, 426)
shape = SubResource("RectangleShape2D_ejnsg")
[node name="RightCollider" type="StaticBody2D" parent="."]
position = Vector2(1930, -4)
[node name="CollisionShape2D" type="CollisionShape2D" parent="RightCollider"]
position = Vector2(-110, 426)
shape = SubResource("RectangleShape2D_ejnsg")

BIN
stages/Test3D/assets/2d/campfire/campfire_base.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://beavff75c01jb"
path="res://.godot/imported/campfire_base.png-7a598d1351f456ba9c70e1ddcb33876d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/campfire/campfire_base.png"
dest_files=["res://.godot/imported/campfire_base.png-7a598d1351f456ba9c70e1ddcb33876d.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

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 512 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g>
<path d="M-9.066,9.323C-9.066,9.323 48.254,12.18 75.075,10.362C112.495,7.825 160.756,13.308 224.102,12.994C277.226,12.732 308.036,11.683 365.496,10.937C460.879,9.7 475.759,9.686 499.2,11.762C522.641,13.838 526.281,6.982 532.522,14.939C533.34,15.981 539.287,142.71 522.89,144.633C414.159,157.385 -11.485,152.908 -11.485,152.908C-10.543,105.351 -3.478,42.962 -9.066,9.323Z" style="fill:url(#_Linear1);"/>
</g>
<defs>
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.43557,126.616,-126.616,2.43557,175.325,10.2641)"><stop offset="0" style="stop-color:rgb(29,22,11);stop-opacity:1"/><stop offset="0.1" style="stop-color:rgb(44,33,17);stop-opacity:1"/><stop offset="0.44" style="stop-color:rgb(71,53,28);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(37,33,27);stop-opacity:1"/></linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ipid46pblo45"
path="res://.godot/imported/ground.svg-ea7e4395603e817504cf55c59c81293c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/ground.svg"
dest_files=["res://.godot/imported/ground.svg-ea7e4395603e817504cf55c59c81293c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

BIN
stages/Test3D/assets/2d/mr_g_2d/mr_g.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c5rn71x0rc11q"
path="res://.godot/imported/mr_g.png-71e9977f58dc00ed4c32be6fef3d21e7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/mr_g_2d/mr_g.png"
dest_files=["res://.godot/imported/mr_g.png-71e9977f58dc00ed4c32be6fef3d21e7.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

View file

@ -0,0 +1,27 @@
extends CharacterBody2D
var gravity:float = ProjectSettings.get_setting("physics/2d/gravity", 980)
@export var speed:float = 200
@onready var animated_sprite_2d:AnimatedSprite2D = %AnimatedSprite2D
@onready var animation_player:AnimationPlayer = %AnimationPlayer
func _ready():
animation_player.play("hover")
func _physics_process(delta):
if Input.is_action_pressed("left"):
velocity.x = -speed
animated_sprite_2d.animation = "left"
elif Input.is_action_pressed("right"):
animated_sprite_2d.animation = "right"
velocity.x = speed
else:
animated_sprite_2d.animation = "front"
velocity.x = 0
move_and_slide()
if not is_on_floor():
velocity.y = gravity
else:
velocity.y = 0

View file

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

View file

@ -0,0 +1,105 @@
[gd_scene load_steps=11 format=3 uid="uid://c7crietgpayka"]
[ext_resource type="Script" path="res://2d/mr_g_2d/mr_g_2d.gd" id="1_3fcra"]
[ext_resource type="Texture2D" uid="uid://c5rn71x0rc11q" path="res://stages/test3d/assets/2d/mr_g_2d/mr_g.png" id="1_a2u14"]
[sub_resource type="AtlasTexture" id="AtlasTexture_tau8e"]
atlas = ExtResource("1_a2u14")
region = Rect2(0, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_tbgjo"]
atlas = ExtResource("1_a2u14")
region = Rect2(128, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_bg8rt"]
atlas = ExtResource("1_a2u14")
region = Rect2(0, 0, 128, 128)
[sub_resource type="SpriteFrames" id="SpriteFrames_400e4"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tau8e")
}],
"loop": true,
"name": &"front",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tbgjo")
}],
"loop": true,
"name": &"left",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_bg8rt")
}],
"loop": true,
"name": &"right",
"speed": 5.0
}]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_f8e8s"]
radius = 30.0
height = 96.0
[sub_resource type="Animation" id="Animation_ntfnj"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, -64)]
}
[sub_resource type="Animation" id="Animation_gsrxd"]
resource_name = "hover"
length = 2.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1, 2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, -64), Vector2(0, -57), Vector2(0, -64)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_wyrgm"]
_data = {
"RESET": SubResource("Animation_ntfnj"),
"hover": SubResource("Animation_gsrxd")
}
[node name="MrG2D" type="CharacterBody2D"]
script = ExtResource("1_3fcra")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -64)
sprite_frames = SubResource("SpriteFrames_400e4")
animation = &"front"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2(0, -48)
shape = SubResource("CapsuleShape2D_f8e8s")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_wyrgm")
}

BIN
stages/Test3D/assets/2d/particles/blob.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bi7mfgsho7qrq"
path.s3tc="res://.godot/imported/blob.png-6dedc35bec1b24f9b13a0a3cfe61beb7.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/blob.png"
dest_files=["res://.godot/imported/blob.png-6dedc35bec1b24f9b13a0a3cfe61beb7.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

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1.08126,0,0,1.28,-2.98757,-4.48)">
<path d="M10.162,3.5C10.162,3.5 14.324,9.789 14.324,12.484C14.324,14.425 12.459,16 10.162,16C7.865,16 6,14.425 6,12.484C6,9.789 10.162,3.5 10.162,3.5Z" style="fill:rgb(235,235,235);"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 712 B

View file

@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://h336p4t83xnv"
path.s3tc="res://.godot/imported/drop.svg-5212f06d8da6caa774d53b0d85c8ae76.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/drop.svg"
dest_files=["res://.godot/imported/drop.svg-5212f06d8da6caa774d53b0d85c8ae76.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

BIN
stages/Test3D/assets/2d/particles/flamelet.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dl1qf45csr2rn"
path.s3tc="res://.godot/imported/flamelet.png-e2f8ab00826e472f6ab44a7ff92dd60f.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/flamelet.png"
dest_files=["res://.godot/imported/flamelet.png-e2f8ab00826e472f6ab44a7ff92dd60f.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

BIN
stages/Test3D/assets/2d/particles/fog_sheet.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dk65dyhcb7hxj"
path="res://.godot/imported/fog_sheet.png-e5bd6dc079008aac22f2937fbb5747eb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/fog_sheet.png"
dest_files=["res://.godot/imported/fog_sheet.png-e5bd6dc079008aac22f2937fbb5747eb.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

BIN
stages/Test3D/assets/2d/particles/fog_single.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://drxbw17dlsbw0"
path="res://.godot/imported/fog_single.png-ed7b3404e8ccda08ee8ef8d1c0dc67e0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/fog_single.png"
dest_files=["res://.godot/imported/fog_single.png-ed7b3404e8ccda08ee8ef8d1c0dc67e0.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8l748mradwnb"
path="res://.godot/imported/smoke_01.tga-bd35cf8fe78db380994d8ab8e78a5e53.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/smoke_01.tga"
dest_files=["res://.godot/imported/smoke_01.tga-bd35cf8fe78db380994d8ab8e78a5e53.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

BIN
stages/Test3D/assets/2d/particles/smoke_single.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dgeu415vt1niw"
path="res://.godot/imported/smoke_single.png-59fa1002b24de10fb1e73989ab3d78ad.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/smoke_single.png"
dest_files=["res://.godot/imported/smoke_single.png-59fa1002b24de10fb1e73989ab3d78ad.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

BIN
stages/Test3D/assets/2d/particles/smokelet.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qx22k0dplrvo"
path="res://.godot/imported/smokelet.png-934a633bb464dcba596817b0818f8a17.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/smokelet.png"
dest_files=["res://.godot/imported/smokelet.png-934a633bb464dcba596817b0818f8a17.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

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1.24261,0,0,1.24261,-4.66722,-3.16622)">
<path d="M10.194,3.353L11.639,7.801L16.317,7.801L12.533,10.551L13.978,14.999L10.194,12.25L6.41,14.999L7.855,10.551L4.071,7.801L8.749,7.801L10.194,3.353Z" style="fill:white;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 709 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://krxjfmfv7v5u"
path="res://.godot/imported/white_star.svg-5c67467bda116e17995553fd7547e5fc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/particles/white_star.svg"
dest_files=["res://.godot/imported/white_star.svg-5c67467bda116e17995553fd7547e5fc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,9 @@
extends Node2D
@export_node_path("Node2D") var target:NodePath = "."
@onready var target_position:Vector2 = get_node(target).global_position
func _on_area_2d_body_entered(body:PhysicsBody2D):
body.global_position = target_position

View file

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

View file

@ -0,0 +1,47 @@
shader_type particles;
uniform vec2 dimensions;
uniform float rotations = 1;
uniform sampler2D scale_curve;
float hash12(vec2 p)
{
vec3 p3 = fract(vec3(p.xyx) * .1031);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}
mat4 translate(float x, float y, float z) {
return mat4( // careful, this takes COLUMNS
vec4(1,0,0,0),
vec4(0,1,0,0),
vec4(0,0,1,0),
vec4(x, y, z, 1.0)
);
}
mat4 scale(float x, float y, float z) {
return mat4(
vec4(x, 0.0, 0.0, 0.0),
vec4(0.0, y, 0.0, 0.0),
vec4(0.0, 0.0, z, 0.0),
vec4(0, 0, 0, 1)
);
}
void start() {
float angle = 0.0;
TRANSFORM = EMISSION_TRANSFORM
* translate(cos(angle) * dimensions.x * 0.5, sin(angle) * dimensions.y * 0.5, 0);
CUSTOM.x = LIFETIME;
CUSTOM.y = hash12(vec2(float(INDEX), float(TIME)));
}
void process() {
CUSTOM.x += DELTA;
float lifetime_offset = CUSTOM.x / LIFETIME;
float angle = TAU * (rotations-CUSTOM.y) * lifetime_offset + TAU * CUSTOM.y * 0.2;
float particle_scale = texture(scale_curve, vec2(mod(lifetime_offset + CUSTOM.y, 1.0), 0)).r;
vec2 offset = vec2(cos(angle), sin(angle)) * dimensions * 0.5;
TRANSFORM = EMISSION_TRANSFORM * translate(offset.x, offset.y, 0) * scale(particle_scale, particle_scale, 1);
}

View file

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

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cm6s6psinjqs1"
path.s3tc="res://.godot/imported/portal.svg-fd5fe3cf03c55818f3452c9382cc256e.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/2d/portal/portal.svg"
dest_files=["res://.godot/imported/portal.svg-fd5fe3cf03c55818f3452c9382cc256e.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,29 @@
[gd_resource type="ParticleProcessMaterial" load_steps=5 format=3 uid="uid://s00vfpn8rgbm"]
[sub_resource type="Curve" id="Curve_pj2gr"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.112195, 1), 0.0, 0.0, 0, 0, Vector2(0.858537, 0.868225), -0.811641, -0.811641, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_d0j85"]
curve = SubResource("Curve_pj2gr")
[sub_resource type="Curve" id="Curve_662mi"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.195122, 0.940836), 0.0, 0.0, 0, 0, Vector2(0.346341, 0.155565), 0.0, 0.0, 0, 0, Vector2(0.531707, 0.693422), 0.0, 0.0, 0, 0, Vector2(0.692683, 0.268515), 0.0, 0.0, 0, 0, Vector2(0.82439, 0.553579), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 7
[sub_resource type="CurveTexture" id="CurveTexture_3de78"]
curve = SubResource("Curve_662mi")
[resource]
particle_flag_disable_z = true
emission_shape_scale = Vector3(20, 50, 1)
emission_shape = 1
emission_sphere_radius = 0.5
orbit_velocity_min = 0.05
orbit_velocity_max = 0.05
radial_velocity_min = 25.0
radial_velocity_max = 25.0
gravity = Vector3(0, 0, 0)
scale_min = 0.5
scale_curve = SubResource("CurveTexture_3de78")
alpha_curve = SubResource("CurveTexture_d0j85")

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,41 @@
[gd_scene load_steps=5 format=3 uid="uid://c2j36m8yplc10"]
[ext_resource type="Texture2D" uid="uid://krxjfmfv7v5u" path="res://stages/test3d/assets/2d/particles/white_star.svg" id="1_duft5"]
[sub_resource type="Curve" id="Curve_fw0vr"]
_data = [Vector2(0, 0.0291684), 0.0, 0.0, 0, 0, Vector2(0.0487805, 0.997311), 0.0, 0.0, 0, 0, Vector2(0.912195, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_qm5xb"]
curve = SubResource("Curve_fw0vr")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jq86f"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(1920, 1080, 1)
angle_min = -211.0
angle_max = 74.4
direction = Vector3(0, 0, 0)
gravity = Vector3(0, 0, 0)
scale_min = 0.2
scale_max = 0.8
alpha_curve = SubResource("CurveTexture_qm5xb")
hue_variation_max = 0.1
[node name="Node2D" type="Node2D"]
[node name="ColorRect" type="ColorRect" parent="."]
offset_left = -989.0
offset_top = -655.0
offset_right = 3348.0
offset_bottom = 1758.0
color = Color(0.0117647, 0.00392157, 0.0784314, 1)
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
position = Vector2(960, 540)
amount = 250
process_material = SubResource("ParticleProcessMaterial_jq86f")
texture = ExtResource("1_duft5")
lifetime = 30.0
preprocess = 30.0
visibility_rect = Rect2(-960, -540, 1920, 1080)

View file

@ -0,0 +1,503 @@
[gd_scene load_steps=68 format=3 uid="uid://lfg773mtcotm"]
[ext_resource type="Texture2D" uid="uid://dgeu415vt1niw" path="res://stages/test3d/assets/2d/particles/smoke_single.png" id="1_gmyr5"]
[ext_resource type="Texture2D" uid="uid://b8l748mradwnb" path="res://stages/test3d/assets/2d/particles/smoke_01.tga" id="2_0uo4p"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ypg2f"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_c3066"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_h0jlv"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ym6p7"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_3uthe"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_2dma3"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_554bj"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_dhmp0"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 0, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_mfd16"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ws1j"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_gftgi"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ncytd"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_t5h3n"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_tp7uj"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_j3hf0"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_tyqkq"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 128, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_qltir"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_tpcua"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ggj1f"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_j2jco"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_xdmoa"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_6f127"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_yvk72"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_hx7gl"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 256, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_bwomb"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_6betm"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_py1hq"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_555cw"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_55ntt"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_yh2fb"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ag42j"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_6p4ed"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 384, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ir60e"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_nxd8k"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_t70tk"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_0agu4"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_qh3rp"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_4a48d"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ujpjb"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_rn64r"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 512, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_8a2dv"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_cj40t"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_yrh3f"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_ql6v8"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_71gpt"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_evlhh"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_h0utl"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_igky1"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 640, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_3kwy7"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_fhajq"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_d35ao"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_8rxka"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_p3nc6"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_3vy36"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_qnmdl"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_et3s7"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 768, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_fc3y6"]
atlas = ExtResource("2_0uo4p")
region = Rect2(0, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_nab8w"]
atlas = ExtResource("2_0uo4p")
region = Rect2(128, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_0lxd2"]
atlas = ExtResource("2_0uo4p")
region = Rect2(256, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_8t4r1"]
atlas = ExtResource("2_0uo4p")
region = Rect2(384, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_7luc7"]
atlas = ExtResource("2_0uo4p")
region = Rect2(512, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_g8m6l"]
atlas = ExtResource("2_0uo4p")
region = Rect2(640, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_o2fft"]
atlas = ExtResource("2_0uo4p")
region = Rect2(768, 896, 128, 128)
[sub_resource type="AtlasTexture" id="AtlasTexture_r8d0t"]
atlas = ExtResource("2_0uo4p")
region = Rect2(896, 896, 128, 128)
[sub_resource type="SpriteFrames" id="SpriteFrames_mykmg"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ypg2f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c3066")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h0jlv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ym6p7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3uthe")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2dma3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_554bj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dhmp0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mfd16")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ws1j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gftgi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ncytd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_t5h3n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tp7uj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j3hf0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tyqkq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qltir")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tpcua")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ggj1f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2jco")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xdmoa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6f127")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yvk72")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hx7gl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bwomb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6betm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_py1hq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_555cw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_55ntt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yh2fb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ag42j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6p4ed")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ir60e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nxd8k")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_t70tk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0agu4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qh3rp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4a48d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ujpjb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rn64r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8a2dv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cj40t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yrh3f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ql6v8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_71gpt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_evlhh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h0utl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_igky1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3kwy7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fhajq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d35ao")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8rxka")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p3nc6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3vy36")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qnmdl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_et3s7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fc3y6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nab8w")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0lxd2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8t4r1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7luc7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_g8m6l")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o2fft")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_r8d0t")
}],
"loop": true,
"name": &"default",
"speed": 30.0
}]
[node name="Control" type="ColorRect"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1.0
offset_right = -1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="SmokeSingle" type="Sprite2D" parent="."]
position = Vector2(381, 459)
scale = Vector2(4, 4)
texture = ExtResource("1_gmyr5")
[node name="Smoke Spritesheet" type="Sprite2D" parent="."]
visible = false
position = Vector2(1140, 450)
scale = Vector2(0.8, 0.8)
texture = ExtResource("2_0uo4p")
[node name="SmokeAnimated" type="AnimatedSprite2D" parent="."]
position = Vector2(1128, 463)
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_mykmg")
frame_progress = 0.051228
[node name="Label" type="Label" parent="."]
modulate = Color(1, 1, 1, 0.345098)
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -211.5
offset_top = -49.0
offset_right = 211.5
grow_horizontal = 2
grow_vertical = 0
theme_override_font_sizes/font_size = 24
text = "Wispy Smoke Particle Flipbook used under CC0 License"

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d26dqni8x0b2t"
path="res://.godot/imported/tree.svg-30a65eb633398dcd1bb3ed2f9cf58a08.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/2d/tree.svg"
dest_files=["res://.godot/imported/tree.svg-30a65eb633398dcd1bb3ed2f9cf58a08.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,67 @@
class_name Camera
extends Node3D
const CAMERA_MAX_PITCH = deg_to_rad(70)
const CAMERA_MIN_PITCH = deg_to_rad(-89.9)
const CAMERA_RATIO = .625
@export var mouse_sensitivity: float = .002
@export var mouse_y_inversion: float = 1.0
@export var min_distance:float = 4
@export var max_distance:float = 100
@onready var _camera_yaw: Node3D = self
@onready var _camera_pitch: Node3D = %Camera3D
@onready var _camera:Camera3D = %Camera3D
@onready var _arm:SpringArm3D = %Arm
var left:Vector3:
get:
return -_camera.global_transform.basis.x
var right:Vector3:
get:
return _camera.global_transform.basis.x
var forward:Vector3:
get:
return -_camera.global_transform.basis.z
var backward:Vector3:
get:
return _camera.global_transform.basis.z
var up:Vector3:
get:
return Vector3.UP
var down:Vector3:
get:
return Vector3.DOWN
func _ready():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
_camera.position.z = min_distance
func _input(event: InputEvent) -> void:
if event.is_action("zoom_in"):
_arm.spring_length = max(min_distance, _arm.spring_length - 1.0)
if event.is_action("zoom_out"):
_arm.spring_length = min(max_distance, _arm.spring_length + 1.0)
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
rotate_camera(event.relative)
get_viewport().set_input_as_handled()
return
func rotate_camera(relative:Vector2) -> void:
_camera_yaw.rotation.y -= relative.x * mouse_sensitivity
_camera_yaw.orthonormalize()
_camera_pitch.rotation.x += relative.y * mouse_sensitivity * CAMERA_RATIO * mouse_y_inversion
_camera_pitch.rotation.x = clamp(_camera_pitch.rotation.x, CAMERA_MIN_PITCH, CAMERA_MAX_PITCH)

View file

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

View file

@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://brsyy0hbjk5a8"]
[ext_resource type="Script" path="res://3d/camera/camera.gd" id="1_otq4y"]
[sub_resource type="SphereShape3D" id="SphereShape3D_smq6u"]
[node name="Camera" type="Node3D"]
script = ExtResource("1_otq4y")
[node name="Arm" type="SpringArm3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.906308, 0.422618, 0, -0.422618, 0.906308, 0, 2.32515, -0.0321627)
shape = SubResource("SphereShape3D_smq6u")
spring_length = 4.0
margin = 0.5
[node name="Camera3D" type="Camera3D" parent="Arm"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 0.999999, 0, 0, 2.135)
far = 32768.0

View file

@ -0,0 +1,26 @@
[remap]
importer="3d_texture"
type="CompressedTexture3D"
uid="uid://bjo7r2tkwc3ao"
path="res://.godot/imported/collision_test.GPUParticlesCollisionSDF3D_data.exr-c9cd6dbc70e1ace592baba5068548477.ctex3d"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Stages/Test3D/assets/3d/collision_test/collision_test.GPUParticlesCollisionSDF3D_data.exr"
dest_files=["res://.godot/imported/collision_test.GPUParticlesCollisionSDF3D_data.exr-c9cd6dbc70e1ace592baba5068548477.ctex3d"]
[params]
compress/mode=3
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/channel_pack=1
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=1
slices/vertical=42

View file

@ -0,0 +1,191 @@
[gd_scene load_steps=17 format=3 uid="uid://uq3na8rghhbn"]
[ext_resource type="PackedScene" uid="uid://4kb86lxbov4v" path="res://stages/test3d/assets/3d/player/mr.g.glb" id="1_t3ghg"]
[ext_resource type="PackedScene" uid="uid://duemno5uwb4t0" path="res://stages/test3d/assets/3d/shack/shack.tscn" id="2_vipjm"]
[ext_resource type="Shader" path="res://3d/collision_test/displacement.gdshader" id="3_ejsj4"]
[ext_resource type="CompressedTexture3D" uid="uid://bjo7r2tkwc3ao" path="res://stages/test3d/assets/3d/collision_test/collision_test.GPUParticlesCollisionSDF3D_data.exr" id="4_uwxbd"]
[ext_resource type="PackedScene" path="res://3d/trees/Low_Poly_Tree_003.blend" id="5_qsvs5"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_nr1yp"]
emission_shape = 6
emission_ring_axis = Vector3(0, 1, 0)
emission_ring_height = 1.0
emission_ring_radius = 5.0
emission_ring_inner_radius = 0.0
direction = Vector3(0, -1, 0)
spread = 0.0
collision_mode = 2
[sub_resource type="SphereMesh" id="SphereMesh_yvhpy"]
[sub_resource type="SystemFont" id="SystemFont_e4e0m"]
font_names = PackedStringArray("Lato")
font_italic = true
[sub_resource type="Gradient" id="Gradient_1xdld"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_5pms4"]
seed = 100
frequency = 0.002
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_vi2qd"]
color_ramp = SubResource("Gradient_1xdld")
noise = SubResource("FastNoiseLite_5pms4")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_t5q5t"]
render_priority = 0
shader = ExtResource("3_ejsj4")
shader_parameter/multiplier = 2.0
shader_parameter/displacement_map = SubResource("NoiseTexture2D_vi2qd")
[sub_resource type="QuadMesh" id="QuadMesh_26s8k"]
material = SubResource("ShaderMaterial_t5q5t")
size = Vector2(16, 16)
subdivide_width = 256
subdivide_depth = 256
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dvnm8"]
emission_shape = 6
emission_ring_axis = Vector3(1, 0, 0)
emission_ring_height = 1.0
emission_ring_radius = 2.5
emission_ring_inner_radius = 0.0
direction = Vector3(0, -1, 0)
spread = 0.0
gravity = Vector3(-3, 0, 0)
collision_mode = 2
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_017fv"]
albedo_color = Color(5.48691e-06, 0.557107, 0.752615, 1)
[sub_resource type="SphereMesh" id="SphereMesh_xi30s"]
material = SubResource("StandardMaterial3D_017fv")
radius = 0.3
height = 0.6
[node name="CollisionTest" type="Node3D"]
[node name="Particles Down" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0911274, 11.3544, -77.708)
amount = 20
lifetime = 5.0
fixed_fps = 60
collision_base_size = 0.3
visibility_aabb = AABB(-6, -24, -6, 12, 24, 12)
process_material = SubResource("ParticleProcessMaterial_nr1yp")
draw_pass_1 = SubResource("SphereMesh_yvhpy")
[node name="Collision Box" type="Node3D" parent="."]
[node name="Collision" type="Node3D" parent="Collision Box"]
[node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="Collision Box/Collision"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
size = Vector3(16, 0.5, 16)
[node name="Meshes" type="CSGBox3D" parent="Collision Box"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0.00105095)
size = Vector3(16, 0.5, 16)
[node name="Node3D" type="Node3D" parent="Collision Box/Meshes"]
[node name="mr_g" parent="Collision Box/Meshes/Node3D" instance=ExtResource("1_t3ghg")]
transform = Transform3D(0.02178, 0, 0.999763, 0, 1, 0, -0.999763, 0, 0.02178, 0, 1.27828, -6.25074)
[node name="Shack" parent="Collision Box/Meshes" instance=ExtResource("2_vipjm")]
[node name="Label3D2" type="Label3D" parent="Collision Box"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -11.341, 0.00105095)
billboard = 1
no_depth_test = true
text = "GPUParticlesCollisionBox3D"
font = SubResource("SystemFont_e4e0m")
font_size = 400
outline_size = 80
[node name="Height Field" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -35.4041)
[node name="Collision" type="Node3D" parent="Height Field"]
[node name="GPUParticlesCollisionHeightField3D" type="GPUParticlesCollisionHeightField3D" parent="Height Field/Collision"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.835205, -0.0262756, 0.709412)
size = Vector3(14.4097, 10.7481, 13.3466)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Height Field"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, -4.40113, 0)
mesh = SubResource("QuadMesh_26s8k")
[node name="Label3D2" type="Label3D" parent="Height Field"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -11.341, 0)
billboard = 1
no_depth_test = true
text = "GPUParticlesCollisionHeightField3D
"
font = SubResource("SystemFont_e4e0m")
font_size = 400
outline_size = 80
[node name="Node3D" type="Node3D" parent="Height Field"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
[node name="mr_g" parent="Height Field/Node3D" instance=ExtResource("1_t3ghg")]
transform = Transform3D(0.02178, 0, 0.999763, 0, 1, 0, -0.999763, 0, 0.02178, 0, 1.27828, -6.25074)
[node name="Shack" parent="Height Field" instance=ExtResource("2_vipjm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
[node name="SDF" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -78.5248)
[node name="GPUParticlesCollisionSDF3D" type="GPUParticlesCollisionSDF3D" parent="SDF"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.48958, -0.746405, -0.978371)
size = Vector3(11.7281, 6.67627, 7.79422)
texture = ExtResource("4_uwxbd")
[node name="Collision" type="Node3D" parent="SDF"]
[node name="CSGBox3D2" type="CSGBox3D" parent="SDF"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
size = Vector3(16, 0.5, 16)
[node name="Label3D2" type="Label3D" parent="SDF"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -11.341, 0)
billboard = 1
no_depth_test = true
text = "GPUParticlesCollisionSDF3D"
font = SubResource("SystemFont_e4e0m")
font_size = 400
outline_size = 80
[node name="Node3D" type="Node3D" parent="SDF"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
[node name="mr_g" parent="SDF/Node3D" instance=ExtResource("1_t3ghg")]
transform = Transform3D(0.02178, 0, 0.999763, 0, 1, 0, -0.999763, 0, 0.02178, 0, 1.27828, -5.88152)
[node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="SDF"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.83233, 0)
size = Vector3(16, 0.5, 16)
[node name="Low_Poly_Tree_0032" parent="SDF" instance=ExtResource("5_qsvs5")]
transform = Transform3D(0.0111992, 0, 0.474868, 0.0879146, 0.466789, -0.00207336, -0.466659, 0.0879391, 0.0110056, -4.86043, -3.5375, 0.170258)
[node name="Low_Poly_Tree_0033" parent="SDF" instance=ExtResource("5_qsvs5")]
transform = Transform3D(0.0142642, 4.22588e-10, 0.604832, -0.0563522, 0.602368, 0.001329, -0.602201, -0.0563678, 0.0142022, -4.95189, -3.48398, -0.583443)
[node name="Low_Poly_Tree_0034" parent="SDF" instance=ExtResource("5_qsvs5")]
transform = Transform3D(0.0109634, 0, 0.464871, 0, 0.465, 0, -0.464871, 0, 0.0109634, -6.03885, -3.48398, 0.105019)
[node name="Shack" parent="SDF" instance=ExtResource("2_vipjm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.40342, -3.65838, -0.5205)
[node name="Particles Back" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.80685, -2.13028, -79.044)
amount = 50
lifetime = 5.0
fixed_fps = 60
collision_base_size = 0.6
visibility_aabb = AABB(-24, -6, -6, 24, 12, 12)
process_material = SubResource("ParticleProcessMaterial_dvnm8")
draw_pass_1 = SubResource("SphereMesh_xi30s")

View file

@ -0,0 +1,24 @@
shader_type spatial;
render_mode specular_toon;
uniform sampler2D displacement_map;
uniform float multiplier;
vec3 calc_normal(vec2 uv) {
const vec3 off = vec3(-1,0,1);
vec2 texelSize = 1.0 / vec2(textureSize(displacement_map, 0));
float left = texture(displacement_map, uv + texelSize * off.xy).x;
float right = texture(displacement_map, uv + texelSize * off.zy).x;
float top = texture(displacement_map, uv + texelSize * off.yx).x;
float down = texture(displacement_map, uv + texelSize * off.yz).x;
return normalize(vec3(left-right, 2.0, down-top));
}
void vertex() {
VERTEX.z += texture(displacement_map, UV).r * multiplier;
NORMAL = calc_normal(UV);
}

View file

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

View file

@ -0,0 +1,10 @@
extends Node3D
@export var target:Node3D
@export var offset:Vector3 = Vector3(0, 20, 0)
func _process(_delta):
if not is_instance_valid(target):
return
global_position = target.global_position + offset

View file

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

View file

@ -0,0 +1,175 @@
[gd_resource type="Resource" load_steps=20 format=3 uid="uid://b2v2w4oolqo3e"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/greenhouse/greenhouse.gd" id="1_4qyr5"]
[ext_resource type="ArrayMesh" uid="uid://cf504ckh1pwyo" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_001.res" id="1_jk4j5"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/greenhouse/greenhouse_LOD_variant.gd" id="1_qm30s"]
[ext_resource type="PackedScene" uid="uid://ixvy6sarjb37" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_001.tscn" id="2_0siyi"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/greenhouse/greenhouse_plant.gd" id="3_gjuif"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/greenhouse/greenhouse_plant_state.gd" id="4_mv0mq"]
[ext_resource type="ArrayMesh" uid="uid://cwpj75lnp56od" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_002.res" id="6_2yog5"]
[ext_resource type="PackedScene" uid="uid://clwqm8jemgfei" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_002.tscn" id="7_bjm7m"]
[ext_resource type="ArrayMesh" uid="uid://rnrsayu7wbea" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_003.res" id="8_weaq7"]
[ext_resource type="PackedScene" uid="uid://coqqymsq0mpxx" path="res://stages/test3d/assets/3d/trees/Low_Poly_Tree_003.tscn" id="9_ao7v8"]
[sub_resource type="Resource" id="Resource_vmwxe"]
resource_name = "Greenhouse_LODVariant"
script = ExtResource("1_qm30s")
mesh = ExtResource("1_jk4j5")
spawned_spatial = ExtResource("2_0siyi")
cast_shadow = 1
metadata/class = "Greenhouse_LODVariant"
[sub_resource type="Resource" id="Resource_gnayq"]
resource_name = "Greenhouse_Plant"
script = ExtResource("3_gjuif")
mesh/mesh_LOD_variants = [SubResource("Resource_vmwxe")]
mesh/selected_for_edit_resource = SubResource("Resource_vmwxe")
mesh/mesh_LOD_max_distance = 9.99
mesh/mesh_LOD_kill_distance = -1.0
mesh/mesh_LOD_max_capacity = 75
mesh/mesh_LOD_min_size = 1.0
octree/octree_reconfigure_button = false
octree/octree_recenter_button = false
density/density_per_units = 15.0
scale/scale_scaling_type = 0
scale/scale_range = [Vector3(1, 1, 1), Vector3(1.2, 1.2, 1.2)]
up_vector/up_vector_primary_type = 2
up_vector/up_vector_primary = Vector3(0, 0, 0)
up_vector/up_vector_secondary_type = 2
up_vector/up_vector_secondary = Vector3(0, 0, 0)
up_vector/up_vector_blending = 0.0
fwd_vector/fwd_vector_primary_type = 0
fwd_vector/fwd_vector_primary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_secondary_type = 0
fwd_vector/fwd_vector_secondary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_blending = 0.0
offset/offset_y_range = [0.0, 0.0]
offset/offset_jitter_fraction = 0.59
rotation/rotation_random_y = 180.0
rotation/rotation_random_x = 0.0
rotation/rotation_random_z = 0.01
slope/slope_allowed_range = [0.0, 180.0]
import_export/import_plant_data_button = false
import_export/export_plant_data_button = false
import_export/import_greenhouse_data_button = false
import_export/export_greenhouse_data_button = false
metadata/class = "Greenhouse_Plant"
[sub_resource type="Resource" id="Resource_7bfvu"]
resource_name = "Greenhouse_PlantState"
script = ExtResource("4_mv0mq")
plant/plant_brush_active = true
plant/plant_label = ""
plant/plant = SubResource("Resource_gnayq")
metadata/class = "Greenhouse_PlantState"
[sub_resource type="Resource" id="Resource_6h61r"]
resource_name = "Greenhouse_LODVariant"
script = ExtResource("1_qm30s")
mesh = ExtResource("6_2yog5")
spawned_spatial = ExtResource("7_bjm7m")
cast_shadow = 1
metadata/class = "Greenhouse_LODVariant"
[sub_resource type="Resource" id="Resource_vav4o"]
resource_name = "Greenhouse_Plant"
script = ExtResource("3_gjuif")
mesh/mesh_LOD_variants = [SubResource("Resource_6h61r")]
mesh/selected_for_edit_resource = SubResource("Resource_6h61r")
mesh/mesh_LOD_max_distance = 10.0
mesh/mesh_LOD_kill_distance = -1.0
mesh/mesh_LOD_max_capacity = 75
mesh/mesh_LOD_min_size = 1.0
octree/octree_reconfigure_button = false
octree/octree_recenter_button = false
density/density_per_units = 15.0
scale/scale_scaling_type = 0
scale/scale_range = [Vector3(1, 1, 1), Vector3(1.2, 1.2, 1.2)]
up_vector/up_vector_primary_type = 2
up_vector/up_vector_primary = Vector3(0, 0, 0)
up_vector/up_vector_secondary_type = 2
up_vector/up_vector_secondary = Vector3(0, 0, 0)
up_vector/up_vector_blending = 0.0
fwd_vector/fwd_vector_primary_type = 0
fwd_vector/fwd_vector_primary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_secondary_type = 0
fwd_vector/fwd_vector_secondary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_blending = 0.0
offset/offset_y_range = [0.0, 0.0]
offset/offset_jitter_fraction = 0.6
rotation/rotation_random_y = 180.0
rotation/rotation_random_x = 0.0
rotation/rotation_random_z = 0.0
slope/slope_allowed_range = [0.0, 180.0]
import_export/import_plant_data_button = false
import_export/export_plant_data_button = false
import_export/import_greenhouse_data_button = false
import_export/export_greenhouse_data_button = false
metadata/class = "Greenhouse_Plant"
[sub_resource type="Resource" id="Resource_3tj40"]
resource_name = "Greenhouse_PlantState"
script = ExtResource("4_mv0mq")
plant/plant_brush_active = true
plant/plant_label = ""
plant/plant = SubResource("Resource_vav4o")
metadata/class = "Greenhouse_PlantState"
[sub_resource type="Resource" id="Resource_mho2m"]
resource_name = "Greenhouse_LODVariant"
script = ExtResource("1_qm30s")
mesh = ExtResource("8_weaq7")
spawned_spatial = ExtResource("9_ao7v8")
cast_shadow = 1
metadata/class = "Greenhouse_LODVariant"
[sub_resource type="Resource" id="Resource_ngah6"]
resource_name = "Greenhouse_Plant"
script = ExtResource("3_gjuif")
mesh/mesh_LOD_variants = [SubResource("Resource_mho2m")]
mesh/selected_for_edit_resource = SubResource("Resource_mho2m")
mesh/mesh_LOD_max_distance = 10.0
mesh/mesh_LOD_kill_distance = -1.0
mesh/mesh_LOD_max_capacity = 75
mesh/mesh_LOD_min_size = 1.0
octree/octree_reconfigure_button = false
octree/octree_recenter_button = false
density/density_per_units = 15.0
scale/scale_scaling_type = 0
scale/scale_range = [Vector3(1, 1, 1), Vector3(1.2, 1.2, 1.2)]
up_vector/up_vector_primary_type = 2
up_vector/up_vector_primary = Vector3(0, 0, 0)
up_vector/up_vector_secondary_type = 2
up_vector/up_vector_secondary = Vector3(0, 0, 0)
up_vector/up_vector_blending = 0.0
fwd_vector/fwd_vector_primary_type = 0
fwd_vector/fwd_vector_primary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_secondary_type = 0
fwd_vector/fwd_vector_secondary = Vector3(0, 0, 0)
fwd_vector/fwd_vector_blending = 0.0
offset/offset_y_range = [0.0, 0.0]
offset/offset_jitter_fraction = 0.6
rotation/rotation_random_y = 180.0
rotation/rotation_random_x = 0.0
rotation/rotation_random_z = 0.0
slope/slope_allowed_range = [0.0, 180.0]
import_export/import_plant_data_button = false
import_export/export_plant_data_button = false
import_export/import_greenhouse_data_button = false
import_export/export_greenhouse_data_button = false
metadata/class = "Greenhouse_Plant"
[sub_resource type="Resource" id="Resource_ewqr2"]
resource_name = "Greenhouse_PlantState"
script = ExtResource("4_mv0mq")
plant/plant_brush_active = true
plant/plant_label = ""
plant/plant = SubResource("Resource_ngah6")
metadata/class = "Greenhouse_PlantState"
[resource]
resource_name = "Greenhouse"
script = ExtResource("1_4qyr5")
plant_types/greenhouse_plant_states = [SubResource("Resource_7bfvu"), SubResource("Resource_3tj40"), SubResource("Resource_ewqr2")]
plant_types/selected_for_edit_resource = SubResource("Resource_ewqr2")
metadata/class = "Greenhouse"

View file

@ -0,0 +1,59 @@
[gd_resource type="Resource" load_steps=7 format=3 uid="uid://dnefvx0rjoc4j"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/toolshed/toolshed_brush.gd" id="1_57hwc"]
[ext_resource type="Script" path="res://addons/dreadpon.spatial_gardener/toolshed/toolshed.gd" id="2_2qdhg"]
[sub_resource type="Resource" id="Resource_qlwh5"]
resource_name = "Toolshed_Brush"
script = ExtResource("1_57hwc")
behavior/behavior_brush_type = 1
shape/shape_volume_size = 39.56
shape/shape_projection_size = 100.0
behavior/behavior_strength = 1.0
behavior/behavior_passthrough = false
behavior/behavior_overlap_mode = 0
behavior/behavior_no_settings_text = "This brush has no additional settings"
metadata/class = "Toolshed_Brush"
[sub_resource type="Resource" id="Resource_5e53n"]
resource_name = "Toolshed_Brush"
script = ExtResource("1_57hwc")
behavior/behavior_brush_type = 0
shape/shape_volume_size = 40.66
shape/shape_projection_size = 1.0
behavior/behavior_strength = 1.0
behavior/behavior_passthrough = false
behavior/behavior_overlap_mode = 0
behavior/behavior_no_settings_text = "This brush has no additional settings"
metadata/class = "Toolshed_Brush"
[sub_resource type="Resource" id="Resource_4npy7"]
resource_name = "Toolshed_Brush"
script = ExtResource("1_57hwc")
behavior/behavior_brush_type = 2
shape/shape_volume_size = 1.0
shape/shape_projection_size = 1.0
behavior/behavior_strength = 1.0
behavior/behavior_passthrough = false
behavior/behavior_overlap_mode = 0
behavior/behavior_no_settings_text = "This brush has no additional settings"
metadata/class = "Toolshed_Brush"
[sub_resource type="Resource" id="Resource_y4dt5"]
resource_name = "Toolshed_Brush"
script = ExtResource("1_57hwc")
behavior/behavior_brush_type = 3
shape/shape_volume_size = 43.96
shape/shape_projection_size = 100.0
behavior/behavior_strength = 1.0
behavior/behavior_passthrough = false
behavior/behavior_overlap_mode = 0
behavior/behavior_no_settings_text = "This brush has no additional settings"
metadata/class = "Toolshed_Brush"
[resource]
resource_name = "Toolshed"
script = ExtResource("2_2qdhg")
brush/brushes = [SubResource("Resource_5e53n"), SubResource("Resource_qlwh5"), SubResource("Resource_4npy7"), SubResource("Resource_y4dt5")]
brush/active_brush = SubResource("Resource_qlwh5")
metadata/class = "Toolshed"

BIN
stages/Test3D/assets/3d/particles/drop_ring.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://q00boel7p3mp"
path.s3tc="res://.godot/imported/drop_ring.png-973720a9fcac2cc565727828e4d4b200.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/3d/particles/drop_ring.png"
dest_files=["res://.godot/imported/drop_ring.png-973720a9fcac2cc565727828e4d4b200.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

BIN
stages/Test3D/assets/3d/particles/flamelet_smooth.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c78jcjh8fjndd"
path.s3tc="res://.godot/imported/flamelet_smooth.png-35d80bc1391ef708885f7969b9836c1d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/3d/particles/flamelet_smooth.png"
dest_files=["res://.godot/imported/flamelet_smooth.png-35d80bc1391ef708885f7969b9836c1d.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

BIN
stages/Test3D/assets/3d/particles/streak.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bttu3yi1kc550"
path.s3tc="res://.godot/imported/streak.png-6d6eaa2d871f1b91eecb3f16cc7b3aed.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Stages/Test3D/assets/3d/particles/streak.png"
dest_files=["res://.godot/imported/streak.png-6d6eaa2d871f1b91eecb3f16cc7b3aed.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.

View file

@ -0,0 +1,27 @@
[gd_resource type="StandardMaterial3D" load_steps=7 format=3 uid="uid://rph7hvv0o8f3"]
[ext_resource type="Texture2D" uid="uid://blck2v7rcmqoe" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_BaseColor.png" id="1_85hlt"]
[ext_resource type="Texture2D" uid="uid://by6vwp6k31hf4" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_AO.png" id="2_1gdm7"]
[ext_resource type="Texture2D" uid="uid://bimaorqp4wcn6" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_Height.exr" id="3_2wswn"]
[ext_resource type="Texture2D" uid="uid://dwh3lkqwqfo24" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_Metallic.png" id="4_ttxfo"]
[ext_resource type="Texture2D" uid="uid://dy5ss16610l60" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_Normal.png" id="5_vglia"]
[ext_resource type="Texture2D" uid="uid://dchfe72gnkkoq" path="res://stages/test3d/assets/3d/player/mr.g_Eyes_Roughness.png" id="6_e3wb6"]
[resource]
resource_name = "Eyes"
cull_mode = 2
albedo_color = Color(0.906332, 0.906332, 0.906332, 1)
albedo_texture = ExtResource("1_85hlt")
metallic = 1.0
metallic_texture = ExtResource("4_ttxfo")
roughness_texture = ExtResource("6_e3wb6")
normal_enabled = true
normal_texture = ExtResource("5_vglia")
ao_enabled = true
ao_texture = ExtResource("2_1gdm7")
heightmap_enabled = true
heightmap_scale = 0.02
heightmap_deep_parallax = true
heightmap_min_layers = 8
heightmap_max_layers = 32
heightmap_texture = ExtResource("3_2wswn")

View file

@ -0,0 +1,24 @@
[gd_resource type="StandardMaterial3D" load_steps=7 format=3 uid="uid://dthhy1nw8io40"]
[ext_resource type="Texture2D" uid="uid://db218233o7587" path="res://stages/test3d/assets/3d/player/mr.g_Hands_BaseColor.png" id="1_0q725"]
[ext_resource type="Texture2D" uid="uid://yn3jqakab1dm" path="res://stages/test3d/assets/3d/player/mr.g_Hands_AO.png" id="2_rtmm7"]
[ext_resource type="Texture2D" uid="uid://d0laf4478ptcu" path="res://stages/test3d/assets/3d/player/mr.g_Hands_Height.exr" id="3_5n1w4"]
[ext_resource type="Texture2D" uid="uid://dt3jgjw3805m7" path="res://stages/test3d/assets/3d/player/mr.g_Hands_Metallic.png" id="4_enmvs"]
[ext_resource type="Texture2D" uid="uid://co7y23q4tlv41" path="res://stages/test3d/assets/3d/player/mr.g_Hands_Normal.png" id="5_ge83j"]
[ext_resource type="Texture2D" uid="uid://duhvy4yt383wj" path="res://stages/test3d/assets/3d/player/mr.g_Hands_Roughness.png" id="6_ebk71"]
[resource]
resource_name = "Hands"
cull_mode = 2
albedo_color = Color(0.906332, 0.906332, 0.906332, 1)
albedo_texture = ExtResource("1_0q725")
metallic = 1.0
metallic_texture = ExtResource("4_enmvs")
roughness_texture = ExtResource("6_ebk71")
normal_enabled = true
normal_texture = ExtResource("5_ge83j")
ao_enabled = true
ao_texture = ExtResource("2_rtmm7")
heightmap_enabled = true
heightmap_scale = 0.02
heightmap_texture = ExtResource("3_5n1w4")

View file

@ -0,0 +1,27 @@
[gd_resource type="StandardMaterial3D" load_steps=7 format=3 uid="uid://kypse11uh4u7"]
[ext_resource type="Texture2D" uid="uid://c0pu73sjasukj" path="res://stages/test3d/assets/3d/player/mr.g_Head_BaseColor.png" id="1_a5ha4"]
[ext_resource type="Texture2D" uid="uid://ct1dimyx2ygjf" path="res://stages/test3d/assets/3d/player/mr.g_Head_AO.png" id="2_0tt17"]
[ext_resource type="Texture2D" uid="uid://8waeog2u0d7" path="res://stages/test3d/assets/3d/player/mr.g_Head_Height.exr" id="3_pgllg"]
[ext_resource type="Texture2D" uid="uid://bfyippl6pfaam" path="res://stages/test3d/assets/3d/player/mr.g_Head_Metallic.png" id="4_5leox"]
[ext_resource type="Texture2D" uid="uid://bfo17xykk3rgs" path="res://stages/test3d/assets/3d/player/mr.g_Head_Normal.png" id="5_r0s2f"]
[ext_resource type="Texture2D" uid="uid://w0o1okud2sn" path="res://stages/test3d/assets/3d/player/mr.g_Head_Roughness.png" id="6_3prao"]
[resource]
resource_name = "Head"
cull_mode = 2
albedo_color = Color(0.906332, 0.906332, 0.906332, 1)
albedo_texture = ExtResource("1_a5ha4")
metallic = 1.0
metallic_texture = ExtResource("4_5leox")
roughness_texture = ExtResource("6_3prao")
normal_enabled = true
normal_texture = ExtResource("5_r0s2f")
ao_enabled = true
ao_texture = ExtResource("2_0tt17")
heightmap_enabled = true
heightmap_scale = 0.02
heightmap_deep_parallax = true
heightmap_min_layers = 8
heightmap_max_layers = 32
heightmap_texture = ExtResource("3_pgllg")

Binary file not shown.

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