- BubbleTrail.gd: GPUParticles3D, auto-configured in _ready, set_intensity() API - BlockBreakParticles.gd: one_shot burst, emit_burst(pos, color) API - DolphinController.gd: bubble_trail onready + speed_factor hook in _update_movement - Dolphin.tscn: BubbleEmitterPoint (0,0,1.2) > BubbleTrail child added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
56 lines
1.5 KiB
GDScript
56 lines
1.5 KiB
GDScript
extends WorldEnvironment
|
|
|
|
func _ready() -> void:
|
|
var env := Environment.new()
|
|
|
|
env.background_mode = Environment.BG_COLOR
|
|
env.background_color = Color(0.03, 0.12, 0.22)
|
|
|
|
env.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR
|
|
env.ambient_light_color = Color(0.2, 0.4, 0.6)
|
|
env.ambient_light_energy = 0.4
|
|
|
|
env.fog_enabled = true
|
|
env.fog_light_color = Color(0.1, 0.3, 0.5)
|
|
env.fog_density = 0.02
|
|
env.fog_aerial_perspective = 0.3
|
|
|
|
env.volumetric_fog_enabled = true
|
|
env.volumetric_fog_density = 0.05
|
|
env.volumetric_fog_albedo = Color(0.2, 0.5, 0.7)
|
|
env.volumetric_fog_emission = Color(0.02, 0.06, 0.1)
|
|
env.volumetric_fog_emission_energy = 0.1
|
|
env.volumetric_fog_length = 64.0
|
|
env.volumetric_fog_detail_spread = 2.0
|
|
|
|
# Attach custom fog shader
|
|
var fog_mat := FogMaterial.new()
|
|
var fog_shader := load("res://shaders/underwater_fog.gdshader")
|
|
if fog_shader:
|
|
fog_mat.set_shader(fog_shader)
|
|
|
|
var fog_volume := FogVolume.new()
|
|
fog_volume.size = Vector3(2000.0, 300.0, 2000.0)
|
|
fog_volume.material = fog_mat
|
|
add_child(fog_volume)
|
|
|
|
env.glow_enabled = true
|
|
env.glow_intensity = 0.5
|
|
env.glow_bloom = 0.1
|
|
env.glow_blend_mode = Environment.GLOW_BLEND_MODE_SOFTLIGHT
|
|
|
|
env.ssao_enabled = true
|
|
env.ssao_radius = 1.0
|
|
env.ssao_intensity = 1.0
|
|
env.ssao_power = 1.5
|
|
env.ssao_detail = 0.5
|
|
|
|
env.tone_mapper = Environment.TONE_MAPPER_FILMIC
|
|
env.exposure = 1.0
|
|
|
|
env.adjustment_enabled = true
|
|
env.adjustment_saturation = 1.1
|
|
env.adjustment_color_correction = null
|
|
|
|
environment = env
|