diff options
-rw-r--r-- | CityBackground.png | bin | 5207 -> 6306 bytes | |||
-rw-r--r-- | CityBackground.pxo | bin | 48005 -> 57005 bytes | |||
-rw-r--r-- | CityScene.tscn | 185 | ||||
-rw-r--r-- | gradient_horizon.tres | 101 | ||||
-rw-r--r-- | gradient_water.tres | 99 |
5 files changed, 347 insertions, 38 deletions
diff --git a/CityBackground.png b/CityBackground.png Binary files differindex a506871..9931271 100644 --- a/CityBackground.png +++ b/CityBackground.png diff --git a/CityBackground.pxo b/CityBackground.pxo Binary files differindex 1212147..e03784a 100644 --- a/CityBackground.pxo +++ b/CityBackground.pxo diff --git a/CityScene.tscn b/CityScene.tscn index eac95b1..64ed7fc 100644 --- a/CityScene.tscn +++ b/CityScene.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://CityBackground.png" type="Texture" id=1] +[ext_resource path="res://gradient_water.tres" type="Shader" id=2] +[ext_resource path="res://gradient_horizon.tres" type="Shader" id=3] [sub_resource type="GDScript" id=2] script/source = "extends ParallaxLayer @@ -10,15 +12,24 @@ var offset_x = 0.0 var last_camera_x = 0.0 func _ready(): - last_camera_x = get_node(\"../../Camera2D\").get_camera_position().x + last_camera_x = get_node(\"../../../Camera2D\").get_camera_position().x func _process(delta): motion_offset = Vector2(offset_x, 0) - var new_camera_x = get_node(\"../../Camera2D\").get_camera_position().x + var new_camera_x = get_node(\"../../../Camera2D\").get_camera_position().x offset_x -= delta*speed + (new_camera_x - last_camera_x)*-2 last_camera_x = new_camera_x " +[sub_resource type="ShaderMaterial" id=22] +shader = ExtResource( 3 ) + +[sub_resource type="ShaderMaterial" id=23] +shader = ExtResource( 3 ) + +[sub_resource type="ShaderMaterial" id=28] +shader = ExtResource( 2 ) + [sub_resource type="TileSet" id=1] 5/name = "CityBackground.png 5" 5/texture = ExtResource( 1 ) @@ -91,7 +102,22 @@ func _process(delta): 9/shapes = [ ] 9/z_index = 0 -[sub_resource type="Shader" id=7] +[sub_resource type="Shader" id=29] +code = "shader_type canvas_item; + +void fragment() +{ + vec4 col = texture(TEXTURE, UV); + if (col.a > 0.0) { + col += vec4(0.1, 0.02, 0.00, 0.0); + } + COLOR = col; +}" + +[sub_resource type="ShaderMaterial" id=30] +shader = SubResource( 29 ) + +[sub_resource type="Shader" id=31] code = "shader_type canvas_item; void fragment() @@ -101,43 +127,121 @@ void fragment() col += vec4(0.05, 0.01, 0.00, 0.0); } COLOR = col; -} -" +}" -[sub_resource type="ShaderMaterial" id=6] -shader = SubResource( 7 ) +[sub_resource type="ShaderMaterial" id=32] +shader = SubResource( 31 ) [node name="Node2D" type="Node2D"] -[node name="ParallaxBackground" type="ParallaxBackground" parent="."] -layer = -1 +[node name="Camera2D" type="Camera2D" parent="."] +position = Vector2( 240, 135 ) +current = true +smoothing_speed = 8.0 + +[node name="ViewportContainer" type="ViewportContainer" parent="."] +margin_top = 133.0 +margin_right = 480.0 +margin_bottom = 238.0 + +[node name="ParallaxBackground5" type="ParallaxBackground" parent="ViewportContainer"] scroll_ignore_camera_zoom = true -[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] +[node name="ParallaxLayer2" type="ParallaxLayer" parent="ViewportContainer/ParallaxBackground5"] position = Vector2( 295, 103 ) motion_mirroring = Vector2( 640, 0 ) script = SubResource( 2 ) __meta__ = { "_edit_lock_": true } -speed = 100.0 +speed = 150.0 + +[node name="ColorRect" type="ColorRect" parent="ViewportContainer/ParallaxBackground5/ParallaxLayer2"] +material = SubResource( 22 ) +margin_left = -488.0 +margin_top = -113.0 +margin_right = 152.0 +margin_bottom = 135.0 +rect_pivot_offset = Vector2( 373, -36 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="ColorRect2" type="ColorRect" parent="ViewportContainer/ParallaxBackground5/ParallaxLayer2"] +material = SubResource( 23 ) +margin_left = 792.0 +margin_top = -113.0 +margin_right = 1432.0 +margin_bottom = 135.0 +rect_pivot_offset = Vector2( 373, -36 ) +__meta__ = { +"_edit_lock_": true +} + +[node name="ParallaxBackground4" type="ParallaxBackground" parent="ViewportContainer"] +layer = 0 +scroll_ignore_camera_zoom = true + +[node name="ParallaxLayer2" type="ParallaxLayer" parent="ViewportContainer/ParallaxBackground4"] +position = Vector2( 295, 103 ) +motion_mirroring = Vector2( 640, 0 ) +script = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} +speed = 150.0 + +[node name="ColorRect" type="ColorRect" parent="ViewportContainer/ParallaxBackground4/ParallaxLayer2"] +material = SubResource( 28 ) +margin_left = -488.0 +margin_top = 136.0 +margin_right = 152.0 +margin_bottom = 176.0 +rect_pivot_offset = Vector2( 373, -36 ) +__meta__ = { +"_edit_lock_": true +} -[node name="StaticBody2D" type="StaticBody2D" parent="ParallaxBackground/ParallaxLayer"] +[node name="ColorRect2" type="ColorRect" parent="ViewportContainer/ParallaxBackground4/ParallaxLayer2"] +material = SubResource( 28 ) +margin_left = 792.0 +margin_top = 136.0 +margin_right = 1432.0 +margin_bottom = 176.0 +rect_pivot_offset = Vector2( 373, -36 ) __meta__ = { "_edit_lock_": true } -[node name="TileMap" type="TileMap" parent="ParallaxBackground/ParallaxLayer/StaticBody2D"] +[node name="ParallaxBackground3" type="ParallaxBackground" parent="ViewportContainer"] +layer = 0 +scroll_ignore_camera_zoom = true + +[node name="ParallaxLayer2" type="ParallaxLayer" parent="ViewportContainer/ParallaxBackground3"] +position = Vector2( 295, 103 ) +motion_mirroring = Vector2( 640, 0 ) +script = SubResource( 2 ) +__meta__ = { +"_edit_lock_": true +} +speed = 150.0 + +[node name="StaticBody2D" type="StaticBody2D" parent="ViewportContainer/ParallaxBackground3/ParallaxLayer2"] +__meta__ = { +"_edit_lock_": true +} + +[node name="TileMap" type="TileMap" parent="ViewportContainer/ParallaxBackground3/ParallaxLayer2/StaticBody2D"] position = Vector2( 216, 39 ) tile_set = SubResource( 1 ) -cell_size = Vector2( 64, 4 ) +cell_size = Vector2( 64, 1 ) format = 1 -tile_data = PoolIntArray( 65525, 5, 0, 65535, 5, 0, 0, 0, 0, 1, 1, 0 ) +tile_data = PoolIntArray( 0, 0, 0, 1, 1, 0, 131061, 7, 0, 65545, 7, 0 ) __meta__ = { "_edit_lock_": true } -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ParallaxBackground/ParallaxLayer/StaticBody2D"] +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ViewportContainer/ParallaxBackground3/ParallaxLayer2/StaticBody2D"] visible = false position = Vector2( -183, 42 ) polygon = PoolVector2Array( 124, -113, 17, -2, 9, 97, 321, 91, 407, -97 ) @@ -145,11 +249,11 @@ __meta__ = { "_edit_lock_": true } -[node name="ParallaxBackground2" type="ParallaxBackground" parent="."] +[node name="ParallaxBackground2" type="ParallaxBackground" parent="ViewportContainer"] layer = -2 scroll_ignore_camera_zoom = true -[node name="ParallaxLayer2" type="ParallaxLayer" parent="ParallaxBackground2"] +[node name="ParallaxLayer2" type="ParallaxLayer" parent="ViewportContainer/ParallaxBackground2"] position = Vector2( 295, 103 ) motion_mirroring = Vector2( 640, 0 ) script = SubResource( 2 ) @@ -158,23 +262,23 @@ __meta__ = { } speed = 50.0 -[node name="StaticBody2D" type="StaticBody2D" parent="ParallaxBackground2/ParallaxLayer2"] +[node name="StaticBody2D" type="StaticBody2D" parent="ViewportContainer/ParallaxBackground2/ParallaxLayer2"] __meta__ = { "_edit_lock_": true } -[node name="TileMap" type="TileMap" parent="ParallaxBackground2/ParallaxLayer2/StaticBody2D"] -material = SubResource( 6 ) +[node name="TileMap" type="TileMap" parent="ViewportContainer/ParallaxBackground2/ParallaxLayer2/StaticBody2D"] +material = SubResource( 30 ) position = Vector2( 216, 39 ) tile_set = SubResource( 1 ) -cell_size = Vector2( 64, 4 ) +cell_size = Vector2( 64, 1 ) format = 1 -tile_data = PoolIntArray( -11, 6, 0, -65527, 6, 0, 0, 0, 0, 1, 1, 0 ) +tile_data = PoolIntArray( 65525, 6, 0, 0, 0, 0, 1, 1, 0, 9, 6, 0 ) __meta__ = { "_edit_lock_": true } -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ParallaxBackground2/ParallaxLayer2/StaticBody2D"] +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ViewportContainer/ParallaxBackground2/ParallaxLayer2/StaticBody2D"] visible = false position = Vector2( -183, 42 ) polygon = PoolVector2Array( 124, -113, 17, -2, 9, 97, 321, 91, 407, -97 ) @@ -182,35 +286,36 @@ __meta__ = { "_edit_lock_": true } -[node name="ParallaxBackground3" type="ParallaxBackground" parent="."] -layer = 0 +[node name="ParallaxBackground" type="ParallaxBackground" parent="ViewportContainer"] +layer = -1 scroll_ignore_camera_zoom = true -[node name="ParallaxLayer2" type="ParallaxLayer" parent="ParallaxBackground3"] +[node name="ParallaxLayer" type="ParallaxLayer" parent="ViewportContainer/ParallaxBackground"] position = Vector2( 295, 103 ) motion_mirroring = Vector2( 640, 0 ) script = SubResource( 2 ) __meta__ = { "_edit_lock_": true } -speed = 150.0 +speed = 100.0 -[node name="StaticBody2D" type="StaticBody2D" parent="ParallaxBackground3/ParallaxLayer2"] +[node name="StaticBody2D" type="StaticBody2D" parent="ViewportContainer/ParallaxBackground/ParallaxLayer"] __meta__ = { "_edit_lock_": true } -[node name="TileMap" type="TileMap" parent="ParallaxBackground3/ParallaxLayer2/StaticBody2D"] +[node name="TileMap" type="TileMap" parent="ViewportContainer/ParallaxBackground/ParallaxLayer/StaticBody2D"] +material = SubResource( 32 ) position = Vector2( 216, 39 ) tile_set = SubResource( 1 ) -cell_size = Vector2( 64, 4 ) +cell_size = Vector2( 64, 1 ) format = 1 -tile_data = PoolIntArray( 0, 0, 0, 1, 1, 0, 131061, 7, 0, 65545, 7, 0 ) +tile_data = PoolIntArray( 65525, 5, 0, 65535, 5, 0, 0, 0, 0, 1, 1, 0, 19, 5, 0 ) __meta__ = { "_edit_lock_": true } -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ParallaxBackground3/ParallaxLayer2/StaticBody2D"] +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ViewportContainer/ParallaxBackground/ParallaxLayer/StaticBody2D"] visible = false position = Vector2( -183, 42 ) polygon = PoolVector2Array( 124, -113, 17, -2, 9, 97, 321, 91, 407, -97 ) @@ -218,8 +323,12 @@ __meta__ = { "_edit_lock_": true } -[node name="Camera2D" type="Camera2D" parent="."] +[node name="ParallaxBackground6" type="ParallaxBackground" parent="."] +layer = 1 +scroll_ignore_camera_zoom = true + +[node name="ColorRect" type="ColorRect" parent="ParallaxBackground6"] visible = false -position = Vector2( 240, 135 ) -current = true -smoothing_speed = 8.0 +margin_top = 239.0 +margin_right = 480.0 +margin_bottom = 279.0 diff --git a/gradient_horizon.tres b/gradient_horizon.tres new file mode 100644 index 0000000..cd47488 --- /dev/null +++ b/gradient_horizon.tres @@ -0,0 +1,101 @@ +[gd_resource type="VisualShader" load_steps=10 format=2] + +[sub_resource type="VisualShaderNodeScalarFunc" id=20] +function = 14 + +[sub_resource type="VisualShaderNodeScalarOp" id=21] +default_input_values = [ 0, 0.0, 1, 3.0 ] +operator = 3 + +[sub_resource type="VisualShaderNodeScalarConstant" id=22] +constant = 25.0 + +[sub_resource type="VisualShaderNodeInput" id=15] +input_name = "uv" + +[sub_resource type="VisualShaderNodeVectorDecompose" id=16] +output_port_for_preview = 1 + +[sub_resource type="Gradient" id=17] +colors = PoolColorArray( 0.454902, 0.333333, 0.501961, 1, 0.694118, 0.54902, 0.364706, 1 ) + +[sub_resource type="GradientTexture" id=18] +gradient = SubResource( 17 ) +width = 5 + +[sub_resource type="VisualShaderNodeTexture" id=19] +output_port_for_preview = 0 +texture = SubResource( 18 ) +texture_type = 1 + +[sub_resource type="VisualShaderNodeScalarOp" id=23] +output_port_for_preview = 0 +default_input_values = [ 0, 0.0, 1, 3.0 ] +operator = 2 + +[resource] +code = "shader_type canvas_item; +uniform sampler2D tex_frg_8 : hint_albedo; + + + +void vertex() { +// Output:0 + +} + +void fragment() { +// Input:3 + vec3 n_out3p0 = vec3(UV, 0.0); + +// VectorDecompose:4 + float n_out4p0 = n_out3p0.x; + float n_out4p1 = n_out3p0.y; + float n_out4p2 = n_out3p0.z; + +// Scalar:12 + float n_out12p0 = 25.000000; + +// ScalarOp:9 + float n_out9p0 = n_out4p1 * n_out12p0; + +// ScalarFunc:10 + float n_out10p0 = floor(n_out9p0); + +// ScalarOp:11 + float n_out11p0 = n_out10p0 / n_out12p0; + +// Texture:8 + vec4 tex_frg_8_read = texture(tex_frg_8, vec3(n_out11p0).xy); + vec3 n_out8p0 = tex_frg_8_read.rgb; + float n_out8p1 = tex_frg_8_read.a; + +// Output:0 + COLOR.rgb = n_out8p0; + +} + +void light() { +// Output:0 + +} +" +graph_offset = Vector2( -1106.7, 95 ) +mode = 1 +flags/light_only = false +nodes/fragment/0/position = Vector2( 80, 160 ) +nodes/fragment/3/node = SubResource( 15 ) +nodes/fragment/3/position = Vector2( -1280, 100 ) +nodes/fragment/4/node = SubResource( 16 ) +nodes/fragment/4/position = Vector2( -1080, 100 ) +nodes/fragment/8/node = SubResource( 19 ) +nodes/fragment/8/position = Vector2( -120, 100 ) +nodes/fragment/9/node = SubResource( 23 ) +nodes/fragment/9/position = Vector2( -760, 60 ) +nodes/fragment/10/node = SubResource( 20 ) +nodes/fragment/10/position = Vector2( -520, 120 ) +nodes/fragment/11/node = SubResource( 21 ) +nodes/fragment/11/position = Vector2( -300, 120 ) +nodes/fragment/12/node = SubResource( 22 ) +nodes/fragment/12/position = Vector2( -1000, 320 ) +nodes/fragment/connections = PoolIntArray( 3, 0, 4, 0, 4, 1, 9, 0, 9, 0, 10, 0, 8, 0, 0, 0, 10, 0, 11, 0, 11, 0, 8, 0, 12, 0, 9, 1, 12, 0, 11, 1 ) diff --git a/gradient_water.tres b/gradient_water.tres new file mode 100644 index 0000000..085f140 --- /dev/null +++ b/gradient_water.tres @@ -0,0 +1,99 @@ +[gd_resource type="VisualShader" load_steps=10 format=2] + +[sub_resource type="VisualShaderNodeScalarFunc" id=20] +function = 14 + +[sub_resource type="VisualShaderNodeScalarOp" id=21] +default_input_values = [ 0, 0.0, 1, 3.0 ] +operator = 3 + +[sub_resource type="VisualShaderNodeScalarConstant" id=22] +constant = 8.0 + +[sub_resource type="Gradient" id=24] +colors = PoolColorArray( 0.360784, 0.403922, 0.760784, 1, 0.298039, 0.0823529, 0.72549, 1 ) + +[sub_resource type="GradientTexture" id=25] +gradient = SubResource( 24 ) + +[sub_resource type="VisualShaderNodeTexture" id=26] +texture = SubResource( 25 ) +texture_type = 1 + +[sub_resource type="VisualShaderNodeInput" id=15] +input_name = "uv" + +[sub_resource type="VisualShaderNodeVectorDecompose" id=16] +output_port_for_preview = 1 + +[sub_resource type="VisualShaderNodeScalarOp" id=23] +output_port_for_preview = 0 +default_input_values = [ 0, 0.0, 1, 3.0 ] +operator = 2 + +[resource] +code = "shader_type canvas_item; +uniform sampler2D tex_frg_13 : hint_albedo; + + + +void vertex() { +// Output:0 + +} + +void fragment() { +// Input:3 + vec3 n_out3p0 = vec3(UV, 0.0); + +// VectorDecompose:4 + float n_out4p0 = n_out3p0.x; + float n_out4p1 = n_out3p0.y; + float n_out4p2 = n_out3p0.z; + +// Scalar:12 + float n_out12p0 = 8.000000; + +// ScalarOp:9 + float n_out9p0 = n_out4p1 * n_out12p0; + +// ScalarFunc:10 + float n_out10p0 = floor(n_out9p0); + +// ScalarOp:11 + float n_out11p0 = n_out10p0 / n_out12p0; + +// Texture:13 + vec4 tex_frg_13_read = texture(tex_frg_13, vec3(n_out11p0).xy); + vec3 n_out13p0 = tex_frg_13_read.rgb; + float n_out13p1 = tex_frg_13_read.a; + +// Output:0 + COLOR.rgb = n_out13p0; + +} + +void light() { +// Output:0 + +} +" +graph_offset = Vector2( -1187.63, 47.8338 ) +mode = 1 +flags/light_only = false +nodes/fragment/0/position = Vector2( 80, 160 ) +nodes/fragment/3/node = SubResource( 15 ) +nodes/fragment/3/position = Vector2( -1280, 100 ) +nodes/fragment/4/node = SubResource( 16 ) +nodes/fragment/4/position = Vector2( -1080, 100 ) +nodes/fragment/9/node = SubResource( 23 ) +nodes/fragment/9/position = Vector2( -760, 60 ) +nodes/fragment/10/node = SubResource( 20 ) +nodes/fragment/10/position = Vector2( -520, 120 ) +nodes/fragment/11/node = SubResource( 21 ) +nodes/fragment/11/position = Vector2( -320, 120 ) +nodes/fragment/12/node = SubResource( 22 ) +nodes/fragment/12/position = Vector2( -1000, 320 ) +nodes/fragment/13/node = SubResource( 26 ) +nodes/fragment/13/position = Vector2( -140, 100 ) +nodes/fragment/connections = PoolIntArray( 3, 0, 4, 0, 4, 1, 9, 0, 9, 0, 10, 0, 10, 0, 11, 0, 12, 0, 9, 1, 12, 0, 11, 1, 11, 0, 13, 0, 13, 0, 0, 0 ) |