From f922bcb8c79fc72b4dc51f4a157103d287e6fa4a Mon Sep 17 00:00:00 2001 From: Benjamin Navarro Date: Wed, 8 Jan 2020 10:49:19 +0100 Subject: [PATCH] Add dynamic split screen demo Answering PR reviews Removeing class_name _get_split_state documentation Mentioning Voronoi split screen in README Fixing comments Use the same script for both players The input map is configured to work with AZERTY and QWERTY keyboards Use spaces for comments alignment + code style Fix empty line and incorrect comment Add arrow keys to control player 2 Removing most static typing as suggested for demo projects Removing broken split origin feature Removing the floor texture to avoid copyright issues Changing game icon Make Walls.gd a tool script + randomize Fixing style Handle joysticks for player movement --- .../dynamic_split_screen/CameraController.gd | 113 +++ .../dynamic_split_screen/PlayerMovement.gd | 16 + viewport/dynamic_split_screen/README.md | 24 + .../dynamic_split_screen/SplitScreen.shader | 74 ++ .../dynamic_split_screen/SplitScreen.tscn | 843 ++++++++++++++++++ viewport/dynamic_split_screen/Walls.gd | 13 + .../WorldEnvironment.tscn | 11 + .../dynamic_split_screen/default_env.tres | 29 + viewport/dynamic_split_screen/icon.png | Bin 0 -> 11945 bytes viewport/dynamic_split_screen/icon.png.import | 34 + viewport/dynamic_split_screen/project.godot | 87 ++ 11 files changed, 1244 insertions(+) create mode 100644 viewport/dynamic_split_screen/CameraController.gd create mode 100644 viewport/dynamic_split_screen/PlayerMovement.gd create mode 100644 viewport/dynamic_split_screen/README.md create mode 100644 viewport/dynamic_split_screen/SplitScreen.shader create mode 100644 viewport/dynamic_split_screen/SplitScreen.tscn create mode 100644 viewport/dynamic_split_screen/Walls.gd create mode 100644 viewport/dynamic_split_screen/WorldEnvironment.tscn create mode 100644 viewport/dynamic_split_screen/default_env.tres create mode 100644 viewport/dynamic_split_screen/icon.png create mode 100644 viewport/dynamic_split_screen/icon.png.import create mode 100644 viewport/dynamic_split_screen/project.godot diff --git a/viewport/dynamic_split_screen/CameraController.gd b/viewport/dynamic_split_screen/CameraController.gd new file mode 100644 index 00000000..c75cc3f7 --- /dev/null +++ b/viewport/dynamic_split_screen/CameraController.gd @@ -0,0 +1,113 @@ +extends Spatial + +# Handle the motion of both players' camera as well as communication with the +# SplitScreen shader to achieve the dynamic split screen effet +# +# Cameras are place on the segment joining the two players, either in the middle +# if players are close enough or at a fixed distance if they are not. +# In the first case, both cameras being at the same location, only the view of +# the first one is used for the entire screen thus allowing the players to play +# on a unsplit screen. +# In the second case, the screen is split in two with a line perpendicular to the +# segement joining the two players. +# +# The points of customization are: +# max_separation: the distance between players at which the view starts to split +# split_line_thickness: the thickness of the split line in pixels +# split_line_color: color of the split line +# adaptive_split_line_thickness: if true, the split line thickness will vary +# depending on the distance between players. If false, the thickness will +# be constant and equal to split_line_thickness + +export(float) var max_separation = 20.0 +export(float) var split_line_thickness = 3.0 +export(Color, RGBA) var split_line_color = Color(0.0, 0.0, 0.0, 1.0) +export(bool) var adaptive_split_line_thickness = true + +onready var player1 = $'../Player1' +onready var player2 = $'../Player2' +onready var camera1: Camera = $'Viewport1/Camera1' +onready var camera2: Camera = $'Viewport2/Camera2' +onready var view: TextureRect = $'View' + + +func _ready(): + _on_size_changed() + _update_splitscreen() + + get_viewport().connect("size_changed", self, "_on_size_changed") + + view.material.set_shader_param('viewport1', $Viewport1.get_texture()) + view.material.set_shader_param('viewport2', $Viewport2.get_texture()) + + +func _process(delta): + _move_cameras() + _update_splitscreen() + + +func _move_cameras(): + var position_difference = _compute_position_difference_in_world() + + var distance = clamp(_compute_horizontal_length(position_difference), 0, max_separation) + + position_difference = position_difference.normalized() * distance + + camera1.translation.x = player1.translation.x + position_difference.x / 2.0 + camera1.translation.z = player1.translation.z + position_difference.z / 2.0 + + camera2.translation.x = player2.translation.x - position_difference.x / 2.0 + camera2.translation.z = player2.translation.z - position_difference.z / 2.0 + + +func _update_splitscreen(): + var screen_size = get_viewport().get_visible_rect().size + + var player1_position = camera1.unproject_position(player1.translation) + player1_position.x /= screen_size.x; + player1_position.y /= screen_size.y; + + var player2_position = camera2.unproject_position(player2.translation) + player2_position.x /= screen_size.x; + player2_position.y /= screen_size.y; + + var thickness + if adaptive_split_line_thickness: + var position_difference = _compute_position_difference_in_world() + var distance = _compute_horizontal_length(position_difference) + thickness = lerp(0, split_line_thickness, (distance - max_separation) / max_separation) + thickness = clamp(thickness, 0, split_line_thickness) + else: + thickness = split_line_thickness + + view.material.set_shader_param('split_active', _get_split_state()) + view.material.set_shader_param('player1_position', player1_position) + view.material.set_shader_param('player2_position', player2_position) + view.material.set_shader_param('split_line_thickness', thickness) + view.material.set_shader_param('split_line_color', split_line_color) + + +# Split screen is active if players are too far apart from each other. +# Only the horizontal components (x, z) are used for distance computation +func _get_split_state(): + var position_difference = _compute_position_difference_in_world() + var separation_distance = _compute_horizontal_length(position_difference) + return separation_distance > max_separation + + +func _on_size_changed(): + var screen_size = get_viewport().get_visible_rect().size + + $Viewport1.size = screen_size + $Viewport2.size = screen_size + view.rect_size = screen_size + + view.material.set_shader_param('viewport_size', screen_size) + + +func _compute_position_difference_in_world(): + return player2.translation - player1.translation + + +func _compute_horizontal_length(vec): + return Vector2(vec.x, vec.z).length() diff --git a/viewport/dynamic_split_screen/PlayerMovement.gd b/viewport/dynamic_split_screen/PlayerMovement.gd new file mode 100644 index 00000000..ea48d422 --- /dev/null +++ b/viewport/dynamic_split_screen/PlayerMovement.gd @@ -0,0 +1,16 @@ +extends KinematicBody + +# Moves the player + +export(int, 1, 2) var player_id = 1 +export(float) var walk_speed = 20.0 + + +func _physics_process(delta): + var velocity = Vector3.ZERO + velocity.z = -Input.get_action_strength("move_up_player" + str(player_id)) + velocity.z += Input.get_action_strength("move_down_player" + str(player_id)) + velocity.x = -Input.get_action_strength("move_left_player" + str(player_id)) + velocity.x += Input.get_action_strength("move_right_player" + str(player_id)) + + move_and_slide(velocity.normalized() * walk_speed) diff --git a/viewport/dynamic_split_screen/README.md b/viewport/dynamic_split_screen/README.md new file mode 100644 index 00000000..d6dc097c --- /dev/null +++ b/viewport/dynamic_split_screen/README.md @@ -0,0 +1,24 @@ +# The project +This sample project showcases an implementation of dynamic split screen, also called Voronoi split screen, using the [Godot engine](https://godotengine.org). + +# Dynamic split screen +A dynamic split screen system displays a single screen when the two players are close but a splitted view when they move apart. + +The splitting line can take any angle depending on the players' position, so it won't be either vertical or horizontal. + +This system was popularized by the Lego videogames. + +# How it works +Two cameras are placed inside two separate viewports and their texture, as well as some other parameters, are passed to a shader attached to a TextureRect filling the whole screen. + +The `SplitScreen` shader, with the help of the `CameraController` script, chooses wich texture to display on each pixel to achieve the effect. + +The cameras are placed on the segment joining the two players, either in the middle if they're close enough or at a fixed distance otherwise. + +# How to use it +Open and launch the project inside the Godot engine and then you can use WASD keys to move the first player and IJKL keys to move the second one. + +The `Cameras` node has parameters to tune the distance at which the screen splits and also the width and color of the splitting line. + +# Try it out +An HTML5 export is testable [here](https://benjaminnavarro.github.io/godot_dynamic_split_screen/index.html). diff --git a/viewport/dynamic_split_screen/SplitScreen.shader b/viewport/dynamic_split_screen/SplitScreen.shader new file mode 100644 index 00000000..d2c95462 --- /dev/null +++ b/viewport/dynamic_split_screen/SplitScreen.shader @@ -0,0 +1,74 @@ +shader_type canvas_item; +render_mode unshaded; + +uniform vec2 viewport_size; // size in pixels of the viewport. Cannot be access from the shader in GLES2 +uniform sampler2D viewport1 : hint_albedo; +uniform sampler2D viewport2 : hint_albedo; +uniform bool split_active; // true: split screen, false: use view1 +uniform vec2 player1_position; // position of player 1 un UV coordinates +uniform vec2 player2_position; // position of player 2 un UV coordinates +uniform float split_line_thickness; // width of the split boder +uniform vec4 split_line_color; // color of the split border + + +// from https://stackoverflow.com/questions/15276454/is-it-possible-to-draw-line-thickness-in-a-fragment-shader +float distanceToLine(vec2 p1, vec2 p2, vec2 point) { + float a = p1.y - p2.y; + float b = p2.x - p1.x; + return abs(a * point.x + b * point.y + p1.x * p2.y - p2.x * p1.y) / sqrt(a * a + b * b); +} + +void fragment() { + vec3 view1 = texture(viewport1, UV).rgb; + vec3 view2 = texture(viewport2, UV).rgb; + + float width = viewport_size.x; + float height = viewport_size.y; + + if (split_active) { + vec2 dx = player2_position - player1_position; + float split_slope; + + if (dx.y != 0.0) { + split_slope = dx.x / dx.y; + } + else { + split_slope = 100000.0; // High value (vertical split) if dx.y = 0 + } + + vec2 split_origin = vec2(0.5, 0.5); + vec2 split_line_start = vec2(0.0, height * ((split_origin.x - 0.0) * split_slope + split_origin.y)); + vec2 split_line_end = vec2(width, height * ((split_origin.x - 1.0) * split_slope + split_origin.y)); + float distance_to_split_line = distanceToLine(split_line_start, split_line_end, vec2(UV.x * width, UV.y * height)); + + // Draw split border if close enough + if (distance_to_split_line < split_line_thickness) { + COLOR = split_line_color; + } + else { + float split_current_y = (split_origin.x - UV.x) * split_slope + split_origin.y; + float split_player1_position_y = (split_origin.x - player1_position.x) * split_slope + split_origin.y; + + // Check on which side of the split UV is and select the proper view + if (UV.y > split_current_y) { + if (player1_position.y > split_player1_position_y) { + COLOR = vec4(view1, 1.0); + } + else { + COLOR = vec4(view2, 1.0); + } + } + else { + if (player1_position.y < split_player1_position_y) { + COLOR = vec4(view1, 1.0); + } + else { + COLOR = vec4(view2, 1.0); + } + } + } + } + else { + COLOR = vec4(view1, 1.0); + } +} diff --git a/viewport/dynamic_split_screen/SplitScreen.tscn b/viewport/dynamic_split_screen/SplitScreen.tscn new file mode 100644 index 00000000..988d02dd --- /dev/null +++ b/viewport/dynamic_split_screen/SplitScreen.tscn @@ -0,0 +1,843 @@ +[gd_scene load_steps=59 format=2] + +[ext_resource path="res://WorldEnvironment.tscn" type="PackedScene" id=1] +[ext_resource path="res://CameraController.gd" type="Script" id=2] +[ext_resource path="res://SplitScreen.shader" type="Shader" id=3] +[ext_resource path="res://icon.png" type="Texture" id=4] +[ext_resource path="res://PlayerMovement.gd" type="Script" id=5] +[ext_resource path="res://Walls.gd" type="Script" id=6] + +[sub_resource type="ShaderMaterial" id=1] +shader = ExtResource( 3 ) +shader_param/viewport_size = null +shader_param/split_active = null +shader_param/player1_position = null +shader_param/player2_position = null +shader_param/split_line_thickness = null +shader_param/split_line_color = null + +[sub_resource type="CapsuleMesh" id=2] + +[sub_resource type="SpatialMaterial" id=3] +albedo_color = Color( 0.933333, 0.0784314, 0.0784314, 1 ) + +[sub_resource type="CapsuleShape" id=4] +radius = 1.00505 + +[sub_resource type="SpatialMaterial" id=5] +albedo_color = Color( 0.0784314, 0.411765, 0.933333, 1 ) + +[sub_resource type="SpatialMaterial" id=6] + +[sub_resource type="PlaneMesh" id=7] +material = SubResource( 6 ) +size = Vector2( 200, 200 ) + +[sub_resource type="BoxShape" id=8] + +[sub_resource type="BoxShape" id=9] + +[sub_resource type="SpatialMaterial" id=10] +albedo_color = Color( 0.216745, 0.554409, 0.314699, 1 ) + +[sub_resource type="CubeMesh" id=11] + +[sub_resource type="SpatialMaterial" id=12] +albedo_color = Color( 0.305405, 0.88821, 0.395714, 1 ) + +[sub_resource type="SpatialMaterial" id=13] +albedo_color = Color( 0.51251, 0.338898, 0.955708, 1 ) + +[sub_resource type="SpatialMaterial" id=14] +albedo_color = Color( 0.226943, 0.905497, 0.613352, 1 ) + +[sub_resource type="SpatialMaterial" id=15] +albedo_color = Color( 0.981949, 0.643245, 0.544702, 1 ) + +[sub_resource type="SpatialMaterial" id=16] +albedo_color = Color( 0.866943, 0.814262, 0.0451389, 1 ) + +[sub_resource type="SpatialMaterial" id=17] +albedo_color = Color( 0.644941, 0.278132, 0.847472, 1 ) + +[sub_resource type="SpatialMaterial" id=18] +albedo_color = Color( 0.195857, 0.55957, 0.975027, 1 ) + +[sub_resource type="SpatialMaterial" id=19] +albedo_color = Color( 0.962396, 0.768307, 0.272148, 1 ) + +[sub_resource type="SpatialMaterial" id=20] +albedo_color = Color( 0.0218338, 0.630367, 0.701396, 1 ) + +[sub_resource type="SpatialMaterial" id=21] +albedo_color = Color( 0.730764, 0.468268, 0.954273, 1 ) + +[sub_resource type="SpatialMaterial" id=22] +albedo_color = Color( 0.136579, 0.540391, 0.852438, 1 ) + +[sub_resource type="SpatialMaterial" id=23] +albedo_color = Color( 0.148986, 0.774603, 0.599427, 1 ) + +[sub_resource type="SpatialMaterial" id=24] +albedo_color = Color( 0.232976, 0.129002, 0.0511244, 1 ) + +[sub_resource type="SpatialMaterial" id=25] +albedo_color = Color( 0.209617, 0.264843, 0.776664, 1 ) + +[sub_resource type="SpatialMaterial" id=26] +albedo_color = Color( 0.0224221, 0.0494852, 0.371403, 1 ) + +[sub_resource type="SpatialMaterial" id=27] +albedo_color = Color( 0.0372276, 0.959928, 0.183207, 1 ) + +[sub_resource type="SpatialMaterial" id=28] +albedo_color = Color( 0.0966038, 0.326089, 0.233914, 1 ) + +[sub_resource type="SpatialMaterial" id=29] +albedo_color = Color( 0.187928, 0.614021, 0.219056, 1 ) + +[sub_resource type="SpatialMaterial" id=30] +albedo_color = Color( 0.259084, 0.601876, 0.565821, 1 ) + +[sub_resource type="SpatialMaterial" id=31] +albedo_color = Color( 0.744452, 0.6155, 0.965371, 1 ) + +[sub_resource type="SpatialMaterial" id=32] +albedo_color = Color( 0.221543, 0.129975, 0.25152, 1 ) + +[sub_resource type="SpatialMaterial" id=33] +albedo_color = Color( 0.407034, 0.063434, 0.826022, 1 ) + +[sub_resource type="SpatialMaterial" id=34] +albedo_color = Color( 0.0889729, 0.967076, 0.249959, 1 ) + +[sub_resource type="SpatialMaterial" id=35] +albedo_color = Color( 0.465289, 0.573838, 0.598849, 1 ) + +[sub_resource type="SpatialMaterial" id=36] +albedo_color = Color( 0.123197, 0.184637, 0.0637491, 1 ) + +[sub_resource type="SpatialMaterial" id=37] +albedo_color = Color( 0.469645, 0.682699, 0.462456, 1 ) + +[sub_resource type="SpatialMaterial" id=38] +albedo_color = Color( 0.235117, 0.164501, 0.804043, 1 ) + +[sub_resource type="SpatialMaterial" id=39] +albedo_color = Color( 0.788222, 0.277863, 0.795143, 1 ) + +[sub_resource type="SpatialMaterial" id=40] +albedo_color = Color( 0.0942122, 0.253081, 0.456666, 1 ) + +[sub_resource type="SpatialMaterial" id=41] +albedo_color = Color( 0.0998086, 0.737287, 0.515344, 1 ) + +[sub_resource type="SpatialMaterial" id=42] +albedo_color = Color( 0.620311, 0.528745, 0.951548, 1 ) + +[sub_resource type="SpatialMaterial" id=43] +albedo_color = Color( 0.541709, 0.766032, 0.988409, 1 ) + +[sub_resource type="SpatialMaterial" id=44] +albedo_color = Color( 0.785747, 0.313991, 0.736685, 1 ) + +[sub_resource type="SpatialMaterial" id=45] +albedo_color = Color( 0.0437973, 0.646887, 0.219997, 1 ) + +[sub_resource type="SpatialMaterial" id=46] +albedo_color = Color( 0.808976, 0.0676796, 0.934931, 1 ) + +[sub_resource type="SpatialMaterial" id=47] +albedo_color = Color( 0.134101, 0.976648, 0.791346, 1 ) + +[sub_resource type="SpatialMaterial" id=48] +albedo_color = Color( 0.458938, 0.139997, 0.381802, 1 ) + +[sub_resource type="SpatialMaterial" id=49] +albedo_color = Color( 0.86859, 0.814611, 0.772643, 1 ) + +[sub_resource type="SpatialMaterial" id=50] +albedo_color = Color( 0.0747827, 0.917116, 0.0636354, 1 ) + +[sub_resource type="SpatialMaterial" id=51] +albedo_color = Color( 0.000703006, 0.0199452, 0.405719, 1 ) + +[sub_resource type="SpatialMaterial" id=52] +albedo_color = Color( 0.238211, 0.205605, 0.980387, 1 ) + +[node name="World" type="Spatial"] + +[node name="WorldEnvironment" parent="." instance=ExtResource( 1 )] + +[node name="Cameras" type="Spatial" parent="."] +script = ExtResource( 2 ) + +[node name="View" type="TextureRect" parent="Cameras"] +material = SubResource( 1 ) +margin_right = 40.0 +margin_bottom = 40.0 +texture = ExtResource( 4 ) +expand = true + +[node name="Viewport1" type="Viewport" parent="Cameras"] +render_target_v_flip = true +render_target_update_mode = 3 + +[node name="Camera1" type="Camera" parent="Cameras/Viewport1"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 20, 0 ) +current = true + +[node name="Viewport2" type="Viewport" parent="Cameras"] +render_target_v_flip = true +render_target_update_mode = 3 + +[node name="Camera2" type="Camera" parent="Cameras/Viewport2"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 20, 0 ) +current = true + +[node name="Player1" type="KinematicBody" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25, 0 ) +script = ExtResource( 5 ) + +[node name="Mesh" type="MeshInstance" parent="Player1"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 ) +mesh = SubResource( 2 ) +material/0 = SubResource( 3 ) + +[node name="CollisionShape" type="CollisionShape" parent="Player1"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 ) +shape = SubResource( 4 ) + +[node name="Player2" type="KinematicBody" parent="."] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.18358, 1.25, 3.01882 ) +script = ExtResource( 5 ) +player_id = 2 + +[node name="Mesh" type="MeshInstance" parent="Player2"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 ) +mesh = SubResource( 2 ) +material/0 = SubResource( 5 ) + +[node name="CollisionShape" type="CollisionShape" parent="Player2"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 ) +shape = SubResource( 4 ) + +[node name="Ground" type="StaticBody" parent="."] + +[node name="Mesh" type="MeshInstance" parent="Ground"] +transform = Transform( 20, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0 ) +mesh = SubResource( 7 ) +material/0 = null + +[node name="CollisionShape" type="CollisionShape" parent="Ground"] +transform = Transform( 200, 0, 0, 0, 1, 0, 0, 0, 200, 0, -1, 0 ) +shape = SubResource( 8 ) + +[node name="Walls" type="Spatial" parent="."] +script = ExtResource( 6 ) + +[node name="Group1" type="Spatial" parent="Walls"] + +[node name="Wall1" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 10 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 12 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 13 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 14 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 15 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group1/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group1/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 16 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group2" type="Spatial" parent="Walls"] +editor/display_folded = true +transform = Transform( 0.988065, 0, -0.154039, 0, 1, 0, 0.154039, 0, 0.988065, -22.59, 0, -3.1796 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group2"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 17 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 18 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group2"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 19 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group2"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 20 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group2"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 21 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group2"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group2/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group2/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 22 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group3" type="Spatial" parent="Walls"] +editor/display_folded = true +transform = Transform( 0.905096, 0, 0.425207, 0, 1, 0, -0.425207, 0, 0.905096, -12.7693, 0, 17.7449 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 23 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 24 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 25 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 26 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 27 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group3"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group3/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group3/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 28 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group4" type="Spatial" parent="Walls"] +transform = Transform( 0.155702, 0, -0.987804, 0, 1, 0, 0.987804, 0, 0.155702, 14.0374, 0, 12.1476 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group4"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 29 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group4"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 30 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group4"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 31 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group4"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 32 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group4"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 33 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group4"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group4/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group4/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 34 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group5" type="Spatial" parent="Walls"] +editor/display_folded = true +transform = Transform( 0.999549, 0, 0.0300306, 0, 1, 0, -0.0300306, 0, 0.999549, 0.500639, 0, 27.6888 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 35 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 36 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 37 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 38 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 39 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group5"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group5/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group5/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 40 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group6" type="Spatial" parent="Walls"] +editor/display_folded = true +transform = Transform( 0.613129, 0, -0.789983, 0, 1, 0, 0.789983, 0, 0.613129, 21.2586, 0, -14.244 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 41 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 42 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 43 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 44 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 45 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group6"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group6/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group6/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 46 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Group7" type="Spatial" parent="Walls"] +editor/display_folded = true +transform = Transform( -0.999329, 0, -0.0366257, 0, 1, 0, 0.0366257, 0, -0.999329, -8.83615, 0, -32.7996 ) + +[node name="Wall1" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.08384, 1, -5.90156 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall1"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall1" groups=[ +"walls", +]] +material_override = SubResource( 47 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall2" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12.3812, 1, -2.68735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall2"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall2" groups=[ +"walls", +]] +material_override = SubResource( 48 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall3" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.99091, 1, -13.3028 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall3"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall3" groups=[ +"walls", +]] +material_override = SubResource( 49 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall4" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.10164, 1, 4.39061 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall4"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall4" groups=[ +"walls", +]] +material_override = SubResource( 50 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall5" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.12965, 1, -9.09735 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall5"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall5" groups=[ +"walls", +]] +material_override = SubResource( 51 ) +mesh = SubResource( 11 ) +material/0 = null + +[node name="Wall6" type="StaticBody" parent="Walls/Group7"] +editor/display_folded = true +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6.99301, 1, 1.77014 ) + +[node name="CollisionShape" type="CollisionShape" parent="Walls/Group7/Wall6"] +shape = SubResource( 9 ) + +[node name="MeshInstance" type="MeshInstance" parent="Walls/Group7/Wall6" groups=[ +"walls", +]] +material_override = SubResource( 52 ) +mesh = SubResource( 11 ) +material/0 = null diff --git a/viewport/dynamic_split_screen/Walls.gd b/viewport/dynamic_split_screen/Walls.gd new file mode 100644 index 00000000..d806a5b9 --- /dev/null +++ b/viewport/dynamic_split_screen/Walls.gd @@ -0,0 +1,13 @@ +tool +extends Spatial + +# Set a random color to all objects in the 'walls' group + +func _ready(): + randomize() + var walls = get_tree().get_nodes_in_group("walls") + for wall in walls: + var material = SpatialMaterial.new() + material.albedo_color = Color(randf(), randf(), randf()) + + wall.material_override = material diff --git a/viewport/dynamic_split_screen/WorldEnvironment.tscn b/viewport/dynamic_split_screen/WorldEnvironment.tscn new file mode 100644 index 00000000..4b8a2d9b --- /dev/null +++ b/viewport/dynamic_split_screen/WorldEnvironment.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://default_env.tres" type="Environment" id=1] + +[node name="WorldEnvironment" type="WorldEnvironment"] +environment = ExtResource( 1 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="."] +transform = Transform( 1, 0, 0, 0, -0.818651, 0.574291, 0, -0.574291, -0.818651, 0, 70.567, -72.3668 ) +shadow_enabled = true +shadow_color = Color( 0.6, 0.6, 0.6, 1 ) diff --git a/viewport/dynamic_split_screen/default_env.tres b/viewport/dynamic_split_screen/default_env.tres new file mode 100644 index 00000000..24c391c0 --- /dev/null +++ b/viewport/dynamic_split_screen/default_env.tres @@ -0,0 +1,29 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] +sky_top_color = Color( 0.211765, 0.313726, 0.552941, 1 ) +sky_horizon_color = Color( 0.545098, 0.686275, 0.811765, 1 ) +sky_curve = 0.131768 +sky_energy = 5.52 +ground_bottom_color = Color( 0.545098, 0.686275, 0.811765, 1 ) +ground_horizon_color = Color( 0.545098, 0.686275, 0.811765, 1 ) +ground_energy = 5.52 +sun_angle_max = 30.0 +sun_energy = 40.0 + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) +ambient_light_color = Color( 0.560784, 0.560784, 0.560784, 1 ) +ambient_light_sky_contribution = 0.3 +fog_color = Color( 1, 1, 1, 1 ) +fog_sun_color = Color( 1, 1, 1, 1 ) +fog_depth_enabled = false +fog_depth_begin = 400.0 +fog_depth_end = 1000.0 +fog_depth_curve = 0.287175 +fog_height_min = 2.0 +tonemap_mode = 2 +tonemap_white = 16.0 +dof_blur_far_distance = 416.97 +glow_intensity = 0.1 diff --git a/viewport/dynamic_split_screen/icon.png b/viewport/dynamic_split_screen/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3b231d4972606e3a186fa2abcea09018ace712e3 GIT binary patch literal 11945 zcmeHsXH=8hwst^zN4io%r~-k69(wP+NUuqNPy&R|d+(q$6{LuC1Vj)71O@4e;ue%D zAPCZ>NL9Q+cX6M4?z!I?wj*1PInLB=Vo9Ml%uGX$ znB1%Cckaj?I>%+L7}(5#JUGyB;vN1bdR_bB(kq)!>s<}4n>SA3`+_+QF5h

