add palette size to room config

This commit is contained in:
yuki 2025-11-25 17:34:53 -03:00
parent 35fd47731b
commit 62abadad2a
2 changed files with 3 additions and 0 deletions

View file

@ -22,6 +22,8 @@ class_name RoomConfig extends Resource
@export var modulate_color: Color
## Color palette for the room.
@export var room_palette: Texture2D = preload("uid://h5523ru86vrd")
## Number of colors in palette.
@export var palette_size: int = 120
@export_group('Room Loop')
## Whether the room loops itself or not.

View file

@ -15,6 +15,7 @@ func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
var ps_material: ShaderMaterial = room.palette_shader.material as ShaderMaterial
assert(ps_material != null, "palette shader is null")
ps_material.set_shader_parameter("palette", room.config.room_palette)
ps_material.set_shader_parameter("palette_size", room.config.palette_size)
room.player.enable_point_light(true, 0.4)
room.player.point_light.texture_scale = 0