add ambient dust particles, nice indication of fields

This commit is contained in:
hiina 2025-02-14 15:00:39 -07:00
parent bdd6be5554
commit c9d96bd236
2 changed files with 68 additions and 1 deletions

View file

@ -0,0 +1,21 @@
extends GPUParticles3D
var _reparent_timer: Timer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# Create and start timer
_reparent_timer = Timer.new()
_reparent_timer.wait_time = 1.0
_reparent_timer.timeout.connect(_try_reparent_to_camera)
add_child(_reparent_timer)
_reparent_timer.start()
# Try initial reparent
_try_reparent_to_camera()
func _try_reparent_to_camera() -> void:
var camera = get_viewport().get_camera_3d()
if camera and get_parent() != camera:
# Reparent to camera
get_parent().remove_child(self)
camera.add_child(self)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=42 format=3 uid="uid://bd86thqpujh3p"]
[gd_scene load_steps=48 format=3 uid="uid://bd86thqpujh3p"]
[ext_resource type="Script" path="res://addons/godot-xr-tools/staging/scene_base.gd" id="1_t86sx"]
[ext_resource type="PackedScene" uid="uid://7uc6tf2tvn1k" path="res://scenes/xr_origin_3d.tscn" id="2_xk21l"]
@ -18,6 +18,7 @@
[ext_resource type="PackedScene" uid="uid://cyd8poa47ir2i" path="res://scenes/performance_settings_menu.tscn" id="14_s5dwy"]
[ext_resource type="PackedScene" uid="uid://bifpsyvpcem3a" path="res://scenes/manipulator.tscn" id="17_uqqr1"]
[ext_resource type="PackedScene" uid="uid://ccmx5v2601k8q" path="res://scenes/visual_attractor_sphere.tscn" id="18_qmvne"]
[ext_resource type="Script" path="res://scenes/ambient_particles.gd" id="19_er8ew"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lvd12"]
albedo_color = Color(0.563626, 0.563626, 0.563625, 1)
@ -144,6 +145,39 @@ size = Vector3(0.2, 0.2, 0.2)
emission_enabled = true
emission = Color(0.208505, 0.70691, 0.626474, 1)
[sub_resource type="Curve" id="Curve_4ehg2"]
_data = [Vector2(0.0015674, 0), 0.0, 0.0, 0, 0, Vector2(0.23511, 1), -0.0427111, -0.0427111, 0, 0, Vector2(0.634796, 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_bdt6v"]
curve = SubResource("Curve_4ehg2")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_afs4e"]
emission_shape = 3
emission_box_extents = Vector3(2, 2, 2)
spread = 180.0
initial_velocity_min = 0.01
initial_velocity_max = 0.03
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_bdt6v")
turbulence_noise_strength = 0.1
turbulence_noise_scale = 4.714
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gxwyq"]
shading_mode = 2
emission_enabled = true
emission = Color(1, 1, 1, 1)
emission_energy_multiplier = 0.1
billboard_mode = 1
billboard_keep_scale = true
distance_fade_mode = 2
distance_fade_min_distance = 1.5
distance_fade_max_distance = 2.0
[sub_resource type="QuadMesh" id="QuadMesh_f40pn"]
material = SubResource("StandardMaterial3D_gxwyq")
size = Vector2(0.005, 0.005)
[node name="TitleScene" type="Node3D"]
script = ExtResource("1_t86sx")
@ -305,6 +339,18 @@ mesh = SubResource("PrismMesh_be80n")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_hyt1m")
[node name="AmbientParticles" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1)
cast_shadow = 0
gi_mode = 0
amount = 2000
lifetime = 3.0
preprocess = 3.0
randomness = 0.28
process_material = SubResource("ParticleProcessMaterial_afs4e")
draw_pass_1 = SubResource("QuadMesh_f40pn")
script = ExtResource("19_er8ew")
[connection signal="target_occupancy_changed" from="ProxyCollisionDetector" to="Target1" method="_on_proxy_collision_detector_target_occupancy_changed"]
[connection signal="target_occupancy_changed" from="ProxyCollisionDetector" to="Target2" method="_on_proxy_collision_detector_target_occupancy_changed"]
[connection signal="target_occupancy_changed" from="ProxyCollisionDetector" to="Target3" method="_on_proxy_collision_detector_target_occupancy_changed"]