Lo}ls0u-Y10#q zm0khU{_hjnZZgkcZUwF+?5$YtOqxp>#KqbNbZpcXchM{?mu2!O#@#pq$*mId&g4+YUX(np(L$iDAgiPZ7} zF=rN#U-mS7qPy>=hXByhMjQl;H>jOc9!)4jYA`d(4&?*F|2`n{KpetCr+)c)rr3j4np!W6 z*C|`T3~I$LV0Kg9y`k!C_awDy(qe2TIj8>lw((-s(6JY(pmcHy3$0)G#hrU3*G3JX zp(&KzS1>7)rfll8Y#JJU{d%=Yv_1FlrA~JZY;j?}3!r)PA{nF(4X=xl&3@NhqPTM^ zfqs%aWfppg&$*TC+6IDDTaO->n@u6DRNcD)hDb3w<*G*4Z{SyfsaYX1+>SJG$!d9;MlwpbY6_f7G`$9af&m zuR^=|BwVVPI*4ib<@0yfAyomlw!)_10V>yJHFI5L2gCzG!7UC)mGxEyt31t6fjTr2 z(oCDLRsW!%(29h3BP(3bYZ>C-Y$(@y?`zwMUgyMbGGpF>9$rII3ASE-+_Ee6?9T$w zf-UUX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UD!xU5Rvv>$oh}&oeQ(iczAehBrtEU zjSxKsJO;>#kn})A_IX(9_7e&T+v<#D_mtfZW!<A{r~!Z_Z>+)Ru9cN?p#lUIUc zyYFkcUnp4Q$Unaj>$wm6Jo?WUIxAG{aDFmKp1iAM&X;oRlnxIMvr=iAnwlCI7$_@uCkTkIe5NuGcIDOFOIMpw(CKEDIduiV0VVi&(N2K* z(TL8R>3g0*C;KQ1i+2eZwXTT*qKs*rK+3}xcfP8SbB^-qfF-2>B-8apetv#UO-)kG zc%-T>8x}&MZ=WAsTV-6{W_(vD)Z5lk(6JEMxiZ@Z;kz(9CagTLza@; zde3jkPQ;J!Xz)h?1Ikzfjif;8XzR9|$Z=mzMmI$g<_rDC#A!yC=w1ry13VuCi~!N& zH@H|wBWPF|Mbx>HWn^TFBGu*LdbLz}_OcozsS~gjrd~^lCqAs^{Joz=n0A8jn;36+ zbW?{GR7vdI#`g(6u4YM`rc2T;N&{@O0|1Ty1b52N7M|n#?)XAhB7@?=Uflm_w3u~j zv#i+`LS=hLjd|Uli3u3nk`d~#)EcIhU;c8cra<#m@q$TXed#q(THKQtKwI5FtzN}3 G=Dz^w*DF^5 literal 0 HcmV?d00001 diff --git a/viewport/dynamic_split_screen/icon.png.import b/viewport/dynamic_split_screen/icon.png.import new file mode 100644 index 00000000..96cbf462 --- /dev/null +++ b/viewport/dynamic_split_screen/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/viewport/dynamic_split_screen/project.godot b/viewport/dynamic_split_screen/project.godot new file mode 100644 index 00000000..82e8ab41 --- /dev/null +++ b/viewport/dynamic_split_screen/project.godot @@ -0,0 +1,87 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ ] +_global_script_class_icons={ + +} + +[application] + +config/name="Dynamic Split Screen" +run/main_scene="res://SplitScreen.tscn" +config/icon="res://icon.png" + +[debug] + +gdscript/warnings/return_value_discarded=false + +[input] + +move_up_player1={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) + ] +} +move_down_player1={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) + ] +} +move_left_player1={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null) + ] +} +move_right_player1={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null) + ] +} +move_up_player2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":73,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":-1.0,"script":null) + ] +} +move_down_player2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":75,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":1.0,"script":null) + ] +} +move_left_player2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":74,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":-1.0,"script":null) + ] +} +move_right_player2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":1.0,"script":null) + ] +} + +[rendering] + +quality/driver/driver_name="GLES2" +environment/default_clear_color=Color( 1, 1, 1, 1 ) +environment/default_environment="res://default_env.tres"