-
Notifications
You must be signed in to change notification settings - Fork 0
/
portal_frustum.tscn
85 lines (62 loc) · 2.37 KB
/
portal_frustum.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
[gd_scene load_steps=9 format=2]
[ext_resource path="res://portal_frustum.gd" type="Script" id=1]
[sub_resource type="QuadMesh" id=1]
size = Vector2( 1, 2 )
[sub_resource type="Shader" id=2]
code = "shader_type spatial;
render_mode unshaded;
uniform sampler2D viewport_texture;
uniform float scale = 1.0f;
uniform vec2 offset = vec2(0f, 0f);
void fragment() {
// vec2 scaled_uv = SCREEN_UV * scale + vec2((1f - scale) / 2f);
// ALBEDO = texture(viewport_texture, scaled_uv + offset).xyz;
ALBEDO = texture(viewport_texture, UV).xyz;
}"
[sub_resource type="ViewportTexture" id=3]
viewport_path = NodePath("Viewport")
[sub_resource type="ShaderMaterial" id=4]
resource_local_to_scene = true
shader = SubResource( 2 )
shader_param/scale = 1.0
shader_param/offset = Vector2( 0, 0 )
shader_param/viewport_texture = SubResource( 3 )
[sub_resource type="BoxShape" id=5]
extents = Vector3( 0.5, 1, 0.2 )
[sub_resource type="BoxShape" id=6]
extents = Vector3( 0.5, 0.1, 0.1 )
[sub_resource type="BoxShape" id=7]
extents = Vector3( 0.1, 1, 0.1 )
[node name="Portal" type="Area"]
collision_layer = 0
collision_mask = 4101
script = ExtResource( 1 )
[node name="Viewport" type="Viewport" parent="."]
keep_3d_linear = true
render_target_v_flip = true
[node name="Camera" type="Camera" parent="Viewport"]
keep_aspect = 0
projection = 2
[node name="Surface" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = SubResource( 4 )
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.125583 )
shape = SubResource( 5 )
[node name="ExitPoint" type="Spatial" parent="."]
transform = Transform( -1, 0, -3.25841e-07, 0, 1, 0, 3.25841e-07, 0, -1, 0, 0, 0 )
[node name="Boundary" type="StaticBody" parent="."]
collision_layer = 2048
collision_mask = 4101
[node name="Bottom" type="CollisionShape" parent="Boundary"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.1, 0 )
shape = SubResource( 6 )
[node name="Top" type="CollisionShape" parent="Boundary"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 6 )
[node name="Right" type="CollisionShape" parent="Boundary"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0, 0 )
shape = SubResource( 7 )
[node name="Left" type="CollisionShape" parent="Boundary"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0, 0 )
shape = SubResource( 7 )