phs-galaxy/World.tscn

200 lines
378 KiB
Plaintext
Raw Normal View History

[gd_scene load_steps=23 format=2]
2021-03-25 21:36:04 +01:00
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
2021-03-25 21:36:04 +01:00
[ext_resource path="res://Planets.gd" type="Script" id=2]
[ext_resource path="res://Planet.gd" type="Script" id=3]
[ext_resource path="res://Materials/PlanetMaterial.tres" type="Material" id=4]
[ext_resource path="res://MovingPlatform.gd" type="Script" id=5]
[ext_resource path="res://ShootyEnemy.tscn" type="PackedScene" id=6]
[ext_resource path="res://Materials/GasGiantMaterial.tres" type="Material" id=7]
[ext_resource path="res://Materials/PerlinPlanetShader.shader" type="Shader" id=8]
2021-06-07 20:13:17 +02:00
[ext_resource path="res://Resources/gas_planet_flowmap.png" type="Texture" id=9]
[ext_resource path="res://Resources/gas_planet_base.png" type="Texture" id=10]
[ext_resource path="res://LerpedFollow.gd" type="Script" id=11]
2021-03-25 21:36:04 +01:00
[sub_resource type="CubeMesh" id=1]
size = Vector3( 10, 0.5, 10 )
[sub_resource type="ConcavePolygonShape" id=12]
data = PoolVector3Array( -5, 0.25, 5, 5, 0.25, 5, -5, -0.25, 5, 5, 0.25, 5, 5, -0.25, 5, -5, -0.25, 5, 5, 0.25, -5, -5, 0.25, -5, 5, -0.25, -5, -5, 0.25, -5, -5, -0.25, -5, 5, -0.25, -5, 5, 0.25, 5, 5, 0.25, -5, 5, -0.25, 5, 5, 0.25, -5, 5, -0.25, -5, 5, -0.25, 5, -5, 0.25, -5, -5, 0.25, 5, -5, -0.25, -5, -5, 0.25, 5, -5, -0.25, 5, -5, -0.25, -5, 5, 0.25, 5, -5, 0.25, 5, 5, 0.25, -5, -5, 0.25, 5, -5, 0.25, -5, 5, 0.25, -5, -5, -0.25, 5, 5, -0.25, 5, -5, -0.25, -5, 5, -0.25, 5, 5, -0.25, -5, -5, -0.25, -5 )
[sub_resource type="PhysicsMaterial" id=3]
2021-04-22 23:40:01 +02:00
friction = 0.0
[sub_resource type="SphereMesh" id=4]
2021-03-25 21:36:04 +01:00
radius = 20.0
height = 40.0
[sub_resource type="ConvexPolygonShape" id=5]
2021-03-25 21:36:04 +01:00
points = PoolVector3Array( 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 0, 19.9094, 1.90112, 0.186342, 19.9094, 1.89197, 0.37089, 19.9094, 1.86459, 0.551866, 19.9094, 1.81926, 0.727527, 19.9094, 1.75641, 0.896182, 19.9094, 1.67664, 1.05621, 19.9094, 1.58072, 1.20606, 19.9094, 1.46959, 1.3443, 19.9094, 1.3443, 1.46959, 19.9094, 1.20606, 1.58072, 19.9094, 1.05621, 1.67664, 19.9094, 0.896182, 1.75641, 19.9094, 0.727527, 1.81926, 19.9094, 0.551866, 1.86459, 19.9094, 0.37089, 1.89197, 19.9094, 0.186342, 1.90112, 19.9094, 1.1641e-16, 1.89197, 19.9094, -0.186342, 1.86459, 19.9094, -0.37089, 1.81926, 19.9094, -0.551866, 1.75641, 19.9094, -0.727527, 1.67664, 19.9094, -0.896182, 1.58072, 19.9094, -1.05621, 1.46959, 19.9094, -1.20606, 1.3443, 19.9094, -1.3443, 1.20606, 19.9094, -1.46959, 1.05621, 19.9094, -1.58072, 0.896182, 19.9094, -1.67664, 0.727527, 19.9094, -1.75641, 0.551866, 19.9094, -1.81926, 0.37089, 19.9094, -1.86459, 0.186342, 19.9094, -1.89197, 2.3282e-16, 19.9094, -1.90112, -0.186342, 19.9094, -1.89197, -0.37089, 19.9094, -1.86459, -0.551866, 19.9094, -1.81926, -0.727527, 19.9094, -1.75641, -0.896182, 19.9094, -1.67664, -1.05621, 19.9094, -1.58072, -1.20606, 19.9094, -1.46959, -1.3443, 19.9094, -1.3443, -1.46959, 19.9094, -1.20606, -1.58072, 19.9094, -1.05621, -1.67664, 19.9094, -0.896182, -1.75641, 19.9094, -0.727527, -1.81926, 19.9094, -0.551866, -1.86459, 19.9094, -0.37089, -1.89197, 19.9094, -0.186342, -1.90112, 19.9094, -3.4923e-16, -1.89197, 19.9094, 0.186342, -1.86459, 19.9094, 0.37089, -1.81926, 19.9094, 0.551866, -1.75641, 19.9094, 0.727527, -1.67664, 19.9094, 0.896182, -1.58072, 19.9094, 1.05621, -1.46959, 19.9094, 1.20606, -1.3443, 19.9094, 1.3443, -1.20606, 19.9094, 1.46959, -1.05621, 19.9094, 1.58072, -0.896182, 19.9094, 1.67664, -0.727527, 19.9094, 1.75641, -0.551866, 19.9094, 1.81926, -0.37089, 19.9094, 1.86459, -0.186342, 19.9094, 1.89197, -4.6564e-16, 19.9094, 1.90112, 0, 19.6386, 3.78502, 0.370997, 19.6386, 3.7668, 0.738422, 19.6386, 3.7123, 1.09873, 19.6386, 3.62204, 1.44847, 19.6386, 3.49691, 1.78425, 19.6386, 3.33809, 2.10285, 19.6386, 3.14713, 2.40119, 19.6386, 2.92586, 2.67642, 19.6386, 2.67642, 2.92586, 19.6386, 2.40119, 3.14713, 19.6386, 2.10285, 3.33809, 19.6386, 1.78425, 3.49691, 19.6386, 1.44847, 3.62204, 19.6386, 1.09873, 3.7123, 19.6386, 0.738422, 3.7668, 19.6386, 0.370997, 3.78502, 19.6386, 2.31766e-16, 3.7668, 19.6386, -0.370997, 3.7123, 19.6386, -0.738422, 3.62204, 19.6386, -1.09873, 3.49691, 19.6386, -1.44847, 3.33809, 19.6386, -1.78425, 3.14713, 19.6386, -2.10285, 2.92586, 19.6386, -2.40119, 2.67642, 19.6386, -2.67642, 2.40119, 19.6386, -2.92586, 2.10285, 19.6386, -3.14713, 1.78425, 19.6386, -3.33809, 1.44847, 19.6386, -3.49691, 1.09873, 19.6386, -3.62204, 0.738422, 19.6386, -3.7123, 0.370997, 19.6386, -3.7668, 4.63532e-16, 19.6386, -3.78502, -0.370997, 19.6386, -3.7668, -0.738422, 19.6386, -3.7123, -1.09873, 19.6386, -3.62204, -1.44847, 19.6386, -3.49691, -1.78425, 19.6386, -3.33809, -2.10285, 19.6386, -3.14713, -2.40119, 19.6386, -2.92586, -2.67642, 19.6386, -2.67642, -2.92586, 19.6386, -2.40119, -3.14713, 19.6386, -2.10285, -3.33809, 19.6386, -1.78425, -3.49691, 19.6386, -1.44847, -3.62204, 19.6386, -1.09873, -3.7123, 19.6386, -0.738422, -3.7668, 19.6386, -0.370997, -3.78502, 19.6386, -6.95298e-16, -3.7668, 19.6386, 0.370997, -3.7123, 19.6386, 0.738422, -3.62204, 19.6386, 1.09873, -3.49691, 19.6386, 1.44847, -3.33809, 19.6386, 1.78425, -3.14713, 19.6386, 2.10285, -2.92586, 19.6386, 2.401
[sub_resource type="SphereMesh" id=6]
2021-04-22 23:40:01 +02:00
radius = 15.0
height = 30.0
[sub_resource type="ShaderMaterial" id=7]
resource_local_to_scene = true
shader = ExtResource( 8 )
shader_param/scale = Vector2( 50, 50 )
shader_param/seamless = false
shader_param/color_scale = Color( 0.670588, 0.211765, 0.14902, 1 )
[sub_resource type="ConcavePolygonShape" id=8]
2021-04-22 23:40:01 +02:00
data = PoolVector3Array( 0, 15, 0, 0, 15, 0, 0, 14.9321, 1.4258, 0, 15, 0, 0.1398, 14.9321, 1.419, 0, 14.9321, 1.4258, 0, 15, 0, 0, 15, 0, 0.1398, 14.9321, 1.419, 0, 15, 0, 0.2782, 14.9321, 1.3984, 0.1398, 14.9321, 1.419, 0, 15, 0, 0, 15, 0, 0.2782, 14.9321, 1.3984, 0, 15, 0, 0.4139, 14.9321, 1.3644, 0.2782, 14.9321, 1.3984, 0, 15, 0, 0, 15, 0, 0.4139, 14.9321, 1.3644, 0, 15, 0, 0.5456, 14.9321, 1.3173, 0.4139, 14.9321, 1.3644, 0, 15, 0, 0, 15, 0, 0.5456, 14.9321, 1.3173, 0, 15, 0, 0.6721, 14.9321, 1.2575, 0.5456, 14.9321, 1.3173, 0, 15, 0, 0, 15, 0, 0.6721, 14.9321, 1.2575, 0, 15, 0, 0.7922, 14.9321, 1.1855, 0.6721, 14.9321, 1.2575, 0, 15, 0, 0, 15, 0, 0.7922, 14.9321, 1.1855, 0, 15, 0, 0.9045, 14.9321, 1.1022, 0.7922, 14.9321, 1.1855, 0, 15, 0, 0, 15, 0, 0.9045, 14.9321, 1.1022, 0, 15, 0, 1.0082, 14.9321, 1.0082, 0.9045, 14.9321, 1.1022, 0, 15, 0, 0, 15, 0, 1.0082, 14.9321, 1.0082, 0, 15, 0, 1.1022, 14.9321, 0.9045, 1.0082, 14.9321, 1.0082, 0, 15, 0, 0, 15, 0, 1.1022, 14.9321, 0.9045, 0, 15, 0, 1.1855, 14.9321, 0.7922, 1.1022, 14.9321, 0.9045, 0, 15, 0, 0, 15, 0, 1.1855, 14.9321, 0.7922, 0, 15, 0, 1.2575, 14.9321, 0.6721, 1.1855, 14.9321, 0.7922, 0, 15, 0, 0, 15, 0, 1.2575, 14.9321, 0.6721, 0, 15, 0, 1.3173, 14.9321, 0.5456, 1.2575, 14.9321, 0.6721, 0, 15, 0, 0, 15, 0, 1.3173, 14.9321, 0.5456, 0, 15, 0, 1.3644, 14.9321, 0.4139, 1.3173, 14.9321, 0.5456, 0, 15, 0, 0, 15, 0, 1.3644, 14.9321, 0.4139, 0, 15, 0, 1.3984, 14.9321, 0.2782, 1.3644, 14.9321, 0.4139, 0, 15, 0, 0, 15, 0, 1.3984, 14.9321, 0.2782, 0, 15, 0, 1.419, 14.9321, 0.1398, 1.3984, 14.9321, 0.2782, 0, 15, 0, 0, 15, 0, 1.419, 14.9321, 0.1398, 0, 15, 0, 1.4258, 14.9321, 0, 1.419, 14.9321, 0.1398, 0, 15, 0, 0, 15, 0, 1.4258, 14.9321, 0, 0, 15, 0, 1.419, 14.9321, -0.1398, 1.4258, 14.9321, 0, 0, 15, 0, 0, 15, 0, 1.419, 14.9321, -0.1398, 0, 15, 0, 1.3984, 14.9321, -0.2782, 1.419, 14.9321, -0.1398, 0, 15, 0, 0, 15, 0, 1.3984, 14.9321, -0.2782, 0, 15, 0, 1.3644, 14.9321, -0.4139, 1.3984, 14.9321, -0.2782, 0, 15, 0, 0, 15, 0, 1.3644, 14.9321, -0.4139, 0, 15, 0, 1.3173, 14.9321, -0.5456, 1.3644, 14.9321, -0.4139, 0, 15, 0, 0, 15, 0, 1.3173, 14.9321, -0.5456, 0, 15, 0, 1.2575, 14.9321, -0.6721, 1.3173, 14.9321, -0.5456, 0, 15, 0, 0, 15, 0, 1.2575, 14.9321, -0.6721, 0, 15, 0, 1.1855, 14.9321, -0.7922, 1.2575, 14.9321, -0.6721, 0, 15, 0, 0, 15, 0, 1.1855, 14.9321, -0.7922, 0, 15, 0, 1.1022, 14.9321, -0.9045, 1.1855, 14.9321, -0.7922, 0, 15, 0, 0, 15, 0, 1.1022, 14.9321, -0.9045, 0, 15, 0, 1.0082, 14.9321, -1.0082, 1.1022, 14.9321, -0.9045, 0, 15, 0, 0, 15, 0, 1.0082, 14.9321, -1.0082, 0, 15, 0, 0.9045, 14.9321, -1.1022, 1.0082, 14.9321, -1.0082, 0, 15, 0, 0, 15, 0, 0.9045, 14.9321, -1.1022, 0, 15, 0, 0.7922, 14.9321, -1.1855, 0.9045, 14.9321, -1.1022, 0, 15, 0, 0, 15, 0, 0.7922, 14.9321, -1.1855, 0, 15, 0, 0.6721, 14.9321, -1.2575, 0.7922, 14.9321, -1.1855, 0, 15, 0, 0, 15, 0, 0.6721, 14.9321, -1.2575, 0, 15, 0, 0.5456, 14.9321, -1.3173, 0.6721, 14.9321, -1.2575, 0, 15, 0, 0, 15, 0, 0.5456, 14.9321, -1.3173, 0, 15, 0, 0.4139, 14.9321, -1.3644, 0.5456, 14.9321, -1.3173, 0, 15, 0, 0, 15, 0, 0.4139, 14.9321, -1.3644, 0, 15, 0, 0.2782, 14.9321, -1.3984, 0.4139, 14.9321, -1.3644, 0, 15, 0, 0, 15, 0, 0.2782, 14.9321, -1.3984, 0, 15, 0, 0.1398, 14.9321, -1.419, 0.2782, 14.9321, -1.3984, 0, 15, 0, 0, 15, 0, 0.1398, 14.9321, -1.419, 0, 15, 0, 0, 14.9321, -1.4258, 0.1398, 14.9321, -1.419, 0, 15, 0, 0, 15, 0, 0, 14.9321, -1.4258, 0, 15, 0, -0.1398, 14.9321, -1.419, 0, 14.9321, -1.4258, 0, 15, 0, 0, 15, 0, -0.1398, 14.9321, -1.419, 0, 15, 0, -0.2782, 14.9321, -1.3984, -0.1398, 14.9321, -1.419, 0, 15, 0, 0, 15, 0, -0.2782, 14.9321, -1.3984, 0, 15, 0, -0.4139, 14.9321, -1.3644, -0.2782, 14.9321, -1.3984, 0, 15, 0, 0, 15, 0, -0.4139, 14.9321, -1.3644, 0, 15, 0, -0.5456, 14.9321, -1.3173, -0.4139, 14.9321, -1.3644, 0, 15, 0, 0, 15, 0, -0.5456, 14.9321, -1.3173, 0, 15, 0, -0.6721, 14.9321, -1.2575, -0.5456, 14.9321, -1.3173, 0, 15, 0, 0, 15, 0, -0.6721, 14.9321, -1.2575, 0, 15, 0, -0.7922, 14.9321, -1.1855, -0.6721, 14.9321, -1.2575, 0, 15, 0, 0, 15, 0, -0.7922, 14.9321, -1.1855, 0, 15, 0
[sub_resource type="Shader" id=9]
2021-06-07 20:13:17 +02:00
resource_local_to_scene = true
code = "shader_type spatial;
uniform sampler2D base_texture: hint_albedo;
uniform sampler2D flowmap;
uniform vec4 color: hint_color;
uniform float flow_speed = 0.1;
uniform float flow_intensity = 0.1;
void fragment(){
// Flow
vec2 flow = texture(flowmap, UV).xy;
flow = (flow - 0.5) * 2.0;
// We use two phases which are exactly halfway offset from one another, and we blend between those.
// That way, the animation seems to go on infinitely (similar to a Shepard tone)
float time_phase_1 = fract(TIME * flow_speed);
float time_phase_2 = fract(time_phase_1 + 0.5);
float flow_mix = abs((time_phase_1 - 0.5) * 2.0);
// Read the color values based on the offsets from the flowmap samples and mix them
vec3 base_tex_1 = texture(base_texture, UV + (flow * time_phase_1 * flow_intensity)).xyz;
vec3 base_tex_2 = texture(base_texture, UV + (flow * time_phase_2 * flow_intensity)).xyz;
vec3 base_tex_mix = mix(base_tex_1, base_tex_2, flow_mix);
// Apply the custom color scaled by that previous greyscale sample
vec3 final_color = (0.05 + base_tex_mix.x * 0.95) * color.xyz;
ALBEDO = final_color;
}
"
[sub_resource type="ShaderMaterial" id=10]
shader = SubResource( 9 )
2021-06-07 20:13:17 +02:00
shader_param/color = Color( 0.866667, 0.541176, 0.0392157, 1 )
shader_param/flow_speed = 0.2
shader_param/flow_intensity = 0.8
shader_param/base_texture = ExtResource( 10 )
shader_param/flowmap = ExtResource( 9 )
[sub_resource type="Environment" id=11]
background_mode = 1
2021-06-07 20:13:17 +02:00
background_color = Color( 0.0431373, 0.0117647, 0.0862745, 1 )
ambient_light_color = Color( 0.0823529, 0.0666667, 0.117647, 1 )
2021-04-22 23:40:01 +02:00
tonemap_mode = 2
tonemap_exposure = 2.0
tonemap_white = 2.0
2021-06-07 20:13:17 +02:00
dof_blur_far_distance = 200.0
dof_blur_far_transition = 100.0
dof_blur_far_amount = 0.05
dof_blur_far_quality = 2
glow_enabled = true
2021-06-07 20:13:17 +02:00
glow_intensity = 3.0
glow_strength = 1.1
glow_bloom = 0.1
2021-03-25 21:36:04 +01:00
[node name="World" type="Spatial"]
[node name="MovingPlatformPivot" type="Position3D" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -125, 37, 60 )
[node name="MovingPlatform" type="KinematicBody" parent="MovingPlatformPivot" groups=[
"MovingPlatform",
]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 60, 0 )
script = ExtResource( 5 )
move_speed = 5.0
solar_system = NodePath("../../Planets")
[node name="MeshInstance" type="MeshInstance" parent="MovingPlatformPivot/MovingPlatform"]
mesh = SubResource( 1 )
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="MovingPlatformPivot/MovingPlatform"]
shape = SubResource( 12 )
2021-03-25 21:36:04 +01:00
[node name="Planets" type="Spatial" parent="."]
script = ExtResource( 2 )
[node name="Earth" type="StaticBody" parent="Planets"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -20, 0 )
physics_material_override = SubResource( 3 )
script = ExtResource( 3 )
mass = 6.0
2021-03-25 21:36:04 +01:00
[node name="MeshInstance" type="MeshInstance" parent="Planets/Earth"]
material_override = ExtResource( 4 )
mesh = SubResource( 4 )
2021-03-25 21:36:04 +01:00
material/0 = null
[node name="CollisionShape" type="CollisionShape" parent="Planets/Earth"]
shape = SubResource( 5 )
2021-04-22 23:40:01 +02:00
[node name="Mars" type="StaticBody" parent="Planets"]
2021-04-22 23:40:01 +02:00
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -20, 37, 30 )
script = ExtResource( 3 )
mass = 5.0
[node name="MeshInstance" type="MeshInstance" parent="Planets/Mars"]
mesh = SubResource( 6 )
material/0 = SubResource( 7 )
2021-04-22 23:40:01 +02:00
[node name="CollisionShape" type="CollisionShape" parent="Planets/Mars"]
shape = SubResource( 8 )
[node name="Jupiter" type="StaticBody" parent="Planets"]
transform = Transform( 3, 0, 0, 0, 3, 0, 0, 0, 3, -125, 37, 60 )
script = ExtResource( 3 )
mass = 40.0
[node name="MeshInstance" type="MeshInstance" parent="Planets/Jupiter"]
mesh = SubResource( 6 )
material/0 = ExtResource( 7 )
[node name="CollisionShape" type="CollisionShape" parent="Planets/Jupiter"]
shape = SubResource( 8 )
2021-03-25 21:36:04 +01:00
2021-06-07 20:13:17 +02:00
[node name="Saturn" type="StaticBody" parent="Planets"]
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -207, 96, -18 )
script = ExtResource( 3 )
mass = 30.0
[node name="MeshInstance" type="MeshInstance" parent="Planets/Saturn"]
mesh = SubResource( 6 )
material/0 = SubResource( 10 )
2021-06-07 20:13:17 +02:00
[node name="CollisionShape" type="CollisionShape" parent="Planets/Saturn"]
shape = SubResource( 8 )
2021-06-07 20:13:17 +02:00
[node name="LerpedFollow" type="Spatial" parent="."]
script = ExtResource( 11 )
target_node = NodePath("../Player")
lerp_factor = 0.1
[node name="LerpedCamera" type="Camera" parent="LerpedFollow"]
transform = Transform( 1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 14.5858, 21.6274 )
fov = 75.0
far = 500.0
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 11 )
[node name="DirectionalLight" type="DirectionalLight" parent="WorldEnvironment"]
2021-06-07 20:13:17 +02:00
transform = Transform( 0.866025, -0.353553, 0.353553, 0, 0.707107, 0.707107, -0.5, -0.612372, 0.612372, 0, 10, 0 )
shadow_enabled = true
[node name="ShootyEnemy" parent="." instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 20 )
player_node = NodePath("../Player")
solar_system_node = NodePath("../Planets")
[node name="Player" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0 )