Noise-driven fire light rig with bounce, core, embers and glow

This commit is contained in:
enne2
2026-10-11 02:26:08 +02:00
parent e15deef84f
commit 70c82df450
11 changed files with 440 additions and 22 deletions
+9 -4
View File
@@ -21,18 +21,23 @@ func run_test() -> void:
var flames = office.get_node("FireBarrel/BarrelFlames")
assert(flames is CPUParticles3D and flames.amount == 28 and flames.emitting)
assert(office.fire_light.shadow_enabled)
assert(office.fire_rig is Node3D and office.fire_rig.flame == flames)
for i in 100:
office._process(0.016)
assert(office.fire_light.light_energy >= office.FIRE_MIN and office.fire_light.light_energy <= office.FIRE_MAX)
office.fire_rig._process(0.016)
var energy: float = office.fire_light.light_energy
assert(energy >= office.fire_rig.MIN_ENERGY and energy <= office.fire_rig.MAX_ENERGY)
print("PASS: fiamme CPU leggere e flicker continuo entro limiti")
var lights: Array[Node] = world.find_children("*", "OmniLight3D", true, false)
assert(lights.size() == 4) # due lampade, bidone, muzzle flash
assert(lights.size() == 6) # due lampade, principale + rimbalzo + nucleo, muzzle flash
assert(world.find_children("DeskLampLight", "OmniLight3D", true, false).size() == 2)
var shadow_casters := lights.filter(func(light): return light.shadow_enabled)
assert(shadow_casters.size() == 1 and shadow_casters[0] == office.fire_light)
for node in world.get_children():
assert(not node is OmniLight3D) # nessuna plafoniera
if node is WorldEnvironment:
assert(node.environment.ambient_light_energy <= 0.15)
print("PASS: plafoniera rimossa, ambient basso e quattro luci totali")
assert(node.environment.glow_enabled and node.environment.glow_hdr_threshold >= 1.2)
print("PASS: plafoniera rimossa, ambient basso, una sola luce con ombre su sei totali")
await physics_frame
await physics_frame
var space = world.get_world_3d().direct_space_state