-
Notifications
You must be signed in to change notification settings - Fork 1
/
Mirror.tscn
45 lines (34 loc) · 1.1 KB
/
Mirror.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
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Mirror.gd" type="Script" id=1]
[sub_resource type="QuadMesh" id=6]
[sub_resource type="Shader" id=7]
code = "shader_type spatial;
render_mode unshaded;
uniform sampler2D texture_L;
uniform sampler2D texture_R;
void fragment(){
vec2 uv = vec2(1.0-UV.x, 1.0-UV.y);
if(VIEW_INDEX==0)
ALBEDO = texture(texture_L,uv).rgb;
else
ALBEDO = texture(texture_R,uv).rgb;
}"
[sub_resource type="ShaderMaterial" id=8]
shader = SubResource( 7 )
[node name="Mirror" type="MeshInstance"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.112532, 0.531346, -0.479882 )
layers = 2
mesh = SubResource( 6 )
material/0 = SubResource( 8 )
script = ExtResource( 1 )
[node name="L" type="Viewport" parent="."]
size = Vector2( 1024, 1024 )
[node name="Camera" type="Camera" parent="L"]
transform = Transform( 0.543057, 0, -0.839696, 0, 1, 0, 0.839696, 0, 0.543057, 0.638257, 0, -1.72943 )
cull_mask = 1048573
projection = 2
[node name="R" type="Viewport" parent="."]
size = Vector2( 1024, 1024 )
[node name="Camera" type="Camera" parent="R"]
cull_mask = 1048573
projection = 2