Merge pull request #55 from TwistedTwigleg/Viewport_demos
Ported viewport demos to Godot 3.0
12
viewport/2d_in_3d/2D_in_3D.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends Spatial
|
||||
|
||||
func _ready():
|
||||
# Get the viewport and clear it
|
||||
var viewport = get_node("Viewport")
|
||||
viewport.clear()
|
||||
# Let two frames pass to make sure the vieport's is captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
# Retrieve the texture and set it to the viewport quad
|
||||
get_node("Viewport_quad").material_override.albedo_texture = viewport.get_texture()
|
||||
|
||||
603
viewport/2d_in_3d/2D_in_3D.tscn
Normal file
@@ -0,0 +1,603 @@
|
||||
[gd_scene load_steps=20 format=2]
|
||||
|
||||
[ext_resource path="res://2D_in_3D.gd" type="Script" id=1]
|
||||
[ext_resource path="res://pong.gd" type="Script" id=2]
|
||||
[ext_resource path="res://ball.png" type="Texture" id=3]
|
||||
[ext_resource path="res://left_pallete.png" type="Texture" id=4]
|
||||
[ext_resource path="res://right_pallete.png" type="Texture" id=5]
|
||||
[ext_resource path="res://separator.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="PlaneMesh" id=1]
|
||||
|
||||
size = Vector2( 2, 2 )
|
||||
subdivide_width = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[sub_resource type="GDScript" id=2]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return .7
|
||||
"
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=3]
|
||||
|
||||
flags_transparent = false
|
||||
flags_unshaded = false
|
||||
flags_vertex_lighting = false
|
||||
flags_on_top = false
|
||||
flags_use_point_size = false
|
||||
flags_fixed_size = false
|
||||
vertex_color_use_as_albedo = false
|
||||
vertex_color_is_srgb = false
|
||||
params_diffuse_mode = 0
|
||||
params_specular_mode = 0
|
||||
params_blend_mode = 0
|
||||
params_cull_mode = 0
|
||||
params_depth_draw_mode = 0
|
||||
params_line_width = 1.0
|
||||
params_point_size = 1.0
|
||||
params_billboard_mode = 0
|
||||
params_grow = false
|
||||
params_use_alpha_scissor = false
|
||||
albedo_color = Color( 1, 1, 1, 1 )
|
||||
metallic = 0.0
|
||||
metallic_specular = 0.5
|
||||
metallic_texture_channel = 0
|
||||
roughness = 0.7
|
||||
roughness_texture_channel = 0
|
||||
emission_enabled = false
|
||||
normal_enabled = false
|
||||
rim_enabled = false
|
||||
clearcoat_enabled = false
|
||||
anisotropy_enabled = false
|
||||
ao_enabled = false
|
||||
depth_enabled = false
|
||||
subsurf_scatter_enabled = false
|
||||
refraction_enabled = false
|
||||
detail_enabled = false
|
||||
uv1_scale = Vector3( 1, 1, 1 )
|
||||
uv1_offset = Vector3( 0, 0, 0 )
|
||||
uv1_triplanar = false
|
||||
uv1_triplanar_sharpness = 1.0
|
||||
uv2_scale = Vector3( 1, 1, 1 )
|
||||
uv2_offset = Vector3( 0, 0, 0 )
|
||||
uv2_triplanar = false
|
||||
uv2_triplanar_sharpness = 1.0
|
||||
script = SubResource( 2 )
|
||||
_sections_unfolded = [ "Roughness" ]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=9]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
|
||||
[sub_resource type="GDScript" id=10]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return .4
|
||||
"
|
||||
|
||||
[sub_resource type="Environment" id=11]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 9 )
|
||||
background_sky_scale = 1.0
|
||||
background_color = Color( 0.445312, 0.445312, 0.445312, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0.511719, 0.511719, 0.511719, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 0.4
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_blur = true
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
script = SubResource( 10 )
|
||||
_sections_unfolded = [ "Ambient Light", "Background" ]
|
||||
|
||||
[sub_resource type="CubeMesh" id=5]
|
||||
|
||||
size = Vector3( 2, 2, 2 )
|
||||
subdivide_width = 0
|
||||
subdivide_height = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=6]
|
||||
|
||||
flags_transparent = false
|
||||
flags_unshaded = false
|
||||
flags_vertex_lighting = false
|
||||
flags_on_top = false
|
||||
flags_use_point_size = false
|
||||
flags_fixed_size = false
|
||||
vertex_color_use_as_albedo = false
|
||||
vertex_color_is_srgb = false
|
||||
params_diffuse_mode = 0
|
||||
params_specular_mode = 0
|
||||
params_blend_mode = 0
|
||||
params_cull_mode = 0
|
||||
params_depth_draw_mode = 0
|
||||
params_line_width = 1.0
|
||||
params_point_size = 1.0
|
||||
params_billboard_mode = 0
|
||||
params_grow = false
|
||||
params_use_alpha_scissor = false
|
||||
albedo_color = Color( 0.652344, 0.652344, 0.652344, 1 )
|
||||
metallic = 0.0
|
||||
metallic_specular = 0.5
|
||||
metallic_texture_channel = 0
|
||||
roughness = 0.0
|
||||
roughness_texture_channel = 0
|
||||
emission_enabled = false
|
||||
normal_enabled = false
|
||||
rim_enabled = false
|
||||
clearcoat_enabled = false
|
||||
anisotropy_enabled = false
|
||||
ao_enabled = false
|
||||
depth_enabled = false
|
||||
subsurf_scatter_enabled = false
|
||||
refraction_enabled = false
|
||||
detail_enabled = false
|
||||
uv1_scale = Vector3( 1, 1, 1 )
|
||||
uv1_offset = Vector3( 0, 0, 0 )
|
||||
uv1_triplanar = false
|
||||
uv1_triplanar_sharpness = 1.0
|
||||
uv2_scale = Vector3( 1, 1, 1 )
|
||||
uv2_offset = Vector3( 0, 0, 0 )
|
||||
uv2_triplanar = false
|
||||
uv2_triplanar_sharpness = 1.0
|
||||
_sections_unfolded = [ "Albedo" ]
|
||||
|
||||
[sub_resource type="GDScript" id=7]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 1
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id=8]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return .7
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id=18]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0.1
|
||||
"
|
||||
|
||||
[sub_resource type="CubeMesh" id=19]
|
||||
|
||||
size = Vector3( 1.1, 0.8, 0.1 )
|
||||
subdivide_width = 0
|
||||
subdivide_height = 0
|
||||
subdivide_depth = 0
|
||||
script = SubResource( 18 )
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=20]
|
||||
|
||||
flags_transparent = false
|
||||
flags_unshaded = false
|
||||
flags_vertex_lighting = false
|
||||
flags_on_top = false
|
||||
flags_use_point_size = false
|
||||
flags_fixed_size = false
|
||||
vertex_color_use_as_albedo = false
|
||||
vertex_color_is_srgb = false
|
||||
params_diffuse_mode = 0
|
||||
params_specular_mode = 0
|
||||
params_blend_mode = 0
|
||||
params_cull_mode = 0
|
||||
params_depth_draw_mode = 0
|
||||
params_line_width = 1.0
|
||||
params_point_size = 1.0
|
||||
params_billboard_mode = 0
|
||||
params_grow = false
|
||||
params_use_alpha_scissor = false
|
||||
albedo_color = Color( 1, 1, 1, 1 )
|
||||
metallic = 0.0
|
||||
metallic_specular = 0.5
|
||||
metallic_texture_channel = 0
|
||||
roughness = 1.0
|
||||
roughness_texture_channel = 0
|
||||
emission_enabled = false
|
||||
normal_enabled = false
|
||||
rim_enabled = false
|
||||
clearcoat_enabled = false
|
||||
anisotropy_enabled = false
|
||||
ao_enabled = false
|
||||
depth_enabled = false
|
||||
subsurf_scatter_enabled = false
|
||||
refraction_enabled = false
|
||||
detail_enabled = false
|
||||
uv1_scale = Vector3( 1, 1, 1 )
|
||||
uv1_offset = Vector3( 0, 0, 0 )
|
||||
uv1_triplanar = false
|
||||
uv1_triplanar_sharpness = 1.0
|
||||
uv2_scale = Vector3( 1, 1, 1 )
|
||||
uv2_offset = Vector3( 0, 0, 0 )
|
||||
uv2_triplanar = false
|
||||
uv2_triplanar_sharpness = 1.0
|
||||
|
||||
[node name="2D_in_3D" type="Spatial"]
|
||||
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.26906, -1.2526 )
|
||||
projection = 0
|
||||
fov = 65.0
|
||||
near = 0.1
|
||||
far = 100.0
|
||||
keep_aspect = 1
|
||||
current = false
|
||||
cull_mask = 1048575
|
||||
environment = null
|
||||
h_offset = 0.0
|
||||
v_offset = 0.0
|
||||
doppler/tracking = 0
|
||||
|
||||
[node name="Floor" type="MeshInstance" parent="."]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, -1, -4 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 1 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 3 )
|
||||
_sections_unfolded = [ "Geometry", "Transform", "material" ]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
|
||||
environment = SubResource( 11 )
|
||||
|
||||
[node name="Pillar" type="Spatial" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
transform = Transform( 0.6, 0, 0, 0, 0.6, 0, 0, 0, 0.6, -3, -0.255171, -5 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Pillar_bottom" type="MeshInstance" parent="Pillar"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.242229, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 7 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar_top" type="MeshInstance" parent="Pillar"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.48747, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 7 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar_middle" type="MeshInstance" parent="Pillar"]
|
||||
|
||||
transform = Transform( 0.7, 0, 0, 0, 2, 0, 0, 0, 0.7, 0, 2.65279, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 8 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar2" type="Spatial" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
transform = Transform( 0.6, 0, 0, 0, 0.6, 0, 0, 0, 0.6, 3, -0.255171, -5 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Pillar_bottom" type="MeshInstance" parent="Pillar2"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.242229, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 7 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar_top" type="MeshInstance" parent="Pillar2"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.48747, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 7 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar_middle" type="MeshInstance" parent="Pillar2"]
|
||||
|
||||
transform = Transform( 0.7, 0, 0, 0, 2, 0, 0, 0, 0.7, 0, 2.65279, 0 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 5 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
script = SubResource( 8 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="Pillar_back" type="MeshInstance" parent="."]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 1.22418, -5.48399 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 19 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 6 )
|
||||
_sections_unfolded = [ "Transform", "material" ]
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="."]
|
||||
|
||||
transform = Transform( 0.844221, -0.229172, 0.484531, -0.202351, 0.700819, 0.684037, -0.496331, -0.675524, 0.545273, 9.02684, 0, 1.28613 )
|
||||
layers = 1
|
||||
light_color = Color( 1, 1, 1, 1 )
|
||||
light_energy = 1.0
|
||||
light_negative = false
|
||||
light_specular = 0.5
|
||||
light_cull_mask = -1
|
||||
shadow_enabled = true
|
||||
shadow_color = Color( 0, 0, 0, 1 )
|
||||
shadow_bias = 0.1
|
||||
shadow_contact = 0.0
|
||||
shadow_max_distance = 200.0
|
||||
editor_only = false
|
||||
directional_shadow_mode = 2
|
||||
directional_shadow_split_1 = 0.1
|
||||
directional_shadow_split_2 = 0.2
|
||||
directional_shadow_split_3 = 0.5
|
||||
directional_shadow_blend_splits = true
|
||||
directional_shadow_normal_bias = 0.2
|
||||
_sections_unfolded = [ "Directional Shadow" ]
|
||||
|
||||
[node name="Viewport_quad" type="MeshInstance" parent="."]
|
||||
|
||||
transform = Transform( -2, 8.74228e-08, 0, 7.64274e-15, 4.37114e-08, 1.333, 1.74846e-07, 1, -5.82673e-08, 0, 1.20996, -5.25875 )
|
||||
layers = 1
|
||||
material_override = SubResource( 20 )
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 1 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
_sections_unfolded = [ "Geometry", "Transform", "material" ]
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="."]
|
||||
|
||||
arvr = false
|
||||
size = Vector2( 600, 400 )
|
||||
own_world = false
|
||||
world = null
|
||||
transparent_bg = false
|
||||
msaa = 0
|
||||
hdr = false
|
||||
disable_3d = false
|
||||
usage = 0
|
||||
debug_draw = 0
|
||||
render_target_v_flip = true
|
||||
render_target_clear_on_new_frame = true
|
||||
render_target_update_mode = 2
|
||||
audio_listener_enable_2d = false
|
||||
audio_listener_enable_3d = false
|
||||
physics_object_picking = false
|
||||
gui_disable_input = false
|
||||
shadow_atlas_size = 0
|
||||
shadow_atlas_quad_0 = 2
|
||||
shadow_atlas_quad_1 = 2
|
||||
shadow_atlas_quad_2 = 3
|
||||
shadow_atlas_quad_3 = 4
|
||||
_sections_unfolded = [ "Render Target" ]
|
||||
|
||||
[node name="2D_World" type="Node2D" parent="Viewport"]
|
||||
|
||||
editor/display_folded = true
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="BG" type="Panel" parent="Viewport/2D_World"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 600.0
|
||||
margin_bottom = 400.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
|
||||
[node name="ball" type="Sprite" parent="Viewport/2D_World"]
|
||||
|
||||
position = Vector2( 300, 200 )
|
||||
texture = ExtResource( 3 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="left" type="Sprite" parent="Viewport/2D_World"]
|
||||
|
||||
position = Vector2( 20, 200 )
|
||||
texture = ExtResource( 4 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="right" type="Sprite" parent="Viewport/2D_World"]
|
||||
|
||||
position = Vector2( 580, 200 )
|
||||
texture = ExtResource( 5 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="separator" type="Sprite" parent="Viewport/2D_World"]
|
||||
|
||||
position = Vector2( 298, 200 )
|
||||
texture = ExtResource( 6 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
|
||||
BIN
viewport/2d_in_3d/ball.png
Normal file
|
After Width: | Height: | Size: 203 B |
23
viewport/2d_in_3d/ball.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/ball.png-9a4ca347acb7532f6ae347744a6b04f7.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
99
viewport/2d_in_3d/default_env.tres
Normal file
@@ -0,0 +1,99 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_scale = 1.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0, 0, 0, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 1.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_blur = true
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
|
||||
BIN
viewport/2d_in_3d/icon.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
23
viewport/2d_in_3d/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
BIN
viewport/2d_in_3d/left_pallete.png
Normal file
|
After Width: | Height: | Size: 200 B |
23
viewport/2d_in_3d/left_pallete.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/left_pallete.png-bc33611074a0f886142e37c77bd2545a.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
66
viewport/2d_in_3d/pong.gd
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
extends Node2D
|
||||
|
||||
# Member variables
|
||||
const INITIAL_BALL_SPEED = 80
|
||||
var ball_speed = INITIAL_BALL_SPEED
|
||||
var screen_size = Vector2(640, 400)
|
||||
# Default ball direction
|
||||
var direction = Vector2(-1, 0)
|
||||
var pad_size = Vector2(8, 32)
|
||||
const PAD_SPEED = 150
|
||||
|
||||
|
||||
func _process(delta):
|
||||
# Get ball position and pad rectangles
|
||||
var ball_pos = get_node("ball").get_position()
|
||||
var left_rect = Rect2(get_node("left").get_position() - pad_size*0.5, pad_size)
|
||||
var right_rect = Rect2(get_node("right").get_position() - pad_size*0.5, pad_size)
|
||||
|
||||
# Integrate new ball postion
|
||||
ball_pos += direction*ball_speed*delta
|
||||
|
||||
# Flip when touching roof or floor
|
||||
if ((ball_pos.y < 0 and direction.y < 0) or (ball_pos.y > screen_size.y and direction.y > 0)):
|
||||
direction.y = -direction.y
|
||||
|
||||
# Flip, change direction and increase speed when touching pads
|
||||
if ((left_rect.has_point(ball_pos) and direction.x < 0) or (right_rect.has_point(ball_pos) and direction.x > 0)):
|
||||
direction.x = -direction.x
|
||||
ball_speed *= 1.1
|
||||
direction.y = randf()*2.0 - 1
|
||||
direction = direction.normalized()
|
||||
|
||||
# Check gameover
|
||||
if (ball_pos.x < 0 or ball_pos.x > screen_size.x):
|
||||
ball_pos = screen_size*0.5
|
||||
ball_speed = INITIAL_BALL_SPEED
|
||||
direction = Vector2(-1, 0)
|
||||
|
||||
get_node("ball").set_position(ball_pos)
|
||||
|
||||
# Move left pad
|
||||
var left_pos = get_node("left").get_position()
|
||||
|
||||
if (left_pos.y > 0 and Input.is_action_pressed("left_move_up")):
|
||||
left_pos.y += -PAD_SPEED*delta
|
||||
if (left_pos.y < screen_size.y and Input.is_action_pressed("left_move_down")):
|
||||
left_pos.y += PAD_SPEED*delta
|
||||
|
||||
get_node("left").set_position(left_pos)
|
||||
|
||||
# Move right pad
|
||||
var right_pos = get_node("right").get_position()
|
||||
|
||||
if (right_pos.y > 0 and Input.is_action_pressed("right_move_up")):
|
||||
right_pos.y += -PAD_SPEED*delta
|
||||
if (right_pos.y < screen_size.y and Input.is_action_pressed("right_move_down")):
|
||||
right_pos.y += PAD_SPEED*delta
|
||||
|
||||
get_node("right").set_position(right_pos)
|
||||
|
||||
|
||||
func _ready():
|
||||
screen_size = get_viewport_rect().size # Get actual size
|
||||
pad_size = get_node("left").get_texture().get_size()
|
||||
set_process(true)
|
||||
30
viewport/2d_in_3d/project.godot
Normal file
@@ -0,0 +1,30 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=3
|
||||
|
||||
[application]
|
||||
|
||||
config/name="2d in 3d"
|
||||
run/main_scene="res://2D_in_3D.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[input]
|
||||
|
||||
left_move_up=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
left_move_down=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
right_move_up=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
right_move_down=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
BIN
viewport/2d_in_3d/right_pallete.png
Normal file
|
After Width: | Height: | Size: 202 B |
23
viewport/2d_in_3d/right_pallete.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/right_pallete.png-fc6e4a6a7c8197834656482b94708e47.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
BIN
viewport/2d_in_3d/separator.png
Normal file
|
After Width: | Height: | Size: 203 B |
23
viewport/2d_in_3d/separator.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/separator.png-f981c8489b9148e2e1dc63398273da74.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
35
viewport/3d_in_2d/3D_in_2D.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Node2D
|
||||
|
||||
# Member variables
|
||||
var viewport = null
|
||||
var sprite = null
|
||||
var viewport_sprite = null
|
||||
|
||||
# variables for the sprite animation
|
||||
const MAX_FRAME_FOR_SPITE = 4
|
||||
const FRAME_SWITCH_TIME = 0.2
|
||||
var frame_swtich_timer = 0
|
||||
|
||||
func _ready():
|
||||
viewport = get_node("Viewport")
|
||||
sprite = get_node("Sprite")
|
||||
viewport_sprite = get_node("Viewport_Sprite")
|
||||
|
||||
# Assign the sprite's texture to the viewport texture
|
||||
viewport.clear()
|
||||
# Let two frames pass to make sure the screen was captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
viewport_sprite.texture = viewport.get_texture()
|
||||
|
||||
set_process(true)
|
||||
|
||||
|
||||
# Simple frame based animation
|
||||
func _process(delta):
|
||||
frame_swtich_timer += delta
|
||||
if (frame_swtich_timer >= FRAME_SWITCH_TIME):
|
||||
frame_swtich_timer -= FRAME_SWITCH_TIME
|
||||
sprite.frame += 1
|
||||
if (sprite.frame > MAX_FRAME_FOR_SPITE):
|
||||
sprite.frame = 0
|
||||
55
viewport/3d_in_2d/3D_in_2D.tscn
Normal file
@@ -0,0 +1,55 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://3D_in_2D.gd" type="Script" id=1]
|
||||
[ext_resource path="res://robot_demo.png" type="Texture" id=2]
|
||||
[ext_resource path="res://player.scn" type="PackedScene" id=3]
|
||||
|
||||
[node name="3D_in_2D" type="Node2D"]
|
||||
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 339.942, 311.204 )
|
||||
scale = Vector2( 3, 3 )
|
||||
texture = ExtResource( 2 )
|
||||
vframes = 2
|
||||
hframes = 16
|
||||
frame = 4
|
||||
_sections_unfolded = [ "Animation", "Transform" ]
|
||||
|
||||
[node name="Viewport_Sprite" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 600, 320 )
|
||||
rotation = 3.14159
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="."]
|
||||
|
||||
arvr = false
|
||||
size = Vector2( 300, 300 )
|
||||
own_world = true
|
||||
world = null
|
||||
transparent_bg = true
|
||||
msaa = 0
|
||||
hdr = false
|
||||
disable_3d = false
|
||||
usage = 2
|
||||
debug_draw = 0
|
||||
render_target_v_flip = false
|
||||
render_target_clear_on_new_frame = true
|
||||
render_target_update_mode = 2
|
||||
audio_listener_enable_2d = false
|
||||
audio_listener_enable_3d = false
|
||||
physics_object_picking = false
|
||||
gui_disable_input = false
|
||||
shadow_atlas_size = 0
|
||||
shadow_atlas_quad_0 = 2
|
||||
shadow_atlas_quad_1 = 2
|
||||
shadow_atlas_quad_2 = 3
|
||||
shadow_atlas_quad_3 = 4
|
||||
_sections_unfolded = [ "Rendering" ]
|
||||
|
||||
[node name="player" parent="Viewport" instance=ExtResource( 3 )]
|
||||
|
||||
|
||||
101
viewport/3d_in_2d/default_env.tres
Normal file
@@ -0,0 +1,101 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.34375, 0.287406, 0.167847, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
_sections_unfolded = [ "Ground" ]
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_scale = 1.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0, 0, 0, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 1.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_blur = true
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
_sections_unfolded = [ "Background" ]
|
||||
|
||||
BIN
viewport/3d_in_2d/icon.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
23
viewport/3d_in_2d/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
14
viewport/3d_in_2d/player.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends KinematicBody
|
||||
|
||||
# A simple program to rotate the model around
|
||||
|
||||
var model = null
|
||||
const SPEED = 40
|
||||
|
||||
func _ready():
|
||||
model = get_node("Armature")
|
||||
set_process(true)
|
||||
|
||||
|
||||
func _process(delta):
|
||||
model.rotation_deg.y += delta * SPEED
|
||||
BIN
viewport/3d_in_2d/player.scn
Normal file
19
viewport/3d_in_2d/project.godot
Normal file
@@ -0,0 +1,19 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=3
|
||||
|
||||
[application]
|
||||
|
||||
config/name="3d in 2d"
|
||||
run/main_scene="res://3D_in_2D.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
BIN
viewport/3d_in_2d/robot_demo.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
23
viewport/3d_in_2d/robot_demo.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/robot_demo.png-8502817e0037b3f31eaca3dae49dcfc5.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
566
viewport/gui_in_3d/Gui_in_3D.tscn
Normal file
@@ -0,0 +1,566 @@
|
||||
[gd_scene load_steps=16 format=2]
|
||||
|
||||
[ext_resource path="res://gui_3d.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="GDScript" id=1]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 1
|
||||
"
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=2]
|
||||
|
||||
flags_transparent = false
|
||||
flags_unshaded = false
|
||||
flags_vertex_lighting = false
|
||||
flags_on_top = false
|
||||
flags_use_point_size = false
|
||||
flags_fixed_size = false
|
||||
vertex_color_use_as_albedo = false
|
||||
vertex_color_is_srgb = false
|
||||
params_diffuse_mode = 0
|
||||
params_specular_mode = 0
|
||||
params_blend_mode = 0
|
||||
params_cull_mode = 0
|
||||
params_depth_draw_mode = 0
|
||||
params_line_width = 1.0
|
||||
params_point_size = 1.0
|
||||
params_billboard_mode = 0
|
||||
params_grow = false
|
||||
params_use_alpha_scissor = false
|
||||
albedo_color = Color( 1, 1, 1, 1 )
|
||||
metallic = 0.0
|
||||
metallic_specular = 0.5
|
||||
metallic_texture_channel = 0
|
||||
roughness = 1.0
|
||||
roughness_texture_channel = 0
|
||||
emission_enabled = false
|
||||
normal_enabled = false
|
||||
rim_enabled = false
|
||||
clearcoat_enabled = false
|
||||
anisotropy_enabled = false
|
||||
ao_enabled = false
|
||||
depth_enabled = false
|
||||
subsurf_scatter_enabled = false
|
||||
refraction_enabled = false
|
||||
detail_enabled = false
|
||||
uv1_scale = Vector3( 1, 1, 1 )
|
||||
uv1_offset = Vector3( 0, 0, 0 )
|
||||
uv1_triplanar = false
|
||||
uv1_triplanar_sharpness = 1.0
|
||||
uv2_scale = Vector3( 1, 1, 1 )
|
||||
uv2_offset = Vector3( 0, 0, 0 )
|
||||
uv2_triplanar = false
|
||||
uv2_triplanar_sharpness = 1.0
|
||||
script = SubResource( 1 )
|
||||
_sections_unfolded = [ "UV1" ]
|
||||
|
||||
[sub_resource type="PlaneMesh" id=3]
|
||||
|
||||
size = Vector2( 2, 2 )
|
||||
subdivide_width = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[sub_resource type="GDScript" id=4]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 90
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id=5]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0.01
|
||||
"
|
||||
|
||||
[sub_resource type="BoxShape" id=6]
|
||||
|
||||
extents = Vector3( 1, 1, 0.01 )
|
||||
script = SubResource( 5 )
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
|
||||
resource_name = "Move_camera"
|
||||
length = 6.0
|
||||
loop = true
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Camera:transform")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 2, 4, 6 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Transform( 0.994592, 0, 0.103856, 0, 1, 0, -0.103856, 0, 0.994592, 0.465682, 0, 1.78523 ), Transform( 0.962984, 0, -0.269557, 0, 1, 0, 0.269557, 0, 0.962984, -0.462237, 0, 2.41934 ), Transform( 0.806599, 0, -0.591098, 0, 1, 0, 0.591098, 0, 0.806599, -1.59502, 0, 2.05358 ), Transform( 0.994592, 0, 0.103856, 0, 1, 0, -0.103856, 0, 0.994592, 0.465682, 0, 1.78523 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="PlaneMesh" id=9]
|
||||
|
||||
size = Vector2( 2, 2 )
|
||||
subdivide_width = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[sub_resource type="GDScript" id=10]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id=11]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 90
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id=12]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0
|
||||
"
|
||||
|
||||
[sub_resource type="CubeMesh" id=13]
|
||||
|
||||
size = Vector3( 2, 2, 2 )
|
||||
subdivide_width = 0
|
||||
subdivide_height = 0
|
||||
subdivide_depth = 0
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=14]
|
||||
|
||||
flags_transparent = false
|
||||
flags_unshaded = false
|
||||
flags_vertex_lighting = false
|
||||
flags_on_top = false
|
||||
flags_use_point_size = false
|
||||
flags_fixed_size = false
|
||||
vertex_color_use_as_albedo = false
|
||||
vertex_color_is_srgb = false
|
||||
params_diffuse_mode = 0
|
||||
params_specular_mode = 0
|
||||
params_blend_mode = 0
|
||||
params_cull_mode = 0
|
||||
params_depth_draw_mode = 0
|
||||
params_line_width = 1.0
|
||||
params_point_size = 1.0
|
||||
params_billboard_mode = 0
|
||||
params_grow = false
|
||||
params_use_alpha_scissor = false
|
||||
albedo_color = Color( 0.722656, 0.791992, 1, 1 )
|
||||
metallic = 0.0
|
||||
metallic_specular = 0.5
|
||||
metallic_texture_channel = 0
|
||||
roughness = 0.0
|
||||
roughness_texture_channel = 0
|
||||
emission_enabled = false
|
||||
normal_enabled = false
|
||||
rim_enabled = false
|
||||
clearcoat_enabled = false
|
||||
anisotropy_enabled = false
|
||||
ao_enabled = false
|
||||
depth_enabled = false
|
||||
subsurf_scatter_enabled = false
|
||||
refraction_enabled = false
|
||||
detail_enabled = false
|
||||
uv1_scale = Vector3( 1, 1, 1 )
|
||||
uv1_offset = Vector3( 0, 0, 0 )
|
||||
uv1_triplanar = false
|
||||
uv1_triplanar_sharpness = 1.0
|
||||
uv2_scale = Vector3( 1, 1, 1 )
|
||||
uv2_offset = Vector3( 0, 0, 0 )
|
||||
uv2_triplanar = false
|
||||
uv2_triplanar_sharpness = 1.0
|
||||
_sections_unfolded = [ "Albedo" ]
|
||||
|
||||
[sub_resource type="GDScript" id=15]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0
|
||||
"
|
||||
|
||||
[node name="Gui_in_3D" type="Spatial"]
|
||||
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
arvr = false
|
||||
size = Vector2( 180, 180 )
|
||||
own_world = false
|
||||
world = null
|
||||
transparent_bg = true
|
||||
msaa = 0
|
||||
hdr = false
|
||||
disable_3d = false
|
||||
usage = 0
|
||||
debug_draw = 0
|
||||
render_target_v_flip = true
|
||||
render_target_clear_on_new_frame = true
|
||||
render_target_update_mode = 2
|
||||
audio_listener_enable_2d = false
|
||||
audio_listener_enable_3d = false
|
||||
physics_object_picking = false
|
||||
gui_disable_input = false
|
||||
shadow_atlas_size = 0
|
||||
shadow_atlas_quad_0 = 2
|
||||
shadow_atlas_quad_1 = 2
|
||||
shadow_atlas_quad_2 = 3
|
||||
shadow_atlas_quad_3 = 4
|
||||
_sections_unfolded = [ "Render Target", "Rendering" ]
|
||||
|
||||
[node name="GUI" type="Control" parent="Viewport"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
_sections_unfolded = [ "Mouse" ]
|
||||
|
||||
[node name="Label" type="Label" parent="Viewport/GUI"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 44.0
|
||||
margin_top = 27.0
|
||||
margin_right = 121.0
|
||||
margin_bottom = 41.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 4
|
||||
text = "Hello world!"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Button" type="Button" parent="Viewport/GUI"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 18.0
|
||||
margin_top = 46.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 73.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "A button!"
|
||||
flat = false
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="Viewport/GUI"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 14.0
|
||||
margin_top = 118.0
|
||||
margin_right = 157.0
|
||||
margin_bottom = 134.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 0
|
||||
min_value = 0.0
|
||||
max_value = 100.0
|
||||
step = 1.0
|
||||
page = 0.0
|
||||
value = 0.0
|
||||
exp_edit = false
|
||||
rounded = false
|
||||
editable = true
|
||||
tick_count = 0
|
||||
ticks_on_borders = false
|
||||
focus_mode = 2
|
||||
|
||||
[node name="TextEdit" type="LineEdit" parent="Viewport/GUI"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 18.0
|
||||
margin_top = 87.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 111.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
expand_to_len = false
|
||||
focus_mode = 2
|
||||
placeholder_alpha = 0.6
|
||||
caret_blink = false
|
||||
caret_blink_speed = 0.65
|
||||
|
||||
[node name="Area" type="Area" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
input_ray_pickable = true
|
||||
input_capture_on_drag = true
|
||||
space_override = 0
|
||||
gravity_point = false
|
||||
gravity_distance_scale = 0.0
|
||||
gravity_vec = Vector3( 0, -1, 0 )
|
||||
gravity = 9.8
|
||||
linear_damp = 0.1
|
||||
angular_damp = 1.0
|
||||
priority = 0.0
|
||||
monitoring = true
|
||||
monitorable = true
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
audio_bus_override = false
|
||||
audio_bus_name = "Master"
|
||||
reverb_bus_enable = false
|
||||
reverb_bus_name = "Master"
|
||||
reverb_bus_amount = 0.0
|
||||
reverb_bus_uniformity = 0.0
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Quad" type="MeshInstance" parent="Area"]
|
||||
|
||||
transform = Transform( -1, 8.74228e-08, -4.37114e-08, -4.37114e-08, 1.91069e-15, 1, 8.74228e-08, 1, 1.91069e-15, 0, 0, 0 )
|
||||
layers = 1
|
||||
material_override = SubResource( 2 )
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 3 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 4 )
|
||||
_sections_unfolded = [ "Geometry", "Transform", "material" ]
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Area"]
|
||||
|
||||
shape = SubResource( 6 )
|
||||
disabled = false
|
||||
|
||||
[node name="Camera" type="Camera" parent="."]
|
||||
|
||||
transform = Transform( 0.994592, 0, 0.103856, 0, 1, 0, -0.103856, 0, 0.994592, 0.465682, 0, 1.78523 )
|
||||
projection = 0
|
||||
fov = 65.0
|
||||
near = 0.1
|
||||
far = 100.0
|
||||
keep_aspect = 1
|
||||
current = false
|
||||
cull_mask = 1048575
|
||||
environment = null
|
||||
h_offset = 0.0
|
||||
v_offset = 0.0
|
||||
doppler/tracking = 0
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="OmniLight" type="OmniLight" parent="."]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.38866, 1.2413, 2.72141 )
|
||||
layers = 1
|
||||
light_color = Color( 1, 1, 1, 1 )
|
||||
light_energy = 1.0
|
||||
light_negative = false
|
||||
light_specular = 0.5
|
||||
light_cull_mask = -1
|
||||
shadow_enabled = true
|
||||
shadow_color = Color( 0, 0, 0, 1 )
|
||||
shadow_bias = 0.15
|
||||
shadow_contact = 0.0
|
||||
shadow_max_distance = 0.0
|
||||
editor_only = false
|
||||
omni_range = 10.0
|
||||
omni_attenuation = 1.0
|
||||
omni_shadow_mode = 1
|
||||
omni_shadow_detail = 1
|
||||
_sections_unfolded = [ "Light", "Omni", "Shadow" ]
|
||||
|
||||
[node name="Camera_Move" type="AnimationPlayer" parent="."]
|
||||
|
||||
playback_process_mode = 1
|
||||
playback_default_blend_time = 0.0
|
||||
root_node = NodePath("..")
|
||||
anims/Move_camera = SubResource( 8 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = "Move_camera"
|
||||
|
||||
[node name="3D_background" type="Spatial" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
|
||||
[node name="Wall" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, -1.74846e-07, -4, 0, 4, -1.74846e-07, -2.60819, 0.589247, -2.08943 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 9 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 10 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Wall2" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, -1.74846e-07, -4, 0, 4, -1.74846e-07, 5.08055, 0.589247, -2.08943 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 9 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 10 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Wall3" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( -1.74846e-07, -4, 0, -1.74846e-07, 7.64274e-15, -4, 4, -1.74846e-07, -1.74846e-07, 9.04446, 0.589247, 1.62058 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 9 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 11 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Floor" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, 4, 0, 0, 0, 4, -2.60819, -2.68765, 1.46502 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 9 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 12 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Floor2" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 4, 0, 0, 0, 4, 0, 0, 0, 4, 5.08055, -2.68765, 1.46502 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 9 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = null
|
||||
script = SubResource( 12 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Cube" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.25901, -0.598608, 0.374871 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 13 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 14 )
|
||||
script = SubResource( 15 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
[node name="Cube2" type="MeshInstance" parent="3D_background"]
|
||||
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.88761, 2.01326, 0.374871 )
|
||||
layers = 1
|
||||
material_override = null
|
||||
cast_shadow = 1
|
||||
extra_cull_margin = 0.0
|
||||
visible_in_all_rooms = false
|
||||
use_in_baked_light = false
|
||||
lod_min_distance = 0.0
|
||||
lod_min_hysteresis = 0.0
|
||||
lod_max_distance = 0.0
|
||||
lod_max_hysteresis = 0.0
|
||||
mesh = SubResource( 13 )
|
||||
skeleton = NodePath("..")
|
||||
material/0 = SubResource( 14 )
|
||||
script = SubResource( 15 )
|
||||
_sections_unfolded = [ "Transform" ]
|
||||
|
||||
|
||||
110
viewport/gui_in_3d/default_env.tres
Normal file
@@ -0,0 +1,110 @@
|
||||
[gd_resource type="Environment" load_steps=3 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0375977, 0.322787, 0.6875, 1 )
|
||||
sky_horizon_color = Color( 0.262024, 0.533321, 0.621094, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
_sections_unfolded = [ "Sky" ]
|
||||
|
||||
[sub_resource type="GDScript" id=2]
|
||||
|
||||
script/source = "tool
|
||||
extends Object
|
||||
func e():
|
||||
return 0
|
||||
"
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_scale = 1.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 1, 1, 1, 1 )
|
||||
ambient_light_energy = 0.28
|
||||
ambient_light_sky_contribution = 0.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_blur = true
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
script = SubResource( 2 )
|
||||
_sections_unfolded = [ "Ambient Light" ]
|
||||
|
||||
75
viewport/gui_in_3d/gui_3d.gd
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
extends Spatial
|
||||
|
||||
# Member variables
|
||||
var prev_pos = null
|
||||
var last_click_pos = null
|
||||
var viewport = null
|
||||
|
||||
|
||||
func _input(event):
|
||||
#Check if the event is a non-mouse event
|
||||
var is_mouse_event = false
|
||||
var mouse_events = [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]
|
||||
for mouse_event in mouse_events:
|
||||
if (event is mouse_event):
|
||||
is_mouse_event = true
|
||||
break
|
||||
|
||||
# If it is, then pass the event to the viewport
|
||||
if (is_mouse_event == false):
|
||||
viewport.input(event)
|
||||
|
||||
|
||||
# Mouse events for Area
|
||||
func _on_area_input_event(camera, event, click_pos, click_normal, shape_idx):
|
||||
|
||||
# Use click pos (click in 3d space, convert to area space)
|
||||
var pos = get_node("Area").get_global_transform().affine_inverse()
|
||||
# the click pos is not zero, then use it to convert from 3D space to area space
|
||||
if (click_pos.x != 0 or click_pos.y != 0 or click_pos.z != 0):
|
||||
pos *= click_pos
|
||||
last_click_pos = click_pos
|
||||
else:
|
||||
# Otherwise, we have a motion event and need to use our last click pos
|
||||
# and move it according to the relative position of the event.
|
||||
# NOTE: this is not an exact 1-1 conversion, but it's pretty close
|
||||
pos *= last_click_pos
|
||||
if (event is InputEventMouseMotion or event is InputEventScreenDrag):
|
||||
pos.x += event.relative.x / viewport.size.x
|
||||
pos.y += event.relative.y / viewport.size.y
|
||||
last_click_pos = pos
|
||||
|
||||
# Convert to 2D
|
||||
pos = Vector2(pos.x, pos.y)
|
||||
|
||||
# Convert to viewport coordinate system
|
||||
# Convert pos to a range from (0 - 1)
|
||||
pos.y *= -1
|
||||
pos += Vector2(1, 1)
|
||||
pos = pos / 2
|
||||
|
||||
# Convert pos to be in range of the viewport
|
||||
pos.x *= viewport.size.x
|
||||
pos.y *= viewport.size.y
|
||||
# Set the position in event
|
||||
event.position = pos
|
||||
event.global_position = pos
|
||||
if (prev_pos == null):
|
||||
prev_pos = pos
|
||||
if (event is InputEventMouseMotion):
|
||||
event.relative = pos - prev_pos
|
||||
prev_pos = pos
|
||||
# Send the event to the viewport
|
||||
viewport.input(event)
|
||||
|
||||
|
||||
func _ready():
|
||||
viewport = get_node("Viewport")
|
||||
get_node("Area").connect("input_event", self, "_on_area_input_event")
|
||||
|
||||
# Set the quad's albedo texture to the viewport texture
|
||||
var tex = viewport.get_texture()
|
||||
get_node("Area/Quad").material_override.albedo_texture = tex
|
||||
|
||||
set_process_input(true)
|
||||
BIN
viewport/gui_in_3d/icon.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
23
viewport/gui_in_3d/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
19
viewport/gui_in_3d/project.godot
Normal file
@@ -0,0 +1,19 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=3
|
||||
|
||||
[application]
|
||||
|
||||
config/name="gui in 3d"
|
||||
run/main_scene="res://Gui_in_3D.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
82
viewport/screen_capture/CaptureScreen.tscn
Normal file
@@ -0,0 +1,82 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://screen_capture.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mountains.png" type="Texture" id=2]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="BG" type="TextureRect" parent="."]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = 986.0
|
||||
margin_bottom = 560.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
texture = ExtResource( 2 )
|
||||
expand = true
|
||||
_sections_unfolded = [ "Anchor" ]
|
||||
|
||||
[node name="capture" type="TextureRect" parent="."]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = 2013.0
|
||||
margin_bottom = 1162.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
rect_scale = Vector2( 0.5, 0.5 )
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
expand = true
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 48.0
|
||||
margin_top = 53.0
|
||||
margin_right = 188.0
|
||||
margin_bottom = 113.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 0
|
||||
size_flags_horizontal = 1
|
||||
size_flags_vertical = 1
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
group = null
|
||||
text = "Capture screen"
|
||||
flat = false
|
||||
_sections_unfolded = [ "Rect" ]
|
||||
|
||||
|
||||
99
viewport/screen_capture/default_env.tres
Normal file
@@ -0,0 +1,99 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
radiance_size = 4
|
||||
sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 )
|
||||
sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 )
|
||||
sky_curve = 0.25
|
||||
sky_energy = 1.0
|
||||
ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 )
|
||||
ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 )
|
||||
ground_curve = 0.01
|
||||
ground_energy = 1.0
|
||||
sun_color = Color( 1, 1, 1, 1 )
|
||||
sun_latitude = 35.0
|
||||
sun_longitude = 0.0
|
||||
sun_angle_min = 1.0
|
||||
sun_angle_max = 100.0
|
||||
sun_curve = 0.05
|
||||
sun_energy = 16.0
|
||||
texture_size = 2
|
||||
|
||||
[resource]
|
||||
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
background_sky_scale = 1.0
|
||||
background_color = Color( 0, 0, 0, 1 )
|
||||
background_energy = 1.0
|
||||
background_canvas_max_layer = 0
|
||||
ambient_light_color = Color( 0, 0, 0, 1 )
|
||||
ambient_light_energy = 1.0
|
||||
ambient_light_sky_contribution = 1.0
|
||||
fog_enabled = false
|
||||
fog_color = Color( 0.5, 0.6, 0.7, 1 )
|
||||
fog_sun_color = Color( 1, 0.9, 0.7, 1 )
|
||||
fog_sun_amount = 0.0
|
||||
fog_depth_enabled = true
|
||||
fog_depth_begin = 10.0
|
||||
fog_depth_curve = 1.0
|
||||
fog_transmit_enabled = false
|
||||
fog_transmit_curve = 1.0
|
||||
fog_height_enabled = false
|
||||
fog_height_min = 0.0
|
||||
fog_height_max = 100.0
|
||||
fog_height_curve = 1.0
|
||||
tonemap_mode = 0
|
||||
tonemap_exposure = 1.0
|
||||
tonemap_white = 1.0
|
||||
auto_exposure_enabled = false
|
||||
auto_exposure_scale = 0.4
|
||||
auto_exposure_min_luma = 0.05
|
||||
auto_exposure_max_luma = 8.0
|
||||
auto_exposure_speed = 0.5
|
||||
ss_reflections_enabled = false
|
||||
ss_reflections_max_steps = 64
|
||||
ss_reflections_fade_in = 0.15
|
||||
ss_reflections_fade_out = 2.0
|
||||
ss_reflections_depth_tolerance = 0.2
|
||||
ss_reflections_roughness = true
|
||||
ssao_enabled = false
|
||||
ssao_radius = 1.0
|
||||
ssao_intensity = 1.0
|
||||
ssao_radius2 = 0.0
|
||||
ssao_intensity2 = 1.0
|
||||
ssao_bias = 0.01
|
||||
ssao_light_affect = 0.0
|
||||
ssao_color = Color( 0, 0, 0, 1 )
|
||||
ssao_blur = true
|
||||
dof_blur_far_enabled = false
|
||||
dof_blur_far_distance = 10.0
|
||||
dof_blur_far_transition = 5.0
|
||||
dof_blur_far_amount = 0.1
|
||||
dof_blur_far_quality = 1
|
||||
dof_blur_near_enabled = false
|
||||
dof_blur_near_distance = 2.0
|
||||
dof_blur_near_transition = 1.0
|
||||
dof_blur_near_amount = 0.1
|
||||
dof_blur_near_quality = 1
|
||||
glow_enabled = false
|
||||
glow_levels/1 = false
|
||||
glow_levels/2 = false
|
||||
glow_levels/3 = true
|
||||
glow_levels/4 = false
|
||||
glow_levels/5 = true
|
||||
glow_levels/6 = false
|
||||
glow_levels/7 = false
|
||||
glow_intensity = 0.8
|
||||
glow_strength = 1.0
|
||||
glow_bloom = 0.0
|
||||
glow_blend_mode = 2
|
||||
glow_hdr_threshold = 1.0
|
||||
glow_hdr_scale = 2.0
|
||||
glow_bicubic_upscale = false
|
||||
adjustment_enabled = false
|
||||
adjustment_brightness = 1.0
|
||||
adjustment_contrast = 1.0
|
||||
adjustment_saturation = 1.0
|
||||
|
||||
BIN
viewport/screen_capture/icon.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
23
viewport/screen_capture/icon.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
BIN
viewport/screen_capture/mountains.png
Normal file
|
After Width: | Height: | Size: 906 KiB |
23
viewport/screen_capture/mountains.png.import
Normal file
@@ -0,0 +1,23 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/mountains.png-03f302fbd9195711fc86ea8f28ca435e.stex"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
18
viewport/screen_capture/project.godot
Normal file
@@ -0,0 +1,18 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=3
|
||||
|
||||
[application]
|
||||
|
||||
config/name="screen capture"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_environment="res://default_env.tres"
|
||||
22
viewport/screen_capture/screen_capture.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
extends Control
|
||||
|
||||
|
||||
func _ready():
|
||||
get_node("Button").connect("pressed", self, "_on_button_pressed");
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
get_viewport().clear()
|
||||
# Let two frames pass to make sure the screen was captured
|
||||
yield(get_tree(), "idle_frame")
|
||||
yield(get_tree(), "idle_frame")
|
||||
# Retrieve the captured image
|
||||
var img = get_viewport().get_texture().get_data()
|
||||
# Flip it on the y-axis (because it's flipped)
|
||||
img.flip_y()
|
||||
# Create a texture for it
|
||||
var tex = ImageTexture.new()
|
||||
tex.create_from_image(img)
|
||||
# Set it to the capture node
|
||||
get_node("capture").set_texture(tex)
|
||||