feat: 3D-Bande mit Sockel, Fugen und mehr Kontrast zum Eis
Eis und Bande waren fast gleich hell, die Kante war kaum zu sehen. Die Bande ist jetzt dreiteilig und deutlich abgesetzt: - petrolfarbener Sockel (0,22 m) als dunkle Trennlinie zum Eis - Bandfläche in kühlerem Graublau mit prozeduraler Fugen-Textur; die Fugen wiederholen sich per world-triplanar alle 2,4 m, auch in den Kurven - rote Reling als obere Kante, leicht abgedunkelt - Eisfläche etwas dunkler, damit sie nicht ausbrennt Tests prüfen Sockel, Textur, Weltkoordinaten-Fugen und Helligkeitsabstand; Sichtprüfung über tests/manual/capture_rink_boards.gd (vier Blickwinkel).
This commit is contained in:
parent
a1d399f575
commit
0325e53984
5 changed files with 175 additions and 4 deletions
67
rinkplanner/tests/manual/capture_rink_boards.gd
Normal file
67
rinkplanner/tests/manual/capture_rink_boards.gd
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
extends SceneTree
|
||||
|
||||
## Rendert die 3D-Bande aus zwei Blickwinkeln für die Sichtprüfung von Farbe,
|
||||
## Sockel und Fugen.
|
||||
##
|
||||
## Aufruf:
|
||||
## godot --path rinkplanner --script res://tests/manual/capture_rink_boards.gd -- /tmp/opencode/rink
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
_capture.call_deferred()
|
||||
|
||||
|
||||
func _capture() -> void:
|
||||
var args := OS.get_cmdline_user_args()
|
||||
var prefix := args[0] if args.size() > 0 else "/tmp/opencode/rink_boards"
|
||||
|
||||
var viewport := SubViewport.new()
|
||||
viewport.size = Vector2i(1280, 720)
|
||||
viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
|
||||
root.add_child(viewport)
|
||||
|
||||
var scene := Node3D.new()
|
||||
viewport.add_child(scene)
|
||||
|
||||
var rink := Rink3D.new()
|
||||
scene.add_child(rink)
|
||||
rink.build(RinkDimensions.new())
|
||||
|
||||
var environment := Environment.new()
|
||||
environment.background_mode = Environment.BG_COLOR
|
||||
environment.background_color = Color("aebdcd")
|
||||
environment.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR
|
||||
environment.ambient_light_color = Color.WHITE
|
||||
environment.ambient_light_energy = 0.6
|
||||
var world_environment := WorldEnvironment.new()
|
||||
world_environment.environment = environment
|
||||
scene.add_child(world_environment)
|
||||
|
||||
var sun := DirectionalLight3D.new()
|
||||
sun.rotation_degrees = Vector3(-50.0, -35.0, 0.0)
|
||||
sun.light_energy = 1.15
|
||||
scene.add_child(sun)
|
||||
|
||||
var camera := Camera3D.new()
|
||||
camera.fov = 50.0
|
||||
camera.far = 250.0
|
||||
scene.add_child(camera)
|
||||
camera.current = true
|
||||
|
||||
var shots := [
|
||||
["overview", Vector3(0.0, 36.0, 40.0), Vector3(0.0, 0.0, 0.0)],
|
||||
["boards", Vector3(14.0, 4.5, 18.0), Vector3(24.0, 0.4, 4.0)],
|
||||
["follow", Vector3(0.0, 6.0, -12.0), Vector3(0.0, 0.6, 6.0)],
|
||||
["inner", Vector3(0.0, 1.7, 0.0), Vector3(0.0, 0.4, -14.0)],
|
||||
]
|
||||
for shot: Array in shots:
|
||||
camera.position = shot[1]
|
||||
camera.look_at(shot[2], Vector3.UP)
|
||||
await process_frame
|
||||
await process_frame
|
||||
await process_frame
|
||||
var image := viewport.get_texture().get_image()
|
||||
var path := "%s_%s.png" % [prefix, shot[0]]
|
||||
image.save_png(path)
|
||||
print("SAVED ", path)
|
||||
quit(0)
|
||||
1
rinkplanner/tests/manual/capture_rink_boards.gd.uid
Normal file
1
rinkplanner/tests/manual/capture_rink_boards.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dqdkopungj75l
|
||||
|
|
@ -48,6 +48,42 @@ func _test_presentation() -> void:
|
|||
presentation.rink.get_node_or_null("CenterCircle") != null,
|
||||
"rink has a center circle"
|
||||
)
|
||||
|
||||
var board := presentation.rink.get_node_or_null("Board000") as MeshInstance3D
|
||||
var kickplate := presentation.rink.get_node_or_null(
|
||||
"Kickplate000"
|
||||
) as MeshInstance3D
|
||||
_check(board != null, "rink has boards")
|
||||
_check(kickplate != null, "boards sit on a kickplate")
|
||||
if board != null and ice != null:
|
||||
var board_material := board.material_override as StandardMaterial3D
|
||||
var ice_material := ice.material_override as StandardMaterial3D
|
||||
_check(board_material != null, "boards carry a material")
|
||||
if board_material != null:
|
||||
_check(
|
||||
board_material.albedo_texture != null,
|
||||
"board material carries the panel texture"
|
||||
)
|
||||
_check(
|
||||
board_material.uv1_world_triplanar,
|
||||
"panel seams repeat in world space"
|
||||
)
|
||||
if ice_material != null:
|
||||
var gap := absf(
|
||||
board_material.albedo_color.get_luminance()
|
||||
- ice_material.albedo_color.get_luminance()
|
||||
)
|
||||
_check(
|
||||
gap >= 0.05,
|
||||
"boards differ from the ice in brightness"
|
||||
)
|
||||
if kickplate != null:
|
||||
var kickplate_material := kickplate.material_override as StandardMaterial3D
|
||||
_check(
|
||||
kickplate_material != null
|
||||
and kickplate_material.albedo_color.get_luminance() < 0.35,
|
||||
"kickplate is dark enough to separate ice and boards"
|
||||
)
|
||||
_check(
|
||||
presentation.skater.get_child_count() > 0,
|
||||
"skater is instantiated"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue