Compare commits

...

8 commits

21 changed files with 504 additions and 70 deletions

View file

@ -65,6 +65,9 @@ msgstr "Themes"
msgid "HUD/LANGUAGES" msgid "HUD/LANGUAGES"
msgstr "Languages" msgstr "Languages"
msgid "HUD/DEV"
msgstr "Developper"
msgid "HUD/ABOUT" msgid "HUD/ABOUT"
msgstr "About" msgstr "About"
@ -301,3 +304,24 @@ msgstr "Reverse vertical"
msgid "NO_MOUSE_BUTTON" msgid "NO_MOUSE_BUTTON"
msgstr "Nothing" msgstr "Nothing"
msgid "win_developper"
msgstr "Developper"
msgid "stigi_name"
msgstr "stigi"
msgid "samayun_name"
msgstr "samayun"
msgid "zabr_name"
msgstr "zabr"
msgid "lab_sky_panel"
msgstr "Sky parameters"
msgid "lab_position"
msgstr "Position"
msgid "lab_size"
msgstr "Size"

View file

@ -65,6 +65,9 @@ msgstr "Thèmes"
msgid "HUD/LANGUAGES" msgid "HUD/LANGUAGES"
msgstr "Langue" msgstr "Langue"
msgid "HUD/DEV"
msgstr "Développeur"
msgid "HUD/ABOUT" msgid "HUD/ABOUT"
msgstr "A propos" msgstr "A propos"
@ -75,7 +78,7 @@ msgid "POPUP_CONFIRM_QUIT/TITLE"
msgstr "Merci de confirmer" msgstr "Merci de confirmer"
msgid "POPUP_CONFIRM_QUIT/MESSAGE" msgid "POPUP_CONFIRM_QUIT/MESSAGE"
msgstr "Voulez-vous fermer le jeux ?" msgstr "Voulez-vous fermer le jeu ?"
msgid "OK" msgid "OK"
msgstr "Valider" msgstr "Valider"
@ -301,3 +304,24 @@ msgstr "Inversé verticale"
msgid "NO_MOUSE_BUTTON" msgid "NO_MOUSE_BUTTON"
msgstr "Rien n'est sélectionné" msgstr "Rien n'est sélectionné"
msgid "win_developper"
msgstr "Développeur"
msgid "stigi_name"
msgstr "stigi"
msgid "samayun_name"
msgstr "samayun"
msgid "zabr_name"
msgstr "zabr"
msgid "lab_sky_panel"
msgstr "Paramètres célestes"
msgid "lab_position"
msgstr "Position"
msgid "lab_size"
msgstr "Taille"

Binary file not shown.

View file

@ -56,6 +56,9 @@ msgstr ""
msgid "HUD/LANGUAGES" msgid "HUD/LANGUAGES"
msgstr "" msgstr ""
msgid "HUD/DEV"
msgstr ""
msgid "HUD/ABOUT" msgid "HUD/ABOUT"
msgstr "" msgstr ""
@ -293,5 +296,23 @@ msgstr ""
msgid "NO_MOUSE_BUTTON" msgid "NO_MOUSE_BUTTON"
msgstr "" msgstr ""
msgid "win_developper"
msgstr ""
msgid "stigi_name"
msgstr ""
msgid "samayun_name"
msgstr ""
msgid "zabr_name"
msgstr ""
msgid "lab_sky_panel"
msgstr ""
msgid "lab_position"
msgstr ""
msgid "lab_size"
msgstr ""

18
maps/basic_setup.gd Normal file
View file

@ -0,0 +1,18 @@
extends Node3D
signal celestial_move(parameters)
# Called when the node enters the scene tree for the first time.
func _ready():
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func set_celestial_parameters(parameters):
$WorldEnvironment.environment.sky.sky_material.set_shader_param("samayun_arc", parameters["samayun_arc"])
func _on_basic_setup_celestial_move(parameters):
set_celestial_parameters(parameters)

View file

@ -1,12 +1,10 @@
[gd_scene load_steps=24 format=3 uid="uid://b8p2h0rmwy7qn"] [gd_scene load_steps=19 format=3 uid="uid://cul5wj3ouq8u4"]
[ext_resource type="Material" uid="uid://dpegsmygxcfmv" path="res://maps/materials/basic_ground.material" id="1_lodye"] [ext_resource type="Material" uid="uid://dpegsmygxcfmv" path="res://maps/materials/basic_ground.material" id="1_lodye"]
[ext_resource type="Shader" path="res://maps/shaders/khanat_sky.gdshader" id="1_mheqi"] [ext_resource type="Script" path="res://maps/basic_setup.gd" id="1_narkk"]
[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://cveshwnu272vf" path="res://maps/objects/ramp-complex.tscn" id="2_4eueh"]
[ext_resource type="Texture2D" uid="uid://y0ka7tysfp6b" path="res://maps/textures/zabr_tex_001.png" id="3_bgghj"] [ext_resource type="Environment" uid="uid://bev0tkmkd4wpt" path="res://maps/environments/khanat.tres" id="2_5npi8"]
[ext_resource type="PackedScene" uid="uid://omess6wwwwcq" path="res://maps/objects/ramp-moving.tscn" id="3_bvbgo"] [ext_resource type="PackedScene" uid="uid://omess6wwwwcq" path="res://maps/objects/ramp-moving.tscn" id="3_bvbgo"]
[ext_resource type="Texture2D" uid="uid://dlxp52r0wnwlq" path="res://maps/textures/stigi_tex_001.png" id="3_jqgsm"]
[ext_resource type="PackedScene" uid="uid://dvsl8x3lb1h4e" path="res://maps/objects/moutain.tscn" id="3_rbp35"] [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" 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://b61edh0bre65c" path="res://maps/objects/ramp.tscn" id="5_dfm8h"]
@ -19,39 +17,6 @@
[ext_resource type="PackedScene" uid="uid://bfo13c5k8xu0x" path="res://maps/natural_ground.tscn" id="12_r7x73"] [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"] [ext_resource type="PackedScene" uid="uid://mdsxnqsijdqv" path="res://maps/dispensaire_01.tscn" id="13_ald41"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_s2q0l"]
shader = ExtResource( "1_mheqi" )
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_arc = 45.681
shader_param/samayun_position = Vector3(2.038, 0.695, -0.237)
shader_param/zabr_arc = 8.0
shader_param/zabr_position = Vector3(1.755, 0.599, 0.613)
shader_param/stigi_arc = 8.381
shader_param/stigi_position = Vector3(1.209, 0.444, 0.332)
shader_param/samayun = ExtResource( "1_thm7k" )
shader_param/zabr = ExtResource( "3_bgghj" )
shader_param/stigi = ExtResource( "3_jqgsm" )
[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"] [sub_resource type="BoxMesh" id="BoxMesh_k23th"]
material = ExtResource( "1_lodye" ) material = ExtResource( "1_lodye" )
@ -59,15 +24,16 @@ material = ExtResource( "1_lodye" )
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) 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="basic_setup" type="Node3D"]
script = ExtResource( "1_narkk" )
[node name="sunlight" type="DirectionalLight3D" parent="."] [node name="sunlight" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.278991, 0.960294, 0, -0.960294, 0.278991, -1.75049, 15.9707, 4.39927) transform = Transform3D(1, 0, 0, 0, 0.258819, 0.965926, 0, -0.965926, 0.258819, -1.75049, 15.9707, 4.39927)
light_color = Color(0.988235, 0.960784, 1, 1) light_color = Color(0.988235, 0.960784, 1, 1)
light_energy = 0.75 light_energy = 0.75
shadow_enabled = true shadow_enabled = true
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( "Environment_n5kgx" ) environment = ExtResource( "2_5npi8" )
[node name="floor" type="MeshInstance3D" parent="."] [node name="floor" type="MeshInstance3D" parent="."]
transform = Transform3D(80, 0, 0, 0, 0.1, 0, 0, 0, 80, 0, 0, 0) transform = Transform3D(80, 0, 0, 0, 0.1, 0, 0, 0, 80, 0, 0, 0)
@ -159,3 +125,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 65, 0.05, -15)
[node name="dispensaire_01" parent="." instance=ExtResource( "13_ald41" )] [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) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -7.073, -89.152)
[connection signal="celestial_move" from="." to="." method="_on_basic_setup_celestial_move"]

View file

@ -0,0 +1,39 @@
[gd_resource type="Environment" load_steps=7 format=3 uid="uid://46s305coxmt5"]
[ext_resource type="Shader" path="res://maps/shaders/khanat_sky.gdshader" id="1_3tymq"]
[ext_resource type="Texture2D" uid="uid://b5jer2nm17ld" path="res://maps/textures/samayun_tex_001.png" id="2_nof6j"]
[ext_resource type="Texture2D" uid="uid://dlxp52r0wnwlq" path="res://maps/textures/stigi_tex_001.png" id="3_nkgw7"]
[ext_resource type="Texture2D" uid="uid://y0ka7tysfp6b" path="res://maps/textures/zabr_tex_001.png" id="4_ha8xu"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qtcwg"]
shader = ExtResource( "1_3tymq" )
shader_param/rayleigh = null
shader_param/rayleigh_color = null
shader_param/mie = null
shader_param/mie_eccentricity = null
shader_param/mie_color = null
shader_param/turbidity = null
shader_param/sun_disk_scale = null
shader_param/ground_color = null
shader_param/exposure = null
shader_param/dither_strength = null
shader_param/samayun_arc = 25.0
shader_param/samayun_position = Vector3(0.054, 0.124, 0.057)
shader_param/zabr_arc = 10.0
shader_param/zabr_position = Vector3(0.076, 0.098, 0.052)
shader_param/stigi_arc = 15.0
shader_param/stigi_position = Vector3(0.085, 0.104, 0.088)
shader_param/samayun = ExtResource( "2_nof6j" )
shader_param/zabr = ExtResource( "4_ha8xu" )
shader_param/stigi = ExtResource( "3_nkgw7" )
[sub_resource type="Sky" id="Sky_0olra"]
sky_material = SubResource( "ShaderMaterial_qtcwg" )
[resource]
background_mode = 2
sky = SubResource( "Sky_0olra" )
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

View file

@ -0,0 +1,11 @@
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://bev0tkmkd4wpt"]
[ext_resource type="Script" path="res://maps/environments/khanat_environment.gd" id="1_8awxb"]
[ext_resource type="Sky" uid="uid://djtef650v38ws" path="res://maps/skies/khanat_sky.tres" id="2_wgjdj"]
[resource]
background_mode = 2
sky = ExtResource( "2_wgjdj" )
ambient_light_source = 3
script = ExtResource( "1_8awxb" )
celestial_positions = {}

View file

@ -0,0 +1,22 @@
extends Environment
class_name khanat_environment
@export var celestial_positions: Dictionary
func _ready():
celestial_positions = get_celestial_coordinates()
print("Celestial positions : %s" %celestial_positions)
func get_celestial_coordinates():
var stigi_pos = sky.sky_material.get_shader_param("stigi_position")
var stigi_arc = sky.sky_material.get_shader_param("stigi_arc")
var samayun_pos = sky.sky_material.get_shader_param("samayun_position")
var samayun_arc = sky.sky_material.get_shader_param("samayun_arc")
var zabr_pos = sky.sky_material.get_shader_param("zabr_position")
var zabr_arc = sky.sky_material.get_shader_param("zabr_arc")
var positions = {"stigi_pos":stigi_pos, "stigi_arc":stigi_arc, "samayun_pos":samayun_pos, "samayun_arc":samayun_arc, "zabr_pos":zabr_pos, "zabr_arc":zabr_arc}
return positions

View file

@ -19,16 +19,16 @@ uniform float dither_strength : hint_range(0, 10) = 1.0;
uniform sampler2D night_sky : hint_black_albedo; uniform sampler2D night_sky : hint_black_albedo;
uniform sampler2D samayun : hint_albedo; uniform sampler2D samayun : hint_albedo;
uniform float samayun_arc = 45 ; global uniform float samayun_arc;
uniform vec3 samayun_position = vec3( 0.0, 0.5, 0.0 ); global uniform vec3 samayun_pos;
uniform sampler2D zabr : hint_albedo; uniform sampler2D zabr : hint_albedo;
uniform float zabr_arc = 15 ; global uniform float zabr_arc;
uniform vec3 zabr_position = vec3( 0.0, 0.7, 0.0 ); global uniform vec3 zabr_pos;
uniform sampler2D stigi : hint_albedo; uniform sampler2D stigi : hint_albedo;
uniform float stigi_arc = 8 ; global uniform float stigi_arc;
uniform vec3 stigi_position = vec3( 0.0, 0.8, 0.0 ); global uniform vec3 stigi_pos;
const vec3 UP = vec3( 0.0, 1.0, 0.0 ); const vec3 UP = vec3( 0.0, 1.0, 0.0 );
@ -123,29 +123,29 @@ void sky() {
float stigi_scale = radians(stigi_arc) ; float stigi_scale = radians(stigi_arc) ;
// Calculate respective plane with UV to place celestial object textures // Calculate respective plane with UV to place celestial object textures
vec2 samayun_uv = place_object(samayun_position, EYEDIR) ; vec2 samayun_uv = place_object(samayun_pos, EYEDIR) ;
vec2 zabr_uv = place_object(zabr_position, EYEDIR) ; vec2 zabr_uv = place_object(zabr_pos, EYEDIR) ;
vec2 stigi_uv = place_object(stigi_position, EYEDIR) ; vec2 stigi_uv = place_object(stigi_pos, EYEDIR) ;
// Adding the celestial objects from the nearest to the farest // Adding the celestial objects from the nearest to the farest
// Adding stigi // Adding stigi
if (length(EYEDIR - normalize(stigi_position)) < stigi_scale / 2.0){ // we are in the area of the sky where stigi is placed if (length(EYEDIR - normalize(stigi_pos)) < stigi_scale / 2.0){ // we are in the area of the sky where stigi is placed
COLOR += texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).rgb * texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a; COLOR += texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).rgb * texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a;
} }
// Adding samayun // Adding samayun
if (length(EYEDIR - normalize(samayun_position)) < samayun_scale / 2.0) { // we are in the area of the sky where samayun is placed if (length(EYEDIR - normalize(samayun_pos)) < samayun_scale / 2.0) { // we are in the area of the sky where samayun is placed
if (length(EYEDIR - normalize(stigi_position)) < stigi_scale / 2.0){ // if stigi is in front of samayun, dont draw where stigi alpha is > 0 if (length(EYEDIR - normalize(stigi_pos)) < stigi_scale / 2.0){ // if stigi is in front of samayun, dont draw where stigi alpha is > 0
COLOR += texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).rgb * max((texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a - texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a), 0.0) ; COLOR += texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).rgb * max((texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a - texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a), 0.0) ;
} else { } else {
COLOR += texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).rgb * texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a; COLOR += texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).rgb * texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a;
} }
} }
// Adding zabr // Adding zabr
if (length(EYEDIR - normalize(zabr_position)) < zabr_scale / 2.0) { // we are in the area of the sky where zabr is placed if (length(EYEDIR - normalize(zabr_pos)) < zabr_scale / 2.0) { // we are in the area of the sky where zabr is placed
if (length(EYEDIR - normalize(samayun_position)) < samayun_scale / 2.0){ // if samayun is in front of zabr, dont draw where samayun alpha is > 0 if (length(EYEDIR - normalize(samayun_pos)) < samayun_scale / 2.0){ // if samayun is in front of zabr, dont draw where samayun alpha is > 0
COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * max((texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a - texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a), 0.0) ; COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * max((texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a - texture(samayun, samayun_uv / samayun_scale + vec2(0.5)).a), 0.0) ;
} else { } else {
if (length(EYEDIR - normalize(stigi_position)) < stigi_scale / 2.0){ // if stigi is in front of zabr, dont draw where its alpha is > 0 if (length(EYEDIR - normalize(stigi_pos)) < stigi_scale / 2.0){ // if stigi is in front of zabr, dont draw where its alpha is > 0
COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * max((texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a - texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a), 0.0) ; COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * max((texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a - texture(stigi, stigi_uv / stigi_scale + vec2(0.5)).a), 0.0) ;
} else { } else {
COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a; COLOR += texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).rgb * texture(zabr, zabr_uv / zabr_scale + vec2(0.5)).a;

View file

@ -0,0 +1,25 @@
[gd_resource type="Sky" load_steps=6 format=3 uid="uid://djtef650v38ws"]
[ext_resource type="Shader" path="res://maps/shaders/khanat_sky.gdshader" id="1_e4w87"]
[ext_resource type="Texture2D" uid="uid://b5jer2nm17ld" path="res://maps/textures/samayun_tex_001.png" id="2_takrn"]
[ext_resource type="Texture2D" uid="uid://dlxp52r0wnwlq" path="res://maps/textures/stigi_tex_001.png" id="3_yhaf2"]
[ext_resource type="Texture2D" uid="uid://y0ka7tysfp6b" path="res://maps/textures/zabr_tex_001.png" id="4_t7f5q"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_10g43"]
shader = ExtResource( "1_e4w87" )
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 = ExtResource( "2_takrn" )
shader_param/zabr = ExtResource( "4_t7f5q" )
shader_param/stigi = ExtResource( "3_yhaf2" )
[resource]
sky_material = SubResource( "ShaderMaterial_10g43" )

View file

@ -8,6 +8,16 @@
config_version=5 config_version=5
_global_script_classes=[{
"base": "Environment",
"class": &"khanat_environment",
"language": &"GDScript",
"path": "res://maps/environments/khanat_environment.gd"
}]
_global_script_class_icons={
"khanat_environment": ""
}
[application] [application]
config/name="Third Person basic scene" config/name="Third Person basic scene"
@ -20,6 +30,7 @@ config/features=PackedStringArray("4.0", "Vulkan Clustered")
Themes="*res://scripts/themes.gd" Themes="*res://scripts/themes.gd"
Common="*res://scripts/common.gd" Common="*res://scripts/common.gd"
Screenshot="*res://scripts/screenshot.gd" Screenshot="*res://scripts/screenshot.gd"
khanat_world="*res://scripts/khanat_world.gd"
[debug] [debug]
@ -310,3 +321,30 @@ locale/translations=PackedStringArray("res://locales/en.po", "res://locales/fr.p
3d_render/layer_2="Walls" 3d_render/layer_2="Walls"
3d_render/layer_3="Enemies" 3d_render/layer_3="Enemies"
3d_render/layer_4="Boat" 3d_render/layer_4="Boat"
[shader_globals]
samayun_arc={
"type": "float",
"value": 45.0
}
samayun_pos={
"type": "vec3",
"value": Vector3(1, 1, 1)
}
stigi_pos={
"type": "vec3",
"value": Vector3(0.75, 0.75, 0.75)
}
zabr_pos={
"type": "vec3",
"value": Vector3(0.095, 0.5, 0.5)
}
zabr_arc={
"type": "float",
"value": 15.0
}
stigi_arc={
"type": "float",
"value": 5.0
}

View file

@ -0,0 +1,7 @@
extends Control
func _ready():
$Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel/data_panel/samayun_arc_value.value = khanat_world.celestial_positions["samayun_arc"]
func _on_quit_pressed():
$Window.visible = false

View file

@ -0,0 +1,119 @@
[gd_scene load_steps=3 format=3 uid="uid://bw4pethe0hrey"]
[ext_resource type="Script" path="res://scenes/developper/developper.gd" id="1_qf0rd"]
[ext_resource type="Script" path="res://scenes/developper/sky_panel.gd" id="4_b4n1m"]
[node name="Control" type="Control"]
script = ExtResource( "1_qf0rd" )
[node name="Window" type="Window" parent="."]
title = "win_developper"
visible = false
[node name="VBoxContainer" type="VBoxContainer" parent="Window"]
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
metadata/_edit_use_custom_anchors = false
[node name="MarginContainer" type="MarginContainer" parent="Window/VBoxContainer"]
offset_right = 40.0
offset_bottom = 40.0
size_flags_vertical = 3
theme_override_constants/margin_right = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_left = 5
theme_override_constants/margin_bottom = 5
[node name="sky_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer"]
offset_left = 5.0
offset_top = 5.0
offset_right = 127.0
offset_bottom = 273.0
script = ExtResource( "4_b4n1m" )
[node name="samayun_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel"]
offset_right = 40.0
offset_bottom = 23.0
text = "samayun_name"
horizontal_alignment = 1
[node name="data_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="samayun_pos" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="samayun_arc" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="samayun_arc_value" type="HSlider" parent="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel/data_panel"]
offset_right = 8.0
offset_bottom = 16.0
[node name="stigi_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/stigi_panel"]
offset_right = 40.0
offset_bottom = 26.0
text = "stigi_name"
horizontal_alignment = 1
[node name="data_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel/stigi_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="stigi_pos" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/stigi_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="stigi_arc" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/stigi_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="zabr_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/zabr_panel"]
offset_right = 40.0
offset_bottom = 26.0
text = "zabr_name"
horizontal_alignment = 1
[node name="data_panel" type="VBoxContainer" parent="Window/VBoxContainer/MarginContainer/sky_panel/zabr_panel"]
offset_right = 40.0
offset_bottom = 40.0
[node name="zabr_pos" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/zabr_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="zabr_arc" type="Label" parent="Window/VBoxContainer/MarginContainer/sky_panel/zabr_panel/data_panel"]
offset_right = 40.0
offset_bottom = 23.0
[node name="Quit" type="Button" parent="Window/VBoxContainer"]
offset_left = 491.0
offset_top = 569.0
offset_right = 533.0
offset_bottom = 600.0
size_flags_horizontal = 4
size_flags_vertical = 8
text = "Quit"
[connection signal="close_requested" from="Window" to="." method="_on_quit_pressed"]
[connection signal="value_changed" from="Window/VBoxContainer/MarginContainer/sky_panel/samayun_panel/data_panel/samayun_arc_value" to="Window/VBoxContainer/MarginContainer/sky_panel" method="_on_samayun_arc_value_value_changed"]
[connection signal="pressed" from="Window/VBoxContainer/Quit" to="." method="_on_quit_pressed"]

View file

@ -0,0 +1,24 @@
extends VBoxContainer
signal celestial_manual_moved(parameters)
func _ready():
# Get the initial positions of celestial objects from shader paramaters
# to display them in proper panel
# var positions = get_node("/root/maine_scene/terrain_basic_setup/WorldEnvironment").Environment.get_celestial_coordinates()
var positions = khanat_world.celestial_positions
print("Positions : %s" %positions)
for planet in ["samayun", "stigi", "zabr"]:
get_node("%s_panel/data_panel/%s_pos" %[planet, planet]).text = "%s :\n - X %2f\n - Y %2f\n - Z %2f" % [tr("lab_position"), positions["%s_position" %[planet]][0], positions["%s_position" %[planet]][1], positions["%s_position" %[planet]][2]]
get_node("%s_panel/data_panel/%s_arc" %[planet, planet]).text = "%s : %s" % [tr("lab_size"), positions["%s_arc" %[planet]]]
func _process(delta):
pass
func _on_samayun_arc_value_value_changed(value):
khanat_world.celestial_positions["samayun_arc"] = value
$samayun_panel/data_panel/samayun_arc_value.value = value
$samayun_panel/data_panel/samayun_arc.text = "%s : %s" % [tr("lab_size"), str(value)]
emit_signal("celestial_manual_moved", khanat_world.celestial_positions)

View file

@ -66,6 +66,9 @@ func _on_themes_pressed():
$MenuTheme/Window.popup_centered() $MenuTheme/Window.popup_centered()
$MenuTheme/Window.visible = true $MenuTheme/Window.visible = true
func _on_dev_pressed():
$MenuDev/Window.popup_centered()
$MenuDev/Window.visible = true
func _on_about_pressed(): func _on_about_pressed():
var aboutmessage:String var aboutmessage:String

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://cdyi1a858p7em"] [gd_scene load_steps=8 format=3 uid="uid://cdyi1a858p7em"]
[ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/zbasu/zbasu.theme" id="1_iq3fo"] [ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/zbasu/zbasu.theme" id="1_iq3fo"]
[ext_resource type="Script" path="res://scenes/hud/hud.gd" id="1_s6f6d"] [ext_resource type="Script" path="res://scenes/hud/hud.gd" id="1_s6f6d"]
@ -6,6 +6,7 @@
[ext_resource type="PackedScene" uid="uid://cl8xk8w3jmta0" path="res://scenes/controls/controls.tscn" id="3_08xl7"] [ext_resource type="PackedScene" uid="uid://cl8xk8w3jmta0" path="res://scenes/controls/controls.tscn" id="3_08xl7"]
[ext_resource type="PackedScene" uid="uid://cb0gfweooxdsl" path="res://scenes/themes/themes.tscn" id="4_1poje"] [ext_resource type="PackedScene" uid="uid://cb0gfweooxdsl" path="res://scenes/themes/themes.tscn" id="4_1poje"]
[ext_resource type="PackedScene" uid="uid://ebfrhgrluixd" path="res://scenes/music/music_manager.tscn" id="6_0ivsi"] [ext_resource type="PackedScene" uid="uid://ebfrhgrluixd" path="res://scenes/music/music_manager.tscn" id="6_0ivsi"]
[ext_resource type="PackedScene" uid="uid://bw4pethe0hrey" path="res://scenes/developper/developper.tscn" id="7_ix5xc"]
[node name="Control" type="Control"] [node name="Control" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
@ -14,6 +15,7 @@ theme = ExtResource( "1_iq3fo" )
script = ExtResource( "1_s6f6d" ) script = ExtResource( "1_s6f6d" )
[node name="Message" type="HBoxContainer" parent="."] [node name="Message" type="HBoxContainer" parent="."]
visible = false
anchor_right = 1.0 anchor_right = 1.0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
@ -34,35 +36,44 @@ offset_bottom = 40.0
alignment = 1 alignment = 1
[node name="Keys" type="Button" parent="Menu"] [node name="Keys" type="Button" parent="Menu"]
offset_left = 510.0 offset_left = 205.0
offset_right = 554.0 offset_right = 282.0
offset_bottom = 40.0 offset_bottom = 40.0
text = "HUD/KEYS" text = "HUD/KEYS"
[node name="Themes" type="Button" parent="Menu"] [node name="Themes" type="Button" parent="Menu"]
offset_right = 8.0 offset_left = 285.0
offset_bottom = 31.0 offset_right = 386.0
offset_bottom = 40.0
text = "HUD/THEMES" text = "HUD/THEMES"
[node name="Languages" type="Button" parent="Menu"] [node name="Languages" type="Button" parent="Menu"]
offset_left = 492.0 offset_left = 389.0
offset_right = 574.0 offset_right = 520.0
offset_bottom = 40.0 offset_bottom = 40.0
text = "HUD/LANGUAGES" text = "HUD/LANGUAGES"
[node name="Music" type="Button" parent="Menu"] [node name="Music" type="Button" parent="Menu"]
offset_right = 87.0 offset_left = 523.0
offset_bottom = 19.0 offset_right = 610.0
offset_bottom = 40.0
text = "HUD/MUSIC" text = "HUD/MUSIC"
[node name="Dev" type="Button" parent="Menu"]
offset_left = 613.0
offset_right = 684.0
offset_bottom = 40.0
text = "HUD/DEV"
[node name="About" type="Button" parent="Menu"] [node name="About" type="Button" parent="Menu"]
offset_right = 40.0 offset_left = 687.0
offset_bottom = 19.0 offset_right = 779.0
offset_bottom = 40.0
text = "HUD/ABOUT" text = "HUD/ABOUT"
[node name="Quit" type="Button" parent="Menu"] [node name="Quit" type="Button" parent="Menu"]
offset_left = 578.0 offset_left = 782.0
offset_right = 619.0 offset_right = 858.0
offset_bottom = 40.0 offset_bottom = 40.0
text = "HUD/QUIT" text = "HUD/QUIT"
@ -85,13 +96,36 @@ visible = false
[node name="MenuTheme" parent="." instance=ExtResource( "4_1poje" )] [node name="MenuTheme" parent="." instance=ExtResource( "4_1poje" )]
visible = false visible = false
anchor_right = 0.0
anchor_bottom = 0.0
metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = false
[node name="MusicManager" parent="." instance=ExtResource( "6_0ivsi" )] [node name="MusicManager" parent="." instance=ExtResource( "6_0ivsi" )]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = false
[node name="MenuDev" parent="." instance=ExtResource( "7_ix5xc" )]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = false
[connection signal="pressed" from="Menu/Keys" to="." method="_on_keys_pressed"] [connection signal="pressed" from="Menu/Keys" to="." method="_on_keys_pressed"]
[connection signal="pressed" from="Menu/Themes" to="." method="_on_themes_pressed"] [connection signal="pressed" from="Menu/Themes" to="." method="_on_themes_pressed"]
[connection signal="pressed" from="Menu/Languages" to="." method="_on_languages_pressed"] [connection signal="pressed" from="Menu/Languages" to="." method="_on_languages_pressed"]
[connection signal="pressed" from="Menu/Music" to="." method="_on_music_pressed"] [connection signal="pressed" from="Menu/Music" to="." method="_on_music_pressed"]
[connection signal="pressed" from="Menu/Dev" to="." method="_on_dev_pressed"]
[connection signal="pressed" from="Menu/About" to="." method="_on_about_pressed"] [connection signal="pressed" from="Menu/About" to="." method="_on_about_pressed"]
[connection signal="pressed" from="Menu/Quit" to="." method="_on_quit_pressed"] [connection signal="pressed" from="Menu/Quit" to="." method="_on_quit_pressed"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View file

@ -2,7 +2,7 @@
[ext_resource type="PackedScene" uid="uid://dwxrvijqyym70" path="res://player/player.tscn" id="1_btdsd"] [ext_resource type="PackedScene" uid="uid://dwxrvijqyym70" path="res://player/player.tscn" id="1_btdsd"]
[ext_resource type="Script" path="res://scenes/main/main.gd" id="1_ld2xt"] [ext_resource type="Script" path="res://scenes/main/main.gd" id="1_ld2xt"]
[ext_resource type="PackedScene" uid="uid://b8p2h0rmwy7qn" path="res://maps/basic_setup.tscn" id="2_jj4oa"] [ext_resource type="PackedScene" uid="uid://cul5wj3ouq8u4" path="res://maps/basic_setup.tscn" id="2_jj4oa"]
[ext_resource type="PackedScene" uid="uid://cdyi1a858p7em" path="res://scenes/hud/hud.tscn" id="3_5vcj4"] [ext_resource type="PackedScene" uid="uid://cdyi1a858p7em" path="res://scenes/hud/hud.tscn" id="3_5vcj4"]
[node name="main_scene" type="Node3D"] [node name="main_scene" type="Node3D"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,33 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://se0t5xwdxyq7"
path="res://.godot/imported/base_panel.png-2a8a839c6032022981731374105e51fc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://scenes/themes/textures/base_panel.png"
dest_files=["res://.godot/imported/base_panel.png-2a8a839c6032022981731374105e51fc.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
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/size_limit=0
detect_3d/compress_to=1

24
scripts/khanat_world.gd Normal file
View file

@ -0,0 +1,24 @@
extends Node
var celestial_positions = {
"samayun_position":Vector3( 0.0, 0.5, 0.0 ),
"samayun_arc":45,
"stigi_position":Vector3( 0.0, 0.8, 0.0 ),
"stigi_arc":8,
"zabr_position":Vector3( 0.0, 0.7, 0.0 ),
"zabr_arc":15,
}
func _ready():
khanat_world.celestial_positions = celestial_positions
var sky_panel = get_node("/root/main_scene/Control/MenuDev/Window/VBoxContainer/MarginContainer/sky_panel")
sky_panel.celestial_manual_moved.connect(self._set_celestial)
func _process(delta):
pass
func _set_celestial(parameters):
for key in parameters:
RenderingServer.global_variable_set(key, parameters[key])
celestial_positions[key] = parameters[key]
Common.msg_debug("New celestial parameter : %s with value %s" % [key, parameters[key]])