summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/game.gd6
-rw-r--r--client/global.gd10
-rw-r--r--client/menu/menu_background.gd5
-rw-r--r--client/menu/menu_background.tscn2
4 files changed, 22 insertions, 1 deletions
diff --git a/client/game.gd b/client/game.gd
index ab2cdfbd..76ea21f0 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -32,7 +32,13 @@ var item_idx_from_name: Dictionary = {}
var tile_by_pos: Dictionary = {}
var players := {}
+
+@onready var environment = $WorldEnvironment
+
func _ready():
+ if !Global.on_vulkan():
+ environment.environment.tonemap_exposure = 0.5
+
mp.connection_closed.connect(func(reason: String):
Global.error_message = reason;
$SceneTransition.instant_to("res://menu/error_menu.tscn")
diff --git a/client/global.gd b/client/global.gd
index ee1e3e96..42a5eac2 100644
--- a/client/global.gd
+++ b/client/global.gd
@@ -72,6 +72,16 @@ func load_dict(path: String, default: Dictionary) -> Dictionary:
print("Loaded dict: ", res)
return res
+func on_vulkan() -> bool:
+ if OS.has_feature("web"):
+ return false
+ elif OS.has_feature("pc"):
+ return true
+ elif OS.has_feature("mobile"):
+ return false
+ push_error("Unknown platform, assuming vulkan")
+ return true
+
func focus_first_button(node: Node) -> bool:
if node is Button:
node.grab_focus()
diff --git a/client/menu/menu_background.gd b/client/menu/menu_background.gd
index 62c38baa..1d9322f3 100644
--- a/client/menu/menu_background.gd
+++ b/client/menu/menu_background.gd
@@ -19,7 +19,12 @@ extends Node3D
const NULLS = [null,null,null,null]
const BUCKETS = [[], ["floor","floor","floor","floor","tomato-crate", "raw-steak-crate"], ["table", "chair", "counter"], ["sink", "stove"]]
+@onready var environment: WorldEnvironment = $Environment
+
func _ready():
+ if !Global.on_vulkan():
+ environment.environment.tonemap_exposure = 0.25
+
for x in range(-10,11):
for y in range(-10,11):
var w = exp(-sqrt(x*x+y*y) * 0.15)
diff --git a/client/menu/menu_background.tscn b/client/menu/menu_background.tscn
index 951750e9..dbc7010a 100644
--- a/client/menu/menu_background.tscn
+++ b/client/menu/menu_background.tscn
@@ -56,7 +56,7 @@ transform = Transform3D(0.290334, 0.904946, -0.311092, 0.336606, 0.207739, 0.918
light_energy = 1.25
shadow_enabled = true
-[node name="env" type="WorldEnvironment" parent="."]
+[node name="Environment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_slkjl")
[node name="the-sky-tm" type="MeshInstance3D" parent="."]