diff options
author | tpart <tpart120@proton.me> | 2024-06-26 22:46:41 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-06-26 22:46:41 +0200 |
commit | c44b0f63627c0e0e813e3dc44c1f9dd60e3c097c (patch) | |
tree | b93bba8b0ae653174e9a68b76137573e47c74bb5 /client | |
parent | b4b104991b755e334eeee81ed8ede66e0e2a90eb (diff) | |
download | hurrycurry-c44b0f63627c0e0e813e3dc44c1f9dd60e3c097c.tar hurrycurry-c44b0f63627c0e0e813e3dc44c1f9dd60e3c097c.tar.bz2 hurrycurry-c44b0f63627c0e0e813e3dc44c1f9dd60e3c097c.tar.zst |
Fix colors on OpenGL
Diffstat (limited to 'client')
-rw-r--r-- | client/game.gd | 6 | ||||
-rw-r--r-- | client/global.gd | 10 | ||||
-rw-r--r-- | client/menu/menu_background.gd | 5 | ||||
-rw-r--r-- | client/menu/menu_background.tscn | 2 |
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="."] |