Skip to content

Commit

Permalink
cleanup and sky time sync
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmaceira committed Jan 28, 2025
1 parent d2e8715 commit bd520bd
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 286 deletions.
12 changes: 3 additions & 9 deletions godot/assets/environment/sky_high/sky_high.tscn
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
[gd_scene load_steps=6 format=3 uid="uid://bgi7p762xl08l"]
[gd_scene load_steps=4 format=3 uid="uid://bgi7p762xl08l"]

[ext_resource type="Script" path="res://assets/environment/sky_base.gd" id="1_0y4pc"]
[ext_resource type="Texture2D" uid="uid://bdg7jrtachy6f" path="res://assets/environment/sky_high/AllSkyFree_Sky_EpicBlueSunset_Equirect.png" id="2_yrgpo"]

[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_kg6cs"]
panorama = ExtResource("2_yrgpo")

[sub_resource type="Sky" id="Sky_2yrrx"]
sky_material = SubResource("PanoramaSkyMaterial_kg6cs")
[ext_resource type="Sky" uid="uid://l82r2nfrgcbx" path="res://assets/sky.tres" id="2_13tc8"]

[sub_resource type="Environment" id="Environment_8xuge"]
background_mode = 2
background_energy_multiplier = 0.5
sky = SubResource("Sky_2yrrx")
sky = ExtResource("2_13tc8")
ambient_light_color = Color(0.815686, 0.784314, 0.658824, 1)
ambient_light_sky_contribution = 0.4
tonemap_mode = 3
Expand Down
4 changes: 2 additions & 2 deletions godot/assets/environment/sky_low/sky_low.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[gd_scene load_steps=4 format=3 uid="uid://dsqq58ubnjwen"]

[ext_resource type="Script" path="res://assets/environment/sky_base.gd" id="1_u1jk8"]
[ext_resource type="Sky" uid="uid://4cq5nn54wxeu" path="res://new_sky.tres" id="2_yatk5"]
[ext_resource type="Sky" uid="uid://l82r2nfrgcbx" path="res://assets/sky.tres" id="2_xkl7w"]

[sub_resource type="Environment" id="Environment_mvu0t"]
background_mode = 2
background_energy_multiplier = 0.5
sky = ExtResource("2_yatk5")
sky = ExtResource("2_xkl7w")
ambient_light_color = Color(0.815686, 0.784314, 0.658824, 1)
ambient_light_sky_contribution = 0.4
tonemap_mode = 3
Expand Down
12 changes: 3 additions & 9 deletions godot/assets/environment/sky_medium/sky_medium.tscn
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
[gd_scene load_steps=6 format=3 uid="uid://y5q8yolbxvfv"]
[gd_scene load_steps=4 format=3 uid="uid://y5q8yolbxvfv"]

[ext_resource type="Texture2D" uid="uid://cbqxx4vdb574k" path="res://assets/environment/sky_medium/AllSkyFree_Sky_ClearBlueSky_Equirect.png" id="1_b3rsq"]
[ext_resource type="Script" path="res://assets/environment/sky_base.gd" id="2_5v3h1"]

[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_klpcs"]
panorama = ExtResource("1_b3rsq")

[sub_resource type="Sky" id="Sky_5ff4i"]
sky_material = SubResource("PanoramaSkyMaterial_klpcs")
[ext_resource type="Sky" uid="uid://l82r2nfrgcbx" path="res://assets/sky.tres" id="2_auxen"]

[sub_resource type="Environment" id="Environment_mvu0t"]
background_mode = 2
background_energy_multiplier = 0.5
sky = SubResource("Sky_5ff4i")
sky = ExtResource("2_auxen")
ambient_light_color = Color(0.815686, 0.784314, 0.658824, 1)
ambient_light_sky_contribution = 0.4
tonemap_mode = 3
Expand Down
71 changes: 35 additions & 36 deletions godot/new_sky.tres → godot/assets/sky.tres
Original file line number Diff line number Diff line change
@@ -1,86 +1,85 @@
[gd_resource type="Sky" load_steps=18 format=3 uid="uid://4cq5nn54wxeu"]
[gd_resource type="Sky" load_steps=18 format=3 uid="uid://l82r2nfrgcbx"]

[ext_resource type="Shader" path="res://shaders/sky_test.gdshader" id="1_ndpuy"]
[ext_resource type="Shader" path="res://shaders/sky.gdshader" id="1_bggni"]

[sub_resource type="Gradient" id="Gradient_ebu3r"]
[sub_resource type="Gradient" id="Gradient_o4o57"]
offsets = PackedFloat32Array(0.140436, 0.837772)
colors = PackedColorArray(0.517251, 0.665659, 1, 1, 1, 1, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_lhqux"]
gradient = SubResource("Gradient_ebu3r")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_7vh77"]
gradient = SubResource("Gradient_o4o57")
width = 2

[sub_resource type="Gradient" id="Gradient_sqyjl"]
[sub_resource type="Gradient" id="Gradient_gikcw"]
colors = PackedColorArray(0.140744, 0.000228958, 0.254497, 1, 0.235358, 0.000198106, 0.719567, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_k5m3k"]
gradient = SubResource("Gradient_sqyjl")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_33c0e"]
gradient = SubResource("Gradient_gikcw")
width = 2

[sub_resource type="Gradient" id="Gradient_odg0d"]
[sub_resource type="Gradient" id="Gradient_gtks6"]

[sub_resource type="FastNoiseLite" id="FastNoiseLite_6tpnp"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_bbgy8"]
noise_type = 5
fractal_octaves = 7
fractal_weighted_strength = 0.25

[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_re5no"]
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_x8sx6"]
seamless = true
seamless_blend_skirt = 0.578
color_ramp = SubResource("Gradient_odg0d")
noise = SubResource("FastNoiseLite_6tpnp")
color_ramp = SubResource("Gradient_gtks6")
noise = SubResource("FastNoiseLite_bbgy8")

[sub_resource type="Gradient" id="Gradient_6ka8e"]
[sub_resource type="Gradient" id="Gradient_fb67a"]
offsets = PackedFloat32Array(0, 0.244147, 0.525084, 0.752508, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 0.458027, 0.205551, 1, 0.662778, 0.743771, 1, 1, 1, 0.458824, 0.203922, 1, 1, 1, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_omu14"]
gradient = SubResource("Gradient_6ka8e")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_nrrql"]
gradient = SubResource("Gradient_fb67a")
width = 5

[sub_resource type="Gradient" id="Gradient_jxqon"]
[sub_resource type="Gradient" id="Gradient_paq02"]
offsets = PackedFloat32Array(0, 0.331104, 0.491639, 0.665552, 1)
colors = PackedColorArray(0.960784, 0.494118, 0, 1, 0.629251, 0.0174917, 1.92523e-07, 1, 0, 0, 0, 1, 0.559215, 0, 0.146574, 1, 0.960165, 0.492818, 0, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_twe2d"]
gradient = SubResource("Gradient_jxqon")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_c4tp5"]
gradient = SubResource("Gradient_paq02")
width = 5

[sub_resource type="Gradient" id="Gradient_7rh7u"]
[sub_resource type="Gradient" id="Gradient_dn7ne"]
interpolation_mode = 2
interpolation_color_space = 2
offsets = PackedFloat32Array(0, 0.38983, 0.79661, 1)
colors = PackedColorArray(2.52686e-07, 0.159275, 0.233158, 1, 0.362861, 0.000795168, 0.513489, 1, 0, 0.793592, 0.582014, 1, 2.52686e-07, 0.159275, 0.233158, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_dsdel"]
gradient = SubResource("Gradient_7rh7u")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_g2lqa"]
gradient = SubResource("Gradient_dn7ne")
width = 6

[sub_resource type="Gradient" id="Gradient_q5d6q"]
[sub_resource type="Gradient" id="Gradient_og5o5"]
offsets = PackedFloat32Array(0, 0.214047, 0.709443, 1)
colors = PackedColorArray(1, 1, 1, 1, 0.755973, 0, 0.394386, 1, 1, 0.668246, 0.398002, 1, 1, 1, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_kfht4"]
gradient = SubResource("Gradient_q5d6q")
[sub_resource type="GradientTexture1D" id="GradientTexture1D_xttk3"]
gradient = SubResource("Gradient_og5o5")
width = 6

[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfsf3"]
shader = ExtResource("1_ndpuy")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fx4kt"]
shader = ExtResource("1_bggni")
shader_parameter/energy = 1.0
shader_parameter/gamma = 1.0
shader_parameter/scale = Vector3(1, 0.14, 1)
shader_parameter/dither_range = 0.0
shader_parameter/dither_amount = 256.0
shader_parameter/day_night_cycle = 0.611
shader_parameter/floor_color = Color(9.14484e-07, 0.301144, 0.386001, 1)
shader_parameter/clouds_tex = SubResource("NoiseTexture2D_re5no")
shader_parameter/clouds_gradient_day = SubResource("GradientTexture1D_lhqux")
shader_parameter/clouds_gradient_night = SubResource("GradientTexture1D_k5m3k")
shader_parameter/tint_color_cycle_top = SubResource("GradientTexture1D_kfht4")
shader_parameter/tint_color_cycle_bottom = SubResource("GradientTexture1D_dsdel")
shader_parameter/sun_color_cycle = SubResource("GradientTexture1D_twe2d")
shader_parameter/moon_color_cycle = SubResource("GradientTexture1D_omu14")
shader_parameter/clouds_tex = SubResource("NoiseTexture2D_x8sx6")
shader_parameter/clouds_gradient_day = SubResource("GradientTexture1D_7vh77")
shader_parameter/clouds_gradient_night = SubResource("GradientTexture1D_33c0e")
shader_parameter/tint_color_cycle_top = SubResource("GradientTexture1D_xttk3")
shader_parameter/tint_color_cycle_bottom = SubResource("GradientTexture1D_g2lqa")
shader_parameter/sun_color_cycle = SubResource("GradientTexture1D_c4tp5")
shader_parameter/moon_color_cycle = SubResource("GradientTexture1D_nrrql")

[resource]
sky_material = SubResource("ShaderMaterial_pfsf3")
sky_material = SubResource("ShaderMaterial_fx4kt")
radiance_size = 0
12 changes: 0 additions & 12 deletions godot/old_sky.tres

This file was deleted.

8 changes: 8 additions & 0 deletions godot/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ UiSounds="*res://src/helpers_components/ui_sounds.gd"
Global="*res://src/global.gd"
XRToolsUserSettings="*res://addons/godot-xr-tools/user_settings/user_settings.gd"
XRToolsRumbleManager="*res://addons/godot-xr-tools/rumble/rumble_manager.gd"
GlobalTime="*res://src/time.gd"

[debug]

Expand Down Expand Up @@ -200,6 +201,13 @@ anti_aliasing/quality/screen_space_aa=1
lights_and_shadows/positional_shadow/atlas_size=2048
lights_and_shadows/positional_shadow/atlas_quadrant_3_subdiv=3

[shader_globals]

day_night_cycle={
"type": "float",
"value": 0.0
}

[xr]

openxr/foveation_level=3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ uniform float dither_range = .1;

uniform float dither_amount = 128.0;

uniform float day_night_cycle : hint_range(0.0,1.0);
global uniform float day_night_cycle : hint_range(0.0,1.0);

uniform vec3 floor_color : source_color;

Expand Down
67 changes: 0 additions & 67 deletions godot/sky_shader.tres

This file was deleted.

Loading

0 comments on commit bd520bd

Please sign in to comment.