Fixing strange blacking out of shadows issue
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 49s
Deploy Promiscuity Character API / deploy (push) Successful in 47s
Deploy Promiscuity Crafting API / deploy (push) Successful in 48s
Deploy Promiscuity Inventory API / deploy (push) Successful in 48s
Deploy Promiscuity Locations API / deploy (push) Successful in 49s
Deploy Promiscuity Mail API / deploy (push) Successful in 48s
Deploy Promiscuity World API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 9s
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 49s
Deploy Promiscuity Character API / deploy (push) Successful in 47s
Deploy Promiscuity Crafting API / deploy (push) Successful in 48s
Deploy Promiscuity Inventory API / deploy (push) Successful in 48s
Deploy Promiscuity Locations API / deploy (push) Successful in 49s
Deploy Promiscuity Mail API / deploy (push) Successful in 48s
Deploy Promiscuity World API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 9s
This commit is contained in:
parent
d4b780229d
commit
ff1ebef34f
@ -1,7 +1,7 @@
|
||||
extends Node3D
|
||||
|
||||
@export var day_length := 120.0 # seconds for full rotation
|
||||
@export var start_light_angle := -90.0
|
||||
@export var start_light_angle := -35.0
|
||||
@export var show_spawn_dialog := true
|
||||
@export_multiline var spawn_dialog_text := "Welcome to Promiscuity.\n\nPress E to close this message."
|
||||
@export var spawn_dialog_auto_close_seconds := 4.0
|
||||
@ -35,6 +35,7 @@ const FIRST_QUEST := {
|
||||
}
|
||||
|
||||
func _ready() -> void:
|
||||
_apply_sun_state(0.0)
|
||||
_setup_quests()
|
||||
if _should_show_spawn_dialog() and DialogSystem and DialogSystem.has_method("show_text"):
|
||||
await get_tree().process_frame
|
||||
@ -48,15 +49,16 @@ func _ready() -> void:
|
||||
|
||||
func _process(delta):
|
||||
time = fmod((time + delta), day_length)
|
||||
var t = time / day_length
|
||||
_apply_sun_state(time / day_length)
|
||||
|
||||
# Rotate sun around X axis
|
||||
var angle = lerp(start_light_angle, end_light_angle, t) # sunrise → sunset → night → sunrise
|
||||
|
||||
func _apply_sun_state(t: float) -> void:
|
||||
# Start in a clear daytime state instead of at the horizon, which created
|
||||
# long harsh shadows as soon as the level loaded.
|
||||
var angle = lerp(start_light_angle, end_light_angle, t)
|
||||
sun.rotation_degrees.x = angle
|
||||
|
||||
# Adjust intensity
|
||||
var curSin = -sin((t * TAU) + start_radians)
|
||||
var energy = clamp((curSin * 1.0) + 0.2, 0.0, 1.2)
|
||||
var cur_sin = -sin((t * TAU) + start_radians)
|
||||
var energy = clamp((cur_sin * 1.0) + 0.2, 0.0, 1.2)
|
||||
sun.light_energy = energy
|
||||
|
||||
|
||||
|
||||
@ -336,9 +336,11 @@ buffer = PackedFloat32Array(0.87002033, 0, 0.49301583, -5.6112704, 0, 1, 0, 1, -
|
||||
sky_material = SubResource("ProceduralSkyMaterial_fi66n")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_a4mo8"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_a4mo8")
|
||||
ambient_light_source = 3
|
||||
background_mode = 1
|
||||
background_color = Color(0.55, 0.72, 0.92, 1)
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
ambient_light_energy = 0.8
|
||||
|
||||
[node name="Node3D" type="Node3D"]
|
||||
script = ExtResource("1_a4mo8")
|
||||
@ -449,6 +451,7 @@ mesh = SubResource("BoxMesh_w7c3h")
|
||||
[node name="SimpleGrassTextured" type="MultiMeshInstance3D" parent="Ground"]
|
||||
multimesh = SubResource("MultiMesh_px5jg")
|
||||
script = ExtResource("11_1meta")
|
||||
cast_shadow = 0
|
||||
texture_albedo = ExtResource("10_loupo")
|
||||
sgt_radius = 2.0
|
||||
sgt_density = 25
|
||||
@ -467,7 +470,7 @@ metadata/_custom_type_script = "uid://2juaclm8gc1n"
|
||||
metadata/SimpleGrassTextured = "2.0.5"
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.5, 0.8660253, 0, -0.8660253, 0.5, 0, 34, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.819152, 0.573576, 0, -0.573576, 0.819152, 0, 6, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Starter Blocks" type="Node3D" parent="."]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user