fix(presentation): simplify camera and engine effects

This commit is contained in:
Josh Creek
2026-08-08 08:44:26 +01:00
parent b7f646ba48
commit e0a1cbaf6d
14 changed files with 56 additions and 241 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ func _draw() -> void:
draw_line(Vector2(-half_chord, horizon_y), Vector2(half_chord, horizon_y), LINE_COLOR, 2.0)
# Pitch ladder: rungs every 10 degrees, labelled, scrolling with pitch.
var font := hud_font()
var font := ThemeDB.fallback_font
for ladder_deg: int in [-30, -20, -10, 10, 20, 30]:
var y := horizon_y - ladder_deg * px_per_deg
if absf(y) > radius - 12.0:
+1 -1
View File
@@ -37,7 +37,7 @@ func _process(delta: float) -> void:
func _draw() -> void:
var font := hud_font()
var font := ThemeDB.fallback_font
var fraction := clampf(_value / max_value, 0.0, 1.0)
var reading := value_format % _value
+1 -1
View File
@@ -39,7 +39,7 @@ func _process(delta: float) -> void:
func _draw() -> void:
var font := hud_font()
var font := ThemeDB.fallback_font
var center_x := size.x / 2.0
var px_per_deg := size.x / VISIBLE_RANGE
-8
View File
@@ -23,11 +23,3 @@ static func angle_delta_deg(from: float, to: float) -> float:
func _smoothing_weight(delta: float) -> float:
return 1.0 - exp(-SMOOTHING * delta) # frame-rate independent
# Procedural draw calls do not automatically consume a Control's theme font;
# resolve it explicitly so every instrument uses the same packaged typeface
# as ordinary Labels instead of ThemeDB's debug-looking fallback.
func hud_font() -> Font:
var font := get_theme_default_font()
return font if font else ThemeDB.fallback_font
+42 -28
View File
@@ -117,8 +117,7 @@ const ATTITUDE_THRESHOLD = 1.0 # degrees
const THRUST_THRESHOLD = 1.0 # percent
var _engine_cores: Array[MeshInstance3D] = []
var _engine_plumes: Array[GPUParticles3D] = []
var _turbo_flames: Array[GPUParticles3D] = []
var _engine_flames: Array[MeshInstance3D] = []
var _engine_lights: Array[OmniLight3D] = []
var _impact_sparks: GPUParticles3D
@@ -215,7 +214,7 @@ func _build_movement_vfx() -> void:
for x in [-0.42, 0.42]:
var engine_pos := Vector3(x, -0.05, 1.42)
var core_mat := _vfx_material(Color(0.35, 0.85, 1.0, 1.0), 1.0)
var core_mat := _vfx_material(Color(1.0, 0.48, 0.1, 1.0), 1.0)
var core_mesh := SphereMesh.new()
core_mesh.radius = 0.11
core_mesh.height = 0.22
@@ -228,28 +227,37 @@ func _build_movement_vfx() -> void:
add_child(core)
_engine_cores.append(core)
var plume := _make_particles(
"EnginePlumeL" if x < 0.0 else "EnginePlumeR",
Color(0.3, 0.82, 1.0, 0.72), Vector2(0.16, 0.42), 36, 0.24,
Vector3(0, 0, 1), 12.0, 2.0, 5.0
)
plume.position = engine_pos + Vector3(0, 0, 0.08)
add_child(plume)
_engine_plumes.append(plume)
var turbo := _make_particles(
"TurboFlameL" if x < 0.0 else "TurboFlameR",
Color(0.78, 0.34, 1.0, 0.9), Vector2(0.22, 0.72), 48, 0.18,
Vector3(0, 0, 1), 7.0, 6.0, 10.0
)
turbo.position = engine_pos + Vector3(0, 0, 0.12)
add_child(turbo)
_turbo_flames.append(turbo)
# A single conventional orange flame replaces the layered particle plume
# and separate purple turbo effect. Turbo only lengthens and brightens the
# same flame, keeping the engine silhouette simple and readable.
var flame_mat := StandardMaterial3D.new()
flame_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
flame_mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
flame_mat.cull_mode = BaseMaterial3D.CULL_DISABLED
flame_mat.albedo_color = Color(1.0, 0.34, 0.04, 0.92)
flame_mat.emission_enabled = true
flame_mat.emission = Color(1.0, 0.16, 0.015)
flame_mat.emission_energy_multiplier = 2.0
var flame_mesh := CylinderMesh.new()
flame_mesh.top_radius = 0.015
flame_mesh.bottom_radius = 0.14
flame_mesh.height = 1.0
flame_mesh.radial_segments = 12
flame_mesh.material = flame_mat
var flame := MeshInstance3D.new()
flame.name = "EngineFlameL" if x < 0.0 else "EngineFlameR"
flame.position = engine_pos + Vector3(0, 0, 0.3)
flame.rotation_degrees.x = 90.0
flame.mesh = flame_mesh
flame.visible = false
flame.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
add_child(flame)
_engine_flames.append(flame)
var light := OmniLight3D.new()
light.name = "EngineLightL" if x < 0.0 else "EngineLightR"
light.position = engine_pos
light.light_color = Color(0.3, 0.75, 1.0)
light.light_color = Color(1.0, 0.32, 0.08)
light.omni_range = 3.5
light.omni_attenuation = 2.0
light.shadow_enabled = false
@@ -308,18 +316,24 @@ func _make_particles(
func _update_movement_vfx() -> void:
if _engine_plumes.is_empty():
if _engine_flames.is_empty():
return
# These are the two rear main engines, so lateral/vertical maneuvering jets
# must not make them flare. Reverse thrust also comes from separate attitude
# jets conceptually; only positive Z drives this rear-facing plume.
# jets conceptually; only positive Z drives this rear-facing flame.
var thrust := clampf(maxf(_current_action.thrust.z, 0.0), 0.0, 1.0)
var turbo := _current_action.turbo and thrust > 0.05
for i in _engine_plumes.size():
_engine_plumes[i].emitting = thrust > 0.02
_engine_plumes[i].amount_ratio = 0.25 + thrust * 0.75
_engine_plumes[i].speed_scale = 0.65 + thrust * 0.75
_turbo_flames[i].emitting = turbo
for i in _engine_flames.size():
var flame := _engine_flames[i]
var flame_length := 0.28 + thrust * 0.82 + (0.62 if turbo else 0.0)
var flame_width := 0.72 + thrust * 0.32 + (0.12 if turbo else 0.0)
flame.visible = thrust > 0.02
flame.scale = Vector3(flame_width, flame_length, flame_width)
# CylinderMesh is centred on local Y (rotated to ship +Z), so moving its
# centre by half the length keeps the flame root fixed at the engine bell.
flame.position.z = 1.48 + flame_length * 0.5
var flame_mat := flame.mesh.material as StandardMaterial3D
flame_mat.emission_energy_multiplier = 1.8 + thrust * 2.2 + (1.8 if turbo else 0.0)
_engine_lights[i].light_energy = 0.35 + thrust * 2.1 + (2.3 if turbo else 0.0)
var core_mat := _engine_cores[i].mesh.material as StandardMaterial3D
core_mat.emission_energy_multiplier = 0.65 + thrust * 2.0 + (2.0 if turbo else 0.0)
+1 -6
View File
@@ -183,9 +183,6 @@ func _update_speed_feel(delta: float) -> void:
_effective_distance = lerpf(
_effective_distance, camera_distance + _turbo_blend * turbo_distance_kick, feel_t
)
post_material.set_shader_parameter(
"motion_blur_amount", _speed_blend * _speed_blend * 0.006 + _turbo_blend * 0.006
)
post_material.set_shader_parameter("chromatic_aberration", _turbo_blend * 0.007)
post_material.set_shader_parameter("vignette_strength", 0.22 + _turbo_blend * 0.16)
@@ -233,8 +230,7 @@ func begin_goal_cut(goal_position: Vector3) -> void:
camera.fov = 58.0
camera.look_at(_goal_cut_look_at, Vector3.UP)
# A hard, stationary cinematic camera must not inherit the scoring frame's
# ship-speed smear or turbo chroma. Keep only a deliberate cinematic edge.
post_material.set_shader_parameter("motion_blur_amount", 0.0)
# turbo chroma; keep only a deliberate cinematic edge.
post_material.set_shader_parameter("chromatic_aberration", 0.0)
post_material.set_shader_parameter("vignette_strength", 0.3)
@@ -243,6 +239,5 @@ func end_goal_cut() -> void:
_goal_cut_active = false
_speed_blend = 0.0
_turbo_blend = 0.0
post_material.set_shader_parameter("motion_blur_amount", 0.0)
post_material.set_shader_parameter("chromatic_aberration", 0.0)
post_material.set_shader_parameter("vignette_strength", 0.22)