270 lines
13 KiB
Text
270 lines
13 KiB
Text
[gd_scene load_steps=22 format=3 uid="uid://b8p2h0rmwy7qn"]
|
|
|
|
[ext_resource type="Material" uid="uid://dpegsmygxcfmv" path="res://maps/materials/basic_ground.material" id="1_lodye"]
|
|
[ext_resource type="Texture2D" uid="uid://b5jer2nm17ld" path="res://maps/textures/samayun_tex_001.png" id="1_thm7k"]
|
|
[ext_resource type="PackedScene" uid="uid://cveshwnu272vf" path="res://maps/objects/ramp-complex.tscn" id="2_4eueh"]
|
|
[ext_resource type="PackedScene" uid="uid://omess6wwwwcq" path="res://maps/objects/ramp-moving.tscn" id="3_bvbgo"]
|
|
[ext_resource type="PackedScene" uid="uid://dvsl8x3lb1h4e" path="res://maps/objects/moutain.tscn" id="3_rbp35"]
|
|
[ext_resource type="PackedScene" path="res://maps/objects/cave.tscn" id="4_pc85h"]
|
|
[ext_resource type="PackedScene" uid="uid://b61edh0bre65c" path="res://maps/objects/ramp.tscn" id="5_dfm8h"]
|
|
[ext_resource type="PackedScene" uid="uid://bl1widitqdugs" path="res://maps/objects/obstacles.tscn" id="5_mi3we"]
|
|
[ext_resource type="PackedScene" uid="uid://clmlpy36ghsio" path="res://maps/water-zone.tscn" id="6_0o80c"]
|
|
[ext_resource type="PackedScene" uid="uid://c7sga2ipka52x" path="res://maps/waypoint/waypoint.tscn" id="7_5rpqq"]
|
|
[ext_resource type="PackedScene" uid="uid://dxghflr1tlhai" path="res://maps/objects/panel_dummy.tscn" id="11_gb0sk"]
|
|
[ext_resource type="PackedScene" uid="uid://damn2u4n5ien" path="res://maps/objects/panel.tscn" id="11_vd4qp"]
|
|
[ext_resource type="PackedScene" uid="uid://b2vv2knvetbwf" path="res://maps/objects/panel-mega.tscn" id="11_y1j8d"]
|
|
[ext_resource type="PackedScene" uid="uid://bfo13c5k8xu0x" path="res://maps/natural_ground.tscn" id="12_r7x73"]
|
|
[ext_resource type="PackedScene" uid="uid://mdsxnqsijdqv" path="res://maps/dispensaire_01.tscn" id="13_ald41"]
|
|
|
|
[sub_resource type="Shader" id="Shader_av6ac"]
|
|
code = "
|
|
// NOTE: Shader automatically converted from Godot Engine 4.0.alpha5's PhysicalSkyMaterial.
|
|
|
|
shader_type sky;
|
|
|
|
uniform float rayleigh : hint_range(0, 64) = 2.0;
|
|
uniform vec4 rayleigh_color : hint_color = vec4(0.3, 0.405, 0.6, 1.0);
|
|
uniform float mie : hint_range(0, 1) = 0.005;
|
|
uniform float mie_eccentricity : hint_range(-1, 1) = 0.8;
|
|
uniform vec4 mie_color : hint_color = vec4(0.69, 0.729, 0.812, 1.0);
|
|
|
|
uniform float turbidity : hint_range(0, 1000) = 10.0;
|
|
uniform float sun_disk_scale : hint_range(0, 360) = 1.0;
|
|
uniform vec4 ground_color : hint_color = vec4(0.1, 0.07, 0.034, 1.0);
|
|
uniform float exposure : hint_range(0, 128) = 0.1;
|
|
uniform float dither_strength : hint_range(0, 10) = 1.0;
|
|
|
|
uniform sampler2D night_sky : hint_black_albedo;
|
|
|
|
uniform sampler2D samayun : hint_albedo;
|
|
uniform float samayun_scale : hint_range(0, 1.0) = 0.25;
|
|
uniform vec3 samayun_position = vec3( 0.0, 0.5, 0.0 );
|
|
|
|
const vec3 UP = vec3( 0.0, 1.0, 0.0 );
|
|
|
|
// Sun constants
|
|
const float SUN_ENERGY = 1000.0;
|
|
|
|
// Optical length at zenith for molecules.
|
|
const float rayleigh_zenith_size = 8.4e3;
|
|
const float mie_zenith_size = 1.25e3;
|
|
|
|
float henyey_greenstein(float cos_theta, float g) {
|
|
const float k = 0.0795774715459;
|
|
return k * (1.0 - g * g) / (pow(1.0 + g * g - 2.0 * g * cos_theta, 1.5));
|
|
}
|
|
|
|
// From: https://www.shadertoy.com/view/4sfGzS credit to iq
|
|
float hash(vec3 p) {
|
|
p = fract( p * 0.3183099 + 0.1 );
|
|
p *= 17.0;
|
|
return fract(p.x * p.y * p.z * (p.x + p.y + p.z));
|
|
}
|
|
|
|
|
|
|
|
void sky() {
|
|
if (LIGHT0_ENABLED) {
|
|
float zenith_angle = clamp( dot(UP, normalize(LIGHT0_DIRECTION)), -1.0, 1.0 );
|
|
float sun_energy = max(0.0, 1.0 - exp(-((PI * 0.5) - acos(zenith_angle)))) * SUN_ENERGY * LIGHT0_ENERGY;
|
|
float sun_fade = 1.0 - clamp(1.0 - exp(LIGHT0_DIRECTION.y), 0.0, 1.0);
|
|
|
|
// Rayleigh coefficients.
|
|
float rayleigh_coefficient = rayleigh - ( 1.0 * ( 1.0 - sun_fade ) );
|
|
vec3 rayleigh_beta = rayleigh_coefficient * rayleigh_color.rgb * 0.0001;
|
|
// mie coefficients from Preetham
|
|
vec3 mie_beta = turbidity * mie * mie_color.rgb * 0.000434;
|
|
|
|
// Optical length.
|
|
float zenith = acos(max(0.0, dot(UP, EYEDIR)));
|
|
float optical_mass = 1.0 / (cos(zenith) + 0.15 * pow(93.885 - degrees(zenith), -1.253));
|
|
float rayleigh_scatter = rayleigh_zenith_size * optical_mass;
|
|
float mie_scatter = mie_zenith_size * optical_mass;
|
|
|
|
// Light extinction based on thickness of atmosphere.
|
|
vec3 extinction = exp(-(rayleigh_beta * rayleigh_scatter + mie_beta * mie_scatter));
|
|
|
|
// In scattering.
|
|
float cos_theta = dot(EYEDIR, normalize(LIGHT0_DIRECTION));
|
|
|
|
float rayleigh_phase = (3.0 / (16.0 * PI)) * (1.0 + pow(cos_theta * 0.5 + 0.5, 2.0));
|
|
vec3 betaRTheta = rayleigh_beta * rayleigh_phase;
|
|
|
|
float mie_phase = henyey_greenstein(cos_theta, mie_eccentricity);
|
|
vec3 betaMTheta = mie_beta * mie_phase;
|
|
|
|
vec3 Lin = pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * (1.0 - extinction), vec3(1.5));
|
|
// Hack from https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Sky.js
|
|
Lin *= mix(vec3(1.0), pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * extinction, vec3(0.5)), clamp(pow(1.0 - zenith_angle, 5.0), 0.0, 1.0));
|
|
|
|
// Hack in the ground color.
|
|
Lin *= mix(ground_color.rgb, vec3(1.0), smoothstep(-0.1, 0.1, dot(UP, EYEDIR)));
|
|
|
|
// Solar disk and out-scattering.
|
|
float sunAngularDiameterCos = cos(LIGHT0_SIZE * sun_disk_scale);
|
|
float sunAngularDiameterCos2 = cos(LIGHT0_SIZE * sun_disk_scale*0.5);
|
|
float sundisk = smoothstep(sunAngularDiameterCos, sunAngularDiameterCos2, cos_theta);
|
|
vec3 L0 = (sun_energy * 1900.0 * extinction) * sundisk * LIGHT0_COLOR;
|
|
L0 += texture(night_sky, SKY_COORDS).xyz * extinction;
|
|
|
|
vec3 color = (Lin + L0) * 0.04;
|
|
COLOR = pow(color, vec3(1.0 / (1.2 + (1.2 * sun_fade))));
|
|
COLOR *= exposure;
|
|
// Make optional, eliminates banding.
|
|
COLOR += (hash(EYEDIR * 1741.9782) * 0.08 - 0.04) * 0.016 * dither_strength;
|
|
} else {
|
|
// There is no sun, so display night_sky and nothing else.
|
|
COLOR = texture(night_sky, SKY_COORDS).xyz * 0.04;
|
|
COLOR *= exposure;
|
|
}
|
|
// vec2 samayun_uv = uv_moon(samayun_position, samayun_scale, SKY_COORDS);
|
|
// COLOR += texture(samayun, samayun_uv).rgb;
|
|
if (length(EYEDIR - normalize(samayun_position)) < 0.5 ) { // we are in the area of the sky where samayun is placed
|
|
//We define a local plane tangent to the skydome at samayun_position
|
|
//We work with everything normalized
|
|
vec3 n1 = normalize(cross(samayun_position,vec3(0,1,0)));
|
|
vec3 n2 = normalize(cross(samayun_position,n1));
|
|
//We project EYEDIR on this plane
|
|
float x = dot(EYEDIR,n1) ;
|
|
float y = dot(EYEDIR,n2) ;
|
|
|
|
COLOR += texture(samayun, vec2(x,y)+vec2(0.5)).rgb;
|
|
//COLOR = mix(COLOR, texture(samayun, vec2(x,y)+vec2(0.5)).rgb, clamp (samayun_position.y, 0.0, 1.0)) ;
|
|
}
|
|
}
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_s2q0l"]
|
|
shader = SubResource( "Shader_av6ac" )
|
|
shader_param/rayleigh = 2.0
|
|
shader_param/rayleigh_color = Color(0.3, 0.405, 0.6, 1)
|
|
shader_param/mie = 0.005
|
|
shader_param/mie_eccentricity = 0.8
|
|
shader_param/mie_color = Color(0.69, 0.729, 0.812, 1)
|
|
shader_param/turbidity = 10.0
|
|
shader_param/sun_disk_scale = 1.0
|
|
shader_param/ground_color = Color(0.1, 0.07, 0.034, 1)
|
|
shader_param/exposure = 0.1
|
|
shader_param/dither_strength = 1.0
|
|
shader_param/samayun_scale = 0.201
|
|
shader_param/samayun_position = Vector3(0.226, 0.161, 0.065)
|
|
shader_param/samayun = ExtResource( "1_thm7k" )
|
|
|
|
[sub_resource type="Sky" id="Sky_fa16p"]
|
|
sky_material = SubResource( "ShaderMaterial_s2q0l" )
|
|
|
|
[sub_resource type="Environment" id="Environment_n5kgx"]
|
|
background_mode = 2
|
|
sky = SubResource( "Sky_fa16p" )
|
|
volumetric_fog_enabled = true
|
|
volumetric_fog_density = 0.0
|
|
volumetric_fog_emission = Color(0.407843, 0.415686, 0.439216, 1)
|
|
volumetric_fog_detail_spread = 1.60766
|
|
|
|
[sub_resource type="BoxMesh" id="BoxMesh_k23th"]
|
|
material = ExtResource( "1_lodye" )
|
|
|
|
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_lld3w"]
|
|
data = PackedVector3Array(-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5)
|
|
|
|
[node name="basic_setup" type="Node3D"]
|
|
|
|
[node name="sunlight" type="DirectionalLight3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 0.634731, 0.772734, 0, -0.772734, 0.634731, -1.75049, 15.9707, 4.39927)
|
|
light_color = Color(0.988235, 0.960784, 1, 1)
|
|
light_energy = 0.75
|
|
shadow_enabled = true
|
|
|
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
environment = SubResource( "Environment_n5kgx" )
|
|
|
|
[node name="floor" type="MeshInstance3D" parent="."]
|
|
transform = Transform3D(80, 0, 0, 0, 0.1, 0, 0, 0, 80, 0, 0, 0)
|
|
mesh = SubResource( "BoxMesh_k23th" )
|
|
|
|
[node name="StaticBody3D" type="StaticBody3D" parent="floor"]
|
|
visible = false
|
|
|
|
[node name="44976" type="CollisionShape3D" parent="floor/StaticBody3D"]
|
|
visible = false
|
|
shape = SubResource( "ConcavePolygonShape3D_lld3w" )
|
|
|
|
[node name="labels" type="Node3D" parent="."]
|
|
|
|
[node name="Blue - Zone names" type="Node3D" parent="labels"]
|
|
|
|
[node name="BluePoint" type="Position3D" parent="labels/Blue - Zone names"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.2869, 4.21191, 10.6861)
|
|
|
|
[node name="Plateforme mouvante" parent="labels/Blue - Zone names/BluePoint" instance=ExtResource( "7_5rpqq" )]
|
|
modulate = Color(0.227451, 0.184314, 1, 1)
|
|
text = "Plateforme mouvante"
|
|
|
|
[node name="BluePoint2" type="Position3D" parent="labels/Blue - Zone names"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -82.0222, 4.78227, -4.13589)
|
|
|
|
[node name="Zone aquatique" parent="labels/Blue - Zone names/BluePoint2" instance=ExtResource( "7_5rpqq" )]
|
|
modulate = Color(0.227451, 0.184314, 1, 1)
|
|
text = "Zone aquatique"
|
|
|
|
[node name="BluePoint3" type="Position3D" parent="labels/Blue - Zone names"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18.6298, 7.89366, -7.7856)
|
|
|
|
[node name="Terrain irrégulier" parent="labels/Blue - Zone names/BluePoint3" instance=ExtResource( "7_5rpqq" )]
|
|
modulate = Color(0.227451, 0.184314, 1, 1)
|
|
text = "Terrain irrégulier"
|
|
|
|
[node name="Green - Informations" type="Node3D" parent="labels"]
|
|
|
|
[node name="GreenPoint" type="Position3D" parent="labels/Green - Informations"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16.5125, 5.69293, -8.2869)
|
|
|
|
[node name="Tester ressenti des collisions selon angle de pente" parent="labels/Green - Informations/GreenPoint" instance=ExtResource( "7_5rpqq" )]
|
|
modulate = Color(0.0196078, 1, 0, 1)
|
|
text = "Tester ressenti des collisions selon angle de pente"
|
|
sticky = false
|
|
|
|
[node name="Red - Important" type="Node3D" parent="labels"]
|
|
|
|
[node name="RedPoint" type="Position3D" parent="labels/Red - Important"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -78.3165, 1.80831, -3.74854)
|
|
|
|
[node name="Nage non implémentée" parent="labels/Red - Important/RedPoint" instance=ExtResource( "7_5rpqq" )]
|
|
modulate = Color(1, 0.192157, 0.156863, 1)
|
|
text = "Nage implémentée"
|
|
|
|
[node name="ramp-complex" parent="." instance=ExtResource( "2_4eueh" )]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0.1, 15)
|
|
|
|
[node name="ramp-moving" parent="." instance=ExtResource( "3_bvbgo" )]
|
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 12, 0, 22)
|
|
|
|
[node name="moutain" parent="." instance=ExtResource( "3_rbp35" )]
|
|
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 20.5054, -0.419849, -6.5951)
|
|
|
|
[node name="obstacles" parent="." instance=ExtResource( "5_mi3we" )]
|
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 3, 0.05, 19)
|
|
|
|
[node name="cave" parent="." instance=ExtResource( "4_pc85h" )]
|
|
transform = Transform3D(-0.344037, 0, 0.938956, 0, 1, 0, -0.938956, 0, -0.344037, 29.908, -0.141321, 29.4435)
|
|
|
|
[node name="ramp" parent="." instance=ExtResource( "5_dfm8h" )]
|
|
transform = Transform3D(-0.218552, 0, -0.975825, 0, 1, 0, 0.975825, 0, -0.218552, -27.5919, 0, 5.449)
|
|
|
|
[node name="water-zone" parent="." instance=ExtResource( "6_0o80c" )]
|
|
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -79.945, 0.05, 0)
|
|
|
|
[node name="panel" parent="." instance=ExtResource( "11_vd4qp" )]
|
|
transform = Transform3D(-0.947718, 0, 0.319108, 0, 1, 0, -0.319108, 0, -0.947718, -14, 0, -1)
|
|
|
|
[node name="panel_dummy" parent="." instance=ExtResource( "11_gb0sk" )]
|
|
transform = Transform3D(-0.755122, 0, 0.655585, 0, 1, 0, -0.655585, 0, -0.755122, -16, 0, -2)
|
|
|
|
[node name="panel_mega" parent="." instance=ExtResource( "11_y1j8d" )]
|
|
transform = Transform3D(-0.998917, 0, 0.0465135, 0, 1, 0, -0.0465135, 0, -0.998917, -11.5643, 0, -0.999999)
|
|
|
|
[node name="natural_ground" parent="." instance=ExtResource( "12_r7x73" )]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 65, 0.05, -15)
|
|
|
|
[node name="dispensaire_01" parent="." instance=ExtResource( "13_ald41" )]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -7.073, -89.152)
|