[gd_scene load_steps=14 format=2]

[ext_resource path="res://Spawn.gd" type="Script" id=1]
[ext_resource path="res://addons/DBAccess/dbhandler.gd" type="Script" id=2]
[ext_resource path="res://Fonts/TStar32.tres" type="DynamicFont" id=3]
[ext_resource path="res://Pretty View.jpg" type="Texture" id=4]
[ext_resource path="res://Ladybug.tscn" type="PackedScene" id=5]
[ext_resource path="res://window_silhouette_blur5.png" type="Texture" id=6]
[ext_resource path="res://window_dirt_splotchy.png" type="Texture" id=7]
[ext_resource path="res://Overlay.gd" type="Script" id=8]
[ext_resource path="res://Sounds/city.ogg" type="AudioStream" id=9]
[ext_resource path="res://Sounds/machine_hum.ogg" type="AudioStream" id=10]

[sub_resource type="CanvasItemMaterial" id=3]
blend_mode = 2

[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
uniform int iterations;
uniform float mult_zoom;
uniform float mult_og;
uniform float zoom;
uniform float blur;
uniform vec2 sun_pos;

void fragment(){
	vec4 output = texture(SCREEN_TEXTURE, SCREEN_UV) * mult_og;
	for(int i = 0; i < iterations; i++){
		float fraction = float (i) / float(iterations - 1);
		vec2 zoom_uv = sun_pos + (SCREEN_UV - sun_pos) * mix(1.0, zoom, fraction);
		output.rgb += textureLod(SCREEN_TEXTURE, zoom_uv, blur * fraction).rgb * (1.0 - fraction) * (mult_zoom / mult_og) / max(float(iterations), 0.0);
	}
	COLOR = output;
}"

[sub_resource type="ShaderMaterial" id=2]
shader = SubResource( 1 )
shader_param/iterations = 32
shader_param/mult_zoom = 2.116
shader_param/mult_og = 0.3
shader_param/zoom = 0.7
shader_param/blur = 5.0
shader_param/sun_pos = Vector2( 0.441, 0.355 )

[node name="test" type="Node2D"]
script = ExtResource( 1 )
critter = ExtResource( 5 )
screensize = Vector2( 1920, 1080 )
margins = Vector2( 150, 100 )

[node name="PrettyView" type="Sprite" parent="."]
position = Vector2( -17, -16 )
scale = Vector2( 0.339526, 0.339526 )
texture = ExtResource( 4 )
centered = false

[node name="DBHandler" type="Node" parent="."]
script = ExtResource( 2 )

[node name="WindowDirt" type="Sprite" parent="."]
self_modulate = Color( 0.188235, 0.188235, 0.188235, 1 )
material = SubResource( 3 )
position = Vector2( 292, 538 )
rotation = -1.57079
scale = Vector2( 0.543262, 0.543262 )
texture = ExtResource( 7 )

[node name="WindowDirt2" type="Sprite" parent="."]
self_modulate = Color( 0.188235, 0.188235, 0.188235, 1 )
material = SubResource( 3 )
position = Vector2( 1661, 529 )
rotation = -1.57079
scale = Vector2( 0.543262, 0.543262 )
texture = ExtResource( 7 )

[node name="WindowDirt3" type="Sprite" parent="."]
self_modulate = Color( 0.188235, 0.188235, 0.188235, 1 )
material = SubResource( 3 )
position = Vector2( 961, 546 )
rotation = -4.71238
scale = Vector2( 0.662799, 0.662799 )
texture = ExtResource( 7 )

[node name="WindowSilhouette" type="Sprite" parent="."]
position = Vector2( 964, 520 )
scale = Vector2( 0.958082, 0.958082 )
texture = ExtResource( 6 )

[node name="Credits" type="Label" parent="."]
margin_left = 143.0
margin_top = 26.0
margin_right = 827.0
margin_bottom = 149.0
rect_rotation = 90.0
rect_scale = Vector2( 0.960924, 0.960924 )
custom_fonts/font = ExtResource( 3 )
text = "Vignette by Ash K // Patreon credits addon by Maks Loboda
Pretty images by Kjartan Bø and Sebastian Staines
Cozy sounds by Foxicity and tosha73"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 2

[node name="Overlay" type="ColorRect" parent="CanvasLayer"]
material = SubResource( 2 )
margin_left = -156.0
margin_top = -63.0
margin_right = 2076.0
margin_bottom = 1192.0
script = ExtResource( 8 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Hum" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 10 )
volume_db = -7.0
autoplay = true

[node name="City" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
volume_db = -7.0
autoplay = true
