[gd_scene load_steps=20 format=2] [ext_resource path="res://Demos/ImpossibleCube/cube_full.obj" type="ArrayMesh" id=2] [ext_resource path="res://Shaders/stencil_mask.shader" type="Shader" id=3] [ext_resource path="res://Demos/ImpossibleCube/cube_stencil.png" type="Texture" id=4] [ext_resource path="res://Demos/ImpossibleCube/Rotate.gd" type="Script" id=5] [ext_resource path="res://Demos/ImpossibleCube/cube_hollow.obj" type="ArrayMesh" id=6] [sub_resource type="SpatialMaterial" id=1] albedo_color = Color( 0.709804, 0.713726, 0.760784, 1 ) metallic = 0.56 metallic_specular = 0.24 roughness = 0.63 [sub_resource type="SphereMesh" id=2] [sub_resource type="ViewportTexture" id=3] viewport_path = NodePath("StencilView") [sub_resource type="ShaderMaterial" id=4] resource_local_to_scene = true shader = ExtResource( 3 ) shader_param/albedo = Color( 0.0431373, 0.941176, 0.921569, 1 ) shader_param/stencil_color = Color( 0, 1, 1, 1 ) shader_param/stencil = SubResource( 3 ) [sub_resource type="CylinderMesh" id=5] [sub_resource type="ViewportTexture" id=6] viewport_path = NodePath("StencilView") [sub_resource type="ShaderMaterial" id=7] resource_local_to_scene = true shader = ExtResource( 3 ) shader_param/albedo = Color( 0.956863, 0.376471, 0.0588235, 1 ) shader_param/stencil_color = Color( 1, 0, 0, 1 ) shader_param/stencil = SubResource( 6 ) [sub_resource type="CapsuleMesh" id=8] [sub_resource type="ViewportTexture" id=9] viewport_path = NodePath("StencilView") [sub_resource type="ShaderMaterial" id=10] resource_local_to_scene = true shader = ExtResource( 3 ) shader_param/albedo = Color( 0.0470588, 0.168627, 0.945098, 1 ) shader_param/stencil_color = Color( 0, 0, 1, 1 ) shader_param/stencil = SubResource( 9 ) [sub_resource type="CubeMesh" id=11] [sub_resource type="ViewportTexture" id=12] viewport_path = NodePath("StencilView") [sub_resource type="ShaderMaterial" id=13] resource_local_to_scene = true shader = ExtResource( 3 ) shader_param/albedo = Color( 0.0705882, 0.94902, 0.290196, 1 ) shader_param/stencil_color = Color( 0, 1, 0, 1 ) shader_param/stencil = SubResource( 12 ) [sub_resource type="SpatialMaterial" id=14] flags_unshaded = true flags_do_not_receive_shadows = true flags_disable_ambient_light = true albedo_texture = ExtResource( 4 ) [node name="ImpossibleCubeDemo" type="Spatial"] [node name="Camera" type="Camera" parent="."] transform = Transform( 0.296699, -0.185551, 0.936771, -0.020768, 0.979456, 0.200584, -0.954745, -0.0789679, 0.28675, 3.98713, 3.1131, 1.61636 ) cull_mask = 1048571 [node name="RemoteTransform" type="RemoteTransform" parent="Camera"] transform = Transform( 1, 7.45058e-09, 8.9407e-08, 0, 1, -3.91155e-08, 5.96046e-08, -2.6077e-08, 1, 0, 0, 0 ) remote_path = NodePath("../../StencilView/Camera") [node name="StencilView" type="Viewport" parent="."] size = Vector2( 1920, 1080 ) transparent_bg = true keep_3d_linear = true usage = 3 render_target_update_mode = 3 [node name="Camera" type="Camera" parent="StencilView"] transform = Transform( 0.296699, -0.185551, 0.936771, -0.020768, 0.979456, 0.200584, -0.954745, -0.0789679, 0.28675, 3.98713, 3.1131, 1.61636 ) cull_mask = 4 [node name="CubeShell" type="MeshInstance" parent="."] transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2.5, 0 ) mesh = ExtResource( 6 ) material/0 = SubResource( 1 ) script = ExtResource( 5 ) [node name="Sphere" type="MeshInstance" parent="CubeShell"] transform = Transform( 0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 0, 0, 0 ) layers = 2 mesh = SubResource( 2 ) material/0 = SubResource( 4 ) [node name="Cylinder" type="MeshInstance" parent="CubeShell"] transform = Transform( 0.25, 0, 0, 0, 0.176777, -0.176777, 0, 0.176777, 0.176777, 0, 0, 0 ) layers = 2 mesh = SubResource( 5 ) material/0 = SubResource( 7 ) [node name="Capsule" type="MeshInstance" parent="CubeShell"] transform = Transform( 0.25, 0, 0, 0, -4.07302e-08, -0.25, 0, 0.25, -4.07302e-08, 0, 0, 0 ) layers = 2 mesh = SubResource( 8 ) material/0 = SubResource( 10 ) [node name="Cube" type="MeshInstance" parent="CubeShell"] transform = Transform( 0.106066, -0.075, -0.075, 0, 0.106066, -0.106066, 0.106066, 0.075, 0.075, 0, 0, 0 ) layers = 2 mesh = SubResource( 11 ) material/0 = SubResource( 13 ) [node name="OmniLight" type="OmniLight" parent="CubeShell"] transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.0194656, 0 ) light_color = Color( 0.313726, 0.54902, 1, 1 ) light_energy = 3.44 light_specular = 1.0 light_bake_mode = 2 light_cull_mask = 4294967294 omni_attenuation = 1.7411 [node name="MeshInstance" type="MeshInstance" parent="CubeShell"] layers = 4 cast_shadow = 0 mesh = ExtResource( 2 ) material/0 = SubResource( 14 )