feat: lit particle shader for nebula dust weather effect

Replace NebulaDust's flat unshaded glow material with a custom
ShaderMaterial: a fake per-pixel puff normal on the billboarded quad
feeds a light() override so motes catch the directional light and a
nebula-core color bias, alpha gets a depth-texture soft-particle fade
so motes no longer hard-clip through boundary/decoration geometry,
and a per-particle hash adds subtle sparkle.
This commit is contained in:
Josh Creek
2026-08-04 07:42:34 +01:00
parent 73fb83a0da
commit 6f5ce488a9
3 changed files with 63 additions and 13 deletions
+10 -12
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3]
[gd_scene load_steps=16 format=3]
[ext_resource type="Script" path="res://scripts/arena.gd" id="1_iywne"]
[ext_resource type="PackedScene" path="res://objects/arena_boundary.tscn" id="2_bndry"]
@@ -8,6 +8,7 @@
[ext_resource type="PackedScene" path="res://assets/models/nebula_debris.glb" id="9_debris"]
[ext_resource type="Texture2D" path="res://assets/textures/particle_glow.png" id="10_dust"]
[ext_resource type="PackedScene" path="res://assets/models/nebula_planet.glb" id="11_planet"]
[ext_resource type="Shader" path="res://shaders/nebula_dust.gdshader" id="12_dust_shader"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_nebula"]
panorama = ExtResource("7_nebula")
@@ -39,19 +40,16 @@ adjustment_brightness = 1.0
adjustment_contrast = 1.05
adjustment_saturation = 1.08
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dust"]
transparency = 1
shading_mode = 0
billboard_mode = 1
vertex_color_use_as_albedo = true
albedo_color = Color(1, 0.75, 0.9, 1)
albedo_texture = ExtResource("10_dust")
emission_enabled = true
emission = Color(1, 0.6, 0.85, 1)
emission_energy_multiplier = 2.5
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dust"]
shader = ExtResource("12_dust_shader")
shader_parameter/albedo_tex = ExtResource("10_dust")
shader_parameter/core_bias_color = Color(1, 0.6, 0.85, 1)
shader_parameter/core_bias_amount = 0.35
shader_parameter/emission_strength = 2.5
shader_parameter/soft_fade_distance = 1.0
[sub_resource type="QuadMesh" id="QuadMesh_dust"]
material = SubResource("StandardMaterial3D_dust")
material = SubResource("ShaderMaterial_dust")
size = Vector2(0.4, 0.4)
[sub_resource type="Gradient" id="Gradient_dust"]