diff --git a/Nikita/camera_hub.tscn b/Nikita/camera_hub.tscn new file mode 100644 index 0000000..a3de1a0 --- /dev/null +++ b/Nikita/camera_hub.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=3 uid="uid://tvwwstaorixw"] + +[ext_resource type="Script" uid="uid://co77n1eq661oo" path="res://Nikita/scripts/camera_hub.gd" id="1_1mhol"] + +[node name="CameraHub" type="Node3D"] +script = ExtResource("1_1mhol") + +[node name="XRotation" type="Node3D" parent="."] + +[node name="Camera3D" type="Camera3D" parent="XRotation"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1) diff --git a/Nikita/earth.tscn b/Nikita/earth.tscn new file mode 100644 index 0000000..8a02c96 --- /dev/null +++ b/Nikita/earth.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=6 format=3 uid="uid://cjlojmoyhw2cp"] + +[ext_resource type="PackedScene" uid="uid://7fijqcjxggit" path="res://Nikita/source/Earth_Final.fbx" id="1_mnd7v"] +[ext_resource type="Texture2D" uid="uid://cw4gkryn2sl7y" path="res://Nikita/textures/Earth2_Water_BaseColor.png" id="2_v2ft5"] +[ext_resource type="Texture2D" uid="uid://da0uksbt2mkqw" path="res://Nikita/textures/Earth2_Land_BaseColor.png" id="3_drefq"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tyl1s"] +albedo_texture = ExtResource("2_v2ft5") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3pxso"] +albedo_texture = ExtResource("3_drefq") + +[node name="Earth_Final" instance=ExtResource("1_mnd7v")] + +[node name="earth4" parent="." index="0"] +surface_material_override/0 = SubResource("StandardMaterial3D_tyl1s") +surface_material_override/1 = SubResource("StandardMaterial3D_3pxso") diff --git a/Nikita/hub_scene.tscn b/Nikita/hub_scene.tscn new file mode 100644 index 0000000..ffd0bec --- /dev/null +++ b/Nikita/hub_scene.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=7 format=3 uid="uid://b6kb866y3e4aa"] + +[ext_resource type="PackedScene" uid="uid://cjlojmoyhw2cp" path="res://Nikita/earth.tscn" id="1_248vy"] +[ext_resource type="Texture2D" uid="uid://cn2wdmm2xiodm" path="res://Nikita/textures/panorama_image.png" id="2_vvf8p"] +[ext_resource type="PackedScene" uid="uid://tvwwstaorixw" path="res://Nikita/camera_hub.tscn" id="3_ur8lc"] + +[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_ur8lc"] +panorama = ExtResource("2_vvf8p") + +[sub_resource type="Sky" id="Sky_fkqbs"] +sky_material = SubResource("PanoramaSkyMaterial_ur8lc") + +[sub_resource type="Environment" id="Environment_ur8lc"] +background_mode = 2 +sky = SubResource("Sky_fkqbs") + +[node name="Node3D" type="Node3D"] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_ur8lc") + +[node name="Earth_Final2" parent="." instance=ExtResource("1_248vy")] +transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0) + +[node name="CameraHub" parent="." instance=ExtResource("3_ur8lc")] +transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0) + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(0.0337074, -0.226039, 0.973535, 0.00782163, 0.974118, 0.225904, -0.999401, 0, 0.034603, 15.6131, 3.61956, 0) diff --git a/Nikita/scripts/camera_hub.gd b/Nikita/scripts/camera_hub.gd new file mode 100644 index 0000000..acf671d --- /dev/null +++ b/Nikita/scripts/camera_hub.gd @@ -0,0 +1,68 @@ +extends Node3D + +var rotation_speed = PI/2 +var min_zoom = 1.3 +var max_zoom = 5.0 +var zoom_speed = 0.2 + +var zoom = 2.0 +var mouse_grab_sensitivity = 0.006 +var grabbed : bool = false +var velocity_y = 0.0 +var dampening_y = 0.3 +var stop_threashold_y = 0.5 +var velocity_x = 0.0 +var dampening_x = 0.1 +var stop_threashold_x = 0.3 + +func _process(delta: float) -> void: + $XRotation.rotation.x = clamp($XRotation.rotation.x, -1.3, 1.3) + scale = lerp(scale, Vector3.ONE * zoom, zoom_speed) + velocity_y = clamp(velocity_y, -100.0, 100.0) + velocity_x = clamp(velocity_x, -10.0, 10.0) + if !grabbed: + rotate_object_local(Vector3.UP, -1 * velocity_y * mouse_grab_sensitivity) + if velocity_y > stop_threashold_y: + velocity_y -= dampening_y + elif velocity_y < -stop_threashold_y: + velocity_y += dampening_y + else: + velocity_y = 0.0 + $XRotation.rotate_object_local(Vector3.RIGHT, -1 * velocity_x * mouse_grab_sensitivity) + if velocity_x > stop_threashold_x: + velocity_x -= dampening_x + elif velocity_x < -stop_threashold_x: + velocity_x += dampening_x + else: + velocity_x = 0.0 + $XRotation.rotation.x = clamp($XRotation.rotation.x, -1.3, 1.3) + +func _unhandled_input(event: InputEvent) -> void: + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT: + grabbed = event.pressed + if grabbed: + velocity_x = 0.0 + velocity_y = 0.0 + elif event.button_index == MOUSE_BUTTON_WHEEL_UP: + zoom -= zoom_speed + elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN: + zoom += zoom_speed + zoom = clamp(zoom, min_zoom, max_zoom) + if event is InputEventMouseMotion and grabbed: + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + if event.relative.x != 0: + var x_rotation = clamp(event.relative.x, -30, 30) + if abs(event.relative.x - x_rotation) > 0: + velocity_y = event.relative.x - x_rotation + rotate_object_local(Vector3.UP, -1 * x_rotation * mouse_grab_sensitivity) + if event.relative.y != 0: + var y_rotation = clamp(event.relative.y, -10, 10) + if abs(event.relative.y - y_rotation) > 0: + velocity_x = event.relative.y - y_rotation + $XRotation.rotate_object_local(Vector3.RIGHT, -1 * y_rotation * mouse_grab_sensitivity) + else: + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + +func get_mouse_input(delta: float): + return diff --git a/Nikita/scripts/camera_hub.gd.uid b/Nikita/scripts/camera_hub.gd.uid new file mode 100644 index 0000000..e6c20f9 --- /dev/null +++ b/Nikita/scripts/camera_hub.gd.uid @@ -0,0 +1 @@ +uid://co77n1eq661oo diff --git a/Nikita/source/Earth_Final.fbx b/Nikita/source/Earth_Final.fbx new file mode 100644 index 0000000..564ed57 Binary files /dev/null and b/Nikita/source/Earth_Final.fbx differ diff --git a/Nikita/source/Earth_Final.fbx.import b/Nikita/source/Earth_Final.fbx.import new file mode 100644 index 0000000..102bff7 --- /dev/null +++ b/Nikita/source/Earth_Final.fbx.import @@ -0,0 +1,38 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://7fijqcjxggit" +path="res://.godot/imported/Earth_Final.fbx-82ce24a36b10df65c736c390f1ab8d63.scn" + +[deps] + +source_file="res://Nikita/source/Earth_Final.fbx" +dest_files=["res://.godot/imported/Earth_Final.fbx-82ce24a36b10df65c736c390f1ab8d63.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=true +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +_subresources={} +fbx/importer=0 +fbx/allow_geometry_helper_nodes=false +fbx/embedded_image_handling=1 diff --git a/Nikita/textures/Earth2_Land_BaseColor.png b/Nikita/textures/Earth2_Land_BaseColor.png new file mode 100644 index 0000000..2f42ed6 Binary files /dev/null and b/Nikita/textures/Earth2_Land_BaseColor.png differ diff --git a/Nikita/textures/Earth2_Land_BaseColor.png.import b/Nikita/textures/Earth2_Land_BaseColor.png.import new file mode 100644 index 0000000..e1f8a19 --- /dev/null +++ b/Nikita/textures/Earth2_Land_BaseColor.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://da0uksbt2mkqw" +path.s3tc="res://.godot/imported/Earth2_Land_BaseColor.png-7ee2f5da2a05aadb931d4316a8113a29.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Nikita/textures/Earth2_Land_BaseColor.png" +dest_files=["res://.godot/imported/Earth2_Land_BaseColor.png-7ee2f5da2a05aadb931d4316a8113a29.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="uid://bknabbn1h3w2q" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/Nikita/textures/Earth2_Land_Roughness.png b/Nikita/textures/Earth2_Land_Roughness.png new file mode 100644 index 0000000..4b18c7c Binary files /dev/null and b/Nikita/textures/Earth2_Land_Roughness.png differ diff --git a/Nikita/textures/Earth2_Land_Roughness.png.import b/Nikita/textures/Earth2_Land_Roughness.png.import new file mode 100644 index 0000000..8948468 --- /dev/null +++ b/Nikita/textures/Earth2_Land_Roughness.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bknabbn1h3w2q" +path="res://.godot/imported/Earth2_Land_Roughness.png-249e734ef9e5504f2a4e037209f1c48d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Nikita/textures/Earth2_Land_Roughness.png" +dest_files=["res://.godot/imported/Earth2_Land_Roughness.png-249e734ef9e5504f2a4e037209f1c48d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Nikita/textures/Earth2_Water_BaseColor.png b/Nikita/textures/Earth2_Water_BaseColor.png new file mode 100644 index 0000000..06902bc Binary files /dev/null and b/Nikita/textures/Earth2_Water_BaseColor.png differ diff --git a/Nikita/textures/Earth2_Water_BaseColor.png.import b/Nikita/textures/Earth2_Water_BaseColor.png.import new file mode 100644 index 0000000..15e28f6 --- /dev/null +++ b/Nikita/textures/Earth2_Water_BaseColor.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw4gkryn2sl7y" +path.s3tc="res://.godot/imported/Earth2_Water_BaseColor.png-6206b41a43a411cb6e46ce8bd7b1b1da.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Nikita/textures/Earth2_Water_BaseColor.png" +dest_files=["res://.godot/imported/Earth2_Water_BaseColor.png-6206b41a43a411cb6e46ce8bd7b1b1da.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="uid://c85cxc0wihnpt" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/Nikita/textures/Earth2_Water_Roughness.png b/Nikita/textures/Earth2_Water_Roughness.png new file mode 100644 index 0000000..4b7c20a Binary files /dev/null and b/Nikita/textures/Earth2_Water_Roughness.png differ diff --git a/Nikita/textures/Earth2_Water_Roughness.png.import b/Nikita/textures/Earth2_Water_Roughness.png.import new file mode 100644 index 0000000..cf671ec --- /dev/null +++ b/Nikita/textures/Earth2_Water_Roughness.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c85cxc0wihnpt" +path="res://.godot/imported/Earth2_Water_Roughness.png-b18c4d0abfc494db36920a42508774ae.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Nikita/textures/Earth2_Water_Roughness.png" +dest_files=["res://.godot/imported/Earth2_Water_Roughness.png-b18c4d0abfc494db36920a42508774ae.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Nikita/textures/panorama_image.png b/Nikita/textures/panorama_image.png new file mode 100644 index 0000000..8f7e8a9 Binary files /dev/null and b/Nikita/textures/panorama_image.png differ diff --git a/Nikita/textures/panorama_image.png.import b/Nikita/textures/panorama_image.png.import new file mode 100644 index 0000000..c747d86 --- /dev/null +++ b/Nikita/textures/panorama_image.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cn2wdmm2xiodm" +path.s3tc="res://.godot/imported/panorama_image.png-9f73dc15751376ad3428d34ab0c4c787.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Nikita/textures/panorama_image.png" +dest_files=["res://.godot/imported/panorama_image.png-9f73dc15751376ad3428d34ab0c4c787.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/project.godot b/project.godot index 35a17ba..c164b93 100644 --- a/project.godot +++ b/project.godot @@ -11,5 +11,10 @@ config_version=5 [application] config/name="AllAroundTheWorld" +run/main_scene="uid://b6kb866y3e4aa" config/features=PackedStringArray("4.4", "Forward Plus") config/icon="res://icon.svg" + +[rendering] + +renderer/rendering_method="gl_compatibility"