164 lines
6.5 KiB
Text
164 lines
6.5 KiB
Text
[gd_scene load_steps=14 format=3 uid="uid://bartuuv8bwyjg"]
|
|
|
|
[ext_resource type="Script" path="res://scripts/maps/islands.gd" id="1_3oilq"]
|
|
[ext_resource type="PackedScene" uid="uid://ytbacsuahxie" path="res://scenes/HUD.tscn" id="2_2mo4q"]
|
|
[ext_resource type="PackedScene" uid="uid://cmrooias7kpru" path="res://scenes/islands-map.tscn" id="3_neuu1"]
|
|
[ext_resource type="PackedScene" uid="uid://buyvavyuwmccw" path="res://joystick/virtual_joystick.tscn" id="4_03mxr"]
|
|
|
|
[sub_resource type="Shader" id="Shader_6rtqo"]
|
|
code = "
|
|
// NOTE: Shader automatically converted from Godot Engine 4.2.1.stable's ProceduralSkyMaterial.
|
|
|
|
shader_type sky;
|
|
render_mode use_debanding;
|
|
|
|
uniform vec4 sky_top_color : source_color = vec4(0.385, 0.454, 0.55, 1.0);
|
|
uniform vec4 sky_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0);
|
|
uniform float sky_curve : hint_range(0, 1) = 0.15;
|
|
uniform float sky_energy = 1.0; // In Lux.
|
|
uniform sampler2D sky_cover : filter_linear, source_color, hint_default_black;
|
|
uniform vec4 sky_cover_modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0);
|
|
uniform vec4 ground_bottom_color : source_color = vec4(0.2, 0.169, 0.133, 1.0);
|
|
uniform vec4 ground_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0);
|
|
uniform float ground_curve : hint_range(0, 1) = 0.02;
|
|
uniform float ground_energy = 1.0;
|
|
uniform float sun_angle_max = 30.0;
|
|
uniform float sun_curve : hint_range(0, 1) = 0.15;
|
|
|
|
uniform sampler2D cloud_texture;
|
|
uniform sampler2D cloud_texture2;
|
|
uniform vec2 cloud_direction;
|
|
uniform vec2 cloud_direction2;
|
|
uniform vec2 cloud_scale;
|
|
uniform float cloud_distance;
|
|
uniform float cloud_speed;
|
|
uniform float cloud_speed2;
|
|
|
|
void sky() {
|
|
float v_angle = acos(clamp(EYEDIR.y, -1.0, 1.0));
|
|
float c = (1.0 - v_angle / (PI * 0.5));
|
|
vec3 sky = mix(sky_horizon_color.rgb, sky_top_color.rgb, clamp(1.0 - pow(1.0 - c, 1.0 / sky_curve), 0.0, 1.0));
|
|
sky *= sky_energy;
|
|
|
|
if (LIGHT0_ENABLED) {
|
|
float sun_angle = acos(dot(LIGHT0_DIRECTION, EYEDIR));
|
|
if (sun_angle < LIGHT0_SIZE) {
|
|
sky = LIGHT0_COLOR * LIGHT0_ENERGY;
|
|
} else if (sun_angle < sun_angle_max) {
|
|
float c2 = (sun_angle - LIGHT0_SIZE) / (sun_angle_max - LIGHT0_SIZE);
|
|
sky = mix(LIGHT0_COLOR * LIGHT0_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
|
|
}
|
|
}
|
|
|
|
if (LIGHT1_ENABLED) {
|
|
float sun_angle = acos(dot(LIGHT1_DIRECTION, EYEDIR));
|
|
if (sun_angle < LIGHT1_SIZE) {
|
|
sky = LIGHT1_COLOR * LIGHT1_ENERGY;
|
|
} else if (sun_angle < sun_angle_max) {
|
|
float c2 = (sun_angle - LIGHT1_SIZE) / (sun_angle_max - LIGHT1_SIZE);
|
|
sky = mix(LIGHT1_COLOR * LIGHT1_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
|
|
}
|
|
}
|
|
|
|
if (LIGHT2_ENABLED) {
|
|
float sun_angle = acos(dot(LIGHT2_DIRECTION, EYEDIR));
|
|
if (sun_angle < LIGHT2_SIZE) {
|
|
sky = LIGHT2_COLOR * LIGHT2_ENERGY;
|
|
} else if (sun_angle < sun_angle_max) {
|
|
float c2 = (sun_angle - LIGHT2_SIZE) / (sun_angle_max - LIGHT2_SIZE);
|
|
sky = mix(LIGHT2_COLOR * LIGHT2_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
|
|
}
|
|
}
|
|
|
|
if (LIGHT3_ENABLED) {
|
|
float sun_angle = acos(dot(LIGHT3_DIRECTION, EYEDIR));
|
|
if (sun_angle < LIGHT3_SIZE) {
|
|
sky = LIGHT3_COLOR * LIGHT3_ENERGY;
|
|
} else if (sun_angle < sun_angle_max) {
|
|
float c2 = (sun_angle - LIGHT3_SIZE) / (sun_angle_max - LIGHT3_SIZE);
|
|
sky = mix(LIGHT3_COLOR * LIGHT3_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
|
|
}
|
|
}
|
|
|
|
vec4 sky_cover_texture = texture(sky_cover, SKY_COORDS);
|
|
sky += (sky_cover_texture.rgb * sky_cover_modulate.rgb) * sky_cover_texture.a * sky_cover_modulate.a * sky_energy;
|
|
|
|
c = (v_angle - (PI * 0.5)) / (PI * 0.5);
|
|
vec3 ground = mix(ground_horizon_color.rgb, ground_bottom_color.rgb, clamp(1.0 - pow(1.0 - c, 1.0 / ground_curve), 0.0, 1.0));
|
|
ground *= ground_energy;
|
|
|
|
vec2 sky_uv = EYEDIR.xz / EYEDIR.y;
|
|
vec3 clouds = texture(cloud_texture, sky_uv * cloud_scale + TIME * cloud_direction * cloud_speed).rgb - texture(cloud_texture2, sky_uv * cloud_scale + TIME * cloud_direction2 * cloud_speed2).rgb;
|
|
clouds = clouds - smoothstep(0.0, EYEDIR.y, cloud_distance);
|
|
clouds = clamp(clouds,0,1);
|
|
sky += clouds;
|
|
|
|
COLOR = mix(ground, sky, step(0.0, EYEDIR.y));
|
|
}
|
|
"
|
|
|
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_xmuk5"]
|
|
|
|
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_s2hgb"]
|
|
width = 1024
|
|
height = 1024
|
|
seamless = true
|
|
noise = SubResource("FastNoiseLite_xmuk5")
|
|
|
|
[sub_resource type="Gradient" id="Gradient_pecsg"]
|
|
|
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_rw0pi"]
|
|
|
|
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_pxixl"]
|
|
width = 1024
|
|
height = 1024
|
|
seamless = true
|
|
color_ramp = SubResource("Gradient_pecsg")
|
|
noise = SubResource("FastNoiseLite_rw0pi")
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ybu6k"]
|
|
shader = SubResource("Shader_6rtqo")
|
|
shader_parameter/sky_top_color = Color(1, 0.490803, 0.574236, 1)
|
|
shader_parameter/sky_horizon_color = Color(0.556863, 0.8, 0.862745, 1)
|
|
shader_parameter/sky_curve = 0.15
|
|
shader_parameter/sky_energy = 1.0
|
|
shader_parameter/sky_cover_modulate = Color(1, 1, 1, 1)
|
|
shader_parameter/ground_bottom_color = Color(1, 1, 1, 1)
|
|
shader_parameter/ground_horizon_color = Color(0.701961, 0.819608, 0.866667, 1)
|
|
shader_parameter/ground_curve = 0.02
|
|
shader_parameter/ground_energy = 1.0
|
|
shader_parameter/sun_angle_max = 0.523599
|
|
shader_parameter/sun_curve = 0.15
|
|
shader_parameter/cloud_direction = Vector2(-1, 1)
|
|
shader_parameter/cloud_direction2 = Vector2(1, -1)
|
|
shader_parameter/cloud_scale = Vector2(0.05, 0.05)
|
|
shader_parameter/cloud_distance = -0.025
|
|
shader_parameter/cloud_speed = 0.005
|
|
shader_parameter/cloud_speed2 = 0.004
|
|
shader_parameter/cloud_texture = SubResource("NoiseTexture2D_s2hgb")
|
|
shader_parameter/cloud_texture2 = SubResource("NoiseTexture2D_pxixl")
|
|
|
|
[sub_resource type="Sky" id="Sky_ppfx1"]
|
|
sky_material = SubResource("ShaderMaterial_ybu6k")
|
|
|
|
[sub_resource type="Environment" id="Environment_ofj6t"]
|
|
background_mode = 2
|
|
sky = SubResource("Sky_ppfx1")
|
|
|
|
[node name="islands" type="Node3D"]
|
|
script = ExtResource("1_3oilq")
|
|
|
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
|
transform = Transform3D(0.553392, -0.0290685, 0.832414, 0, 0.999391, 0.0348995, -0.832921, -0.0193131, 0.553054, 0, 0, 0)
|
|
light_color = Color(0.980392, 0.372549, 0.333333, 1)
|
|
shadow_enabled = true
|
|
|
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
environment = SubResource("Environment_ofj6t")
|
|
|
|
[node name="HUD" parent="." instance=ExtResource("2_2mo4q")]
|
|
|
|
[node name="Virtual joystick" parent="." instance=ExtResource("4_03mxr")]
|
|
|
|
[node name="islands" parent="." instance=ExtResource("3_neuu1")]
|
|
transform = Transform3D(1.6415, 0, 0, 0, 1.6415, 0, 0, 0, 1.6415, 0, 0, 0)
|