docs/STYLE.md sets Tidewall's look: a drowned coast printed by hand. It has the palette, shape language, character proportions, shading, UI motifs, audio palette and a do-not-do list. - Palette (src/client/style/palette.gd) is the one table of client colours. Every colour that was scattered over the views now names its entry, with values unchanged. test_palette fails on a colour literal anywhere else in src/client or src/app, and on a palette colour the guide doesn't list. - Look sets up the sky, the salt-faded grading (saturation 0.86, contrast 1.05), the sun and the print pass, for the match view and the capture scenes. - folk_print.gdshader is one full-screen quad multiplied over the frame. It draws ink lines at depth jumps and creases (fading with distance, scaled with screen height), diagonal hatching cut into real shadow, and faint paper grain. Ground under the sea gets none. - make style-captures renders a hamlet and a dock with and without the pass. Closes #41 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
2.0 KiB
GDScript
43 lines
2.0 KiB
GDScript
extends TestCase
|
|
|
|
## Issue A1: the shared look. The match view gets the graded environment and the
|
|
## woodcut print pass, and the pass follows the sea.
|
|
|
|
|
|
func test_environment_is_graded_and_uses_the_palette() -> void:
|
|
var environment: Environment = Look.environment()
|
|
assert_true(environment.adjustment_enabled)
|
|
assert_near(environment.adjustment_saturation, Look.SATURATION, 0.0001)
|
|
assert_true(Look.SATURATION < 1.0, "salt-faded: greyer than rendered")
|
|
var sky: ProceduralSkyMaterial = environment.sky.sky_material as ProceduralSkyMaterial
|
|
assert_eq(sky.sky_horizon_color, Palette.SKY_HAZE)
|
|
assert_eq(environment.fog_light_color, Palette.SEA_FOG)
|
|
assert_false(Look.environment(false).adjustment_enabled, "ungraded for comparisons")
|
|
|
|
|
|
func test_match_view_draws_through_the_print_pass() -> void:
|
|
var sim: Simulation = Simulation.new(3, SimGround.flat())
|
|
var view: MatchView = MatchView.new()
|
|
view.setup(sim)
|
|
assert_not_null(view.print_pass)
|
|
assert_eq(view.print_pass.get_parent(), view.camera, "it rides on the camera")
|
|
var material: ShaderMaterial = (view.print_pass.mesh as QuadMesh).material as ShaderMaterial
|
|
assert_eq(material.shader, Look.PRINT_SHADER)
|
|
assert_eq(material.render_priority, Material.RENDER_PRIORITY_MAX, "drawn after everything it darkens")
|
|
assert_eq(material.get_shader_parameter("ink_colour"), Palette.INK)
|
|
sim.set_sea_level(6.5)
|
|
sim.step()
|
|
view.sync()
|
|
assert_near(float(material.get_shader_parameter("sea_level")), view.water.level, 0.0001, "no ink under the sea")
|
|
view.free()
|
|
|
|
|
|
func test_print_shader_compiles() -> void:
|
|
# A shader that fails to compile still loads; its code must at least parse into
|
|
# uniforms, which an invalid one doesn't list.
|
|
var names: Array[String] = []
|
|
for uniform: Dictionary in Look.PRINT_SHADER.get_shader_uniform_list():
|
|
names.append(String(uniform["name"]))
|
|
for wanted: String in ["ink_colour", "strength", "sea_level", "hatch_spacing", "camera_far"]:
|
|
assert_true(names.has(wanted), "uniform %s in %s" % [wanted, names])
|