summaryrefslogtreecommitdiff
path: root/demos/2d/lights_shadows
diff options
context:
space:
mode:
Diffstat (limited to 'demos/2d/lights_shadows')
-rw-r--r--demos/2d/lights_shadows/engine.cfg2
-rw-r--r--demos/2d/lights_shadows/light_shadows.scnbin4978 -> 0 bytes
-rw-r--r--demos/2d/lights_shadows/light_shadows.tscn326
3 files changed, 327 insertions, 1 deletions
diff --git a/demos/2d/lights_shadows/engine.cfg b/demos/2d/lights_shadows/engine.cfg
index 80142633d3..51a98eddd7 100644
--- a/demos/2d/lights_shadows/engine.cfg
+++ b/demos/2d/lights_shadows/engine.cfg
@@ -1,7 +1,7 @@
[application]
name="2D Lighting"
-main_scene="res://light_shadows.scn"
+main_scene="res://light_shadows.tscn"
icon="res://icon.png"
[display]
diff --git a/demos/2d/lights_shadows/light_shadows.scn b/demos/2d/lights_shadows/light_shadows.scn
deleted file mode 100644
index 24ccd1e0be..0000000000
--- a/demos/2d/lights_shadows/light_shadows.scn
+++ /dev/null
Binary files differ
diff --git a/demos/2d/lights_shadows/light_shadows.tscn b/demos/2d/lights_shadows/light_shadows.tscn
new file mode 100644
index 0000000000..f31692889e
--- /dev/null
+++ b/demos/2d/lights_shadows/light_shadows.tscn
@@ -0,0 +1,326 @@
+[gd_scene load_steps=9 format=1]
+
+[ext_resource path="res://bg.png" type="Texture" id=1]
+[ext_resource path="res://caster.png" type="Texture" id=2]
+[ext_resource path="res://light.png" type="Texture" id=3]
+[ext_resource path="res://spot.png" type="Texture" id=4]
+
+[sub_resource type="OccluderPolygon2D" id=1]
+
+closed = true
+cull_mode = 0
+polygon = Vector2Array( -15.913, -15.9738, 15.9079, -16.0785, 15.6986, 15.847, -16.1223, 15.9517 )
+
+[sub_resource type="Animation" id=2]
+
+length = 16.0
+loop = true
+step = 0.1
+tracks/0/type = "value"
+tracks/0/path = NodePath(".:transform/pos")
+tracks/0/interp = 1
+tracks/0/keys = { "cont":true, "times":FloatArray( 0, 4, 8, 12 ), "transitions":FloatArray( -2, -2, -2, -2 ), "values":[ Vector2( 159.289, 452.441 ), Vector2( 132.279, 80.4366 ), Vector2( 700.722, 241.27 ), Vector2( 429.392, 571.532 ) ] }
+
+[sub_resource type="Animation" id=3]
+
+length = 16.0
+loop = true
+step = 0.1
+tracks/0/type = "value"
+tracks/0/path = NodePath(".:transform/pos")
+tracks/0/interp = 1
+tracks/0/keys = { "cont":true, "times":FloatArray( 0, 4.1, 8.1, 11.8 ), "transitions":FloatArray( -2, -2, -2, -2 ), "values":[ Vector2( 753.756, 314.336 ), Vector2( 69.7562, 234.336 ), Vector2( 256.756, 575.336 ), Vector2( 516.756, 530.336 ) ] }
+
+[sub_resource type="Animation" id=4]
+
+length = 16.0
+loop = true
+step = 0.1
+tracks/0/type = "value"
+tracks/0/path = NodePath(".:transform/pos")
+tracks/0/interp = 1
+tracks/0/keys = { "cont":true, "times":FloatArray( 0, 4.1, 7.9, 12.1 ), "transitions":FloatArray( -2, -2, -2, -2 ), "values":[ Vector2( 692.078, 29.8849 ), Vector2( 309.606, 31.5551 ), Vector2( 40.7064, 238.658 ), Vector2( 685.397, 282.082 ) ] }
+
+[node name="base" type="Node2D"]
+
+[node name="ambient" type="CanvasModulate" parent="."]
+
+color = Color( 0.479177, 0.464761, 0.498946, 1 )
+
+[node name="bg" type="Sprite" parent="."]
+
+transform/pos = Vector2( 401.251, 301.906 )
+transform/scale = Vector2( 6.39454, 4.82665 )
+texture = ExtResource( 1 )
+
+[node name="casters" type="Node2D" parent="."]
+
+[node name="shadow_caster" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 95.2909, 85.3186 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster1" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 200.291, 313.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster1"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster2" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 76.2909, 405.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster2"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster3" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 348.291, 206.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster3"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster4" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 239.291, 48.3186 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster4"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster5" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 140.291, 561.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster5"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster6" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 392.291, 499.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster6"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster7" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 735.291, 552.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster7"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster8" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 661.291, 371.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster8"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster9" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 567.291, 574.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster9"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster10" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 420.291, 350.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster10"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster11" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 463.291, 106.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster11"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster12" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 621.291, 78.3186 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster12"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster13" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 761.291, 240.319 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster13"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="shadow_caster14" type="Sprite" parent="casters"]
+
+transform/pos = Vector2( 771.291, 29.3186 )
+texture = ExtResource( 2 )
+
+[node name="occluder" type="LightOccluder2D" parent="casters/shadow_caster14"]
+
+occluder = SubResource( 1 )
+light_mask = 1
+
+[node name="red_light" type="Light2D" parent="."]
+
+transform/pos = Vector2( 159.289, 452.441 )
+enabled = true
+texture = ExtResource( 3 )
+offset = Vector2( 0, 0 )
+scale = 1.0
+color = Color( 1, 0.446392, 0.0576646, 1 )
+energy = 1.0
+mode = 0
+range/height = 0.0
+range/z_min = -1024
+range/z_max = 1024
+range/layer_min = 0
+range/layer_max = 0
+range/item_mask = 1
+shadow/enabled = true
+shadow/color = Color( 0, 0, 0, 0 )
+shadow/buffer_size = 2048
+shadow/esm_multiplier = 80.0
+shadow/item_mask = 1
+
+[node name="blob" type="Sprite" parent="red_light"]
+
+visibility/blend_mode = 1
+texture = ExtResource( 4 )
+
+[node name="anim" type="AnimationPlayer" parent="red_light"]
+
+playback/process_mode = 1
+playback/default_blend_time = 0.0
+root/root = NodePath("..")
+anims/motion = SubResource( 2 )
+anims/motion2 = SubResource( 3 )
+playback/active = true
+playback/speed = 1.0
+blend_times = [ ]
+autoplay = "motion"
+
+[node name="green_light" type="Light2D" parent="."]
+
+transform/pos = Vector2( 753.756, 314.336 )
+enabled = true
+texture = ExtResource( 3 )
+offset = Vector2( 0, 0 )
+scale = 1.0
+color = Color( 0.49247, 0.878537, 0.409146, 1 )
+energy = 1.0
+mode = 0
+range/height = 0.0
+range/z_min = -1024
+range/z_max = 1024
+range/layer_min = 0
+range/layer_max = 0
+range/item_mask = 1
+shadow/enabled = true
+shadow/color = Color( 0, 0, 0, 0 )
+shadow/buffer_size = 2048
+shadow/esm_multiplier = 80.0
+shadow/item_mask = 1
+
+[node name="blob" type="Sprite" parent="green_light"]
+
+visibility/blend_mode = 1
+texture = ExtResource( 4 )
+
+[node name="anim" type="AnimationPlayer" parent="green_light"]
+
+playback/process_mode = 1
+playback/default_blend_time = 0.0
+root/root = NodePath("..")
+anims/m2 = SubResource( 3 )
+anims/motion = SubResource( 2 )
+playback/active = true
+playback/speed = 1.0
+blend_times = [ ]
+autoplay = "m2"
+
+[node name="blue_light" type="Light2D" parent="."]
+
+transform/pos = Vector2( 692.078, 29.8849 )
+enabled = true
+texture = ExtResource( 3 )
+offset = Vector2( 0, 0 )
+scale = 1.0
+color = Color( 0.396752, 0.446392, 0.929792, 1 )
+energy = 1.0
+mode = 0
+range/height = 0.0
+range/z_min = -1024
+range/z_max = 1024
+range/layer_min = 0
+range/layer_max = 0
+range/item_mask = 1
+shadow/enabled = true
+shadow/color = Color( 0, 0, 0, 0 )
+shadow/buffer_size = 2048
+shadow/esm_multiplier = 80.0
+shadow/item_mask = 1
+
+[node name="blob" type="Sprite" parent="blue_light"]
+
+visibility/blend_mode = 1
+texture = ExtResource( 4 )
+
+[node name="anim" type="AnimationPlayer" parent="blue_light"]
+
+playback/process_mode = 1
+playback/default_blend_time = 0.0
+root/root = NodePath("..")
+anims/motion = SubResource( 2 )
+anims/motion2 = SubResource( 3 )
+anims/motion3 = SubResource( 4 )
+playback/active = true
+playback/speed = 1.0
+blend_times = [ ]
+autoplay = "motion3"
+
+