Improved lighting

This commit is contained in:
Eduard Urbach 2024-02-08 21:42:16 +01:00
parent c4a9da0880
commit d36de18b3c
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
11 changed files with 118 additions and 20 deletions

View File

@ -23,7 +23,9 @@
[ext_resource type="MultiMesh" uid="uid://dog5aq5n2q025" path="res://assets/grass/grass.multimesh" id="19_ae26a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_he5c5"]
albedo_color = Color(0.0156863, 0.654902, 0.501961, 1)
diffuse_mode = 3
albedo_color = Color(0.0117647, 0.501961, 0.376471, 1)
emission = Color(0.00294706, 0.262987, 0.194557, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_lb6xk"]
material = SubResource("StandardMaterial3D_he5c5")
@ -93,7 +95,7 @@ autostart = true
[node name="Follow" type="Node3D" parent="World"]
[node name="Pivot" type="Node3D" parent="World/Follow"]
[node name="Pivot" type="Marker3D" parent="World/Follow"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="Camera" type="Camera3D" parent="World/Follow/Pivot" node_paths=PackedStringArray("follow_node", "pivot_node")]
@ -106,16 +108,16 @@ script = ExtResource("18_wogcj")
follow_node = NodePath("../..")
pivot_node = NodePath("..")
[node name="Sun" type="DirectionalLight3D" parent="World"]
transform = Transform3D(0.984808, 0.122788, -0.122788, 0, 0.707107, 0.707107, 0.173648, -0.696364, 0.696364, 0, 3, 0)
light_energy = 0.1
shadow_enabled = true
script = ExtResource("11_4jb08")
[node name="Environment" type="WorldEnvironment" parent="World"]
environment = ExtResource("12_cscto")
camera_attributes = ExtResource("15_6h2nx")
[node name="Sun" type="DirectionalLight3D" parent="World/Environment"]
transform = Transform3D(-0.350207, 0.827032, -0.439741, 0, 0.469472, 0.882948, 0.936672, 0.309215, -0.164412, 0, 3, 0)
light_energy = 2.0
shadow_enabled = true
script = ExtResource("11_4jb08")
[node name="Trees" type="Node3D" parent="World"]
[node name="Tree" parent="World/Trees" instance=ExtResource("14_7jtdl")]

View File

@ -0,0 +1,7 @@
extends CheckButton
func _ready():
set_pressed_no_signal(Global.environment.ssao_enabled)
func on_toggled(toggled_on: bool):
Global.environment.ssao_enabled = toggled_on

View File

@ -0,0 +1,7 @@
extends CheckButton
func _ready():
set_pressed_no_signal(Global.environment.ssil_enabled)
func on_toggled(toggled_on: bool):
Global.environment.ssil_enabled = toggled_on

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://bqpbrju7mc7d5"]
[gd_scene load_steps=12 format=3 uid="uid://bqpbrju7mc7d5"]
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
[ext_resource type="Script" path="res://ui/settings/Glow.gd" id="1_vkhbt"]
@ -6,7 +6,9 @@
[ext_resource type="Script" path="res://ui/label/ParentNameLabel.gd" id="2_72a3s"]
[ext_resource type="Script" path="res://ui/settings/RenderScale.gd" id="3_o5ei3"]
[ext_resource type="Script" path="res://ui/settings/DepthOfField.gd" id="5_kjasn"]
[ext_resource type="Script" path="res://ui/settings/SSAO.gd" id="6_fu528"]
[ext_resource type="Script" path="res://ui/settings/Brightness.gd" id="7_redsl"]
[ext_resource type="Script" path="res://ui/settings/SSIL.gd" id="7_wt6tg"]
[ext_resource type="Script" path="res://ui/settings/Contrast.gd" id="8_q4hif"]
[ext_resource type="Script" path="res://ui/settings/Saturation.gd" id="9_wbvcu"]
@ -112,6 +114,51 @@ layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("5_kjasn")
[node name="SSAO" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
[node name="Label" type="Label" parent="TabContainer/Video/VBoxContainer/SSAO"]
layout_mode = 2
size_flags_horizontal = 3
text = "SSAO:"
script = ExtResource("2_72a3s")
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSAO"]
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("6_fu528")
[node name="SSIL" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
[node name="Label" type="Label" parent="TabContainer/Video/VBoxContainer/SSIL"]
layout_mode = 2
size_flags_horizontal = 3
text = "SSIL:"
script = ExtResource("2_72a3s")
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/SSIL"]
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("7_wt6tg")
[node name="Volumetric Fog" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
[node name="Label" type="Label" parent="TabContainer/Video/VBoxContainer/Volumetric Fog"]
layout_mode = 2
size_flags_horizontal = 3
text = "Volumetric Fog:"
script = ExtResource("2_72a3s")
[node name="CheckButton" type="CheckButton" parent="TabContainer/Video/VBoxContainer/Volumetric Fog"]
layout_mode = 2
size_flags_horizontal = 3
script = ExtResource("7_wt6tg")
[node name="Brightness" type="HBoxContainer" parent="TabContainer/Video/VBoxContainer"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
@ -177,6 +224,9 @@ layout_mode = 2
[connection signal="item_selected" from="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" to="TabContainer/Video/VBoxContainer/Scale Mode/OptionButton" method="on_item_selected"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/Glow/CheckButton" to="TabContainer/Video/VBoxContainer/Glow/CheckButton" method="on_toggled"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/Depth of Field/CheckButton" to="TabContainer/Video/VBoxContainer/Depth of Field/CheckButton" method="on_toggled"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/SSAO/CheckButton" to="TabContainer/Video/VBoxContainer/SSAO/CheckButton" method="on_toggled"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/SSIL/CheckButton" to="TabContainer/Video/VBoxContainer/SSIL/CheckButton" method="on_toggled"]
[connection signal="toggled" from="TabContainer/Video/VBoxContainer/Volumetric Fog/CheckButton" to="TabContainer/Video/VBoxContainer/Volumetric Fog/CheckButton" method="on_toggled"]
[connection signal="value_changed" from="TabContainer/Video/VBoxContainer/Brightness/HSlider" to="TabContainer/Video/VBoxContainer/Brightness/HSlider" method="on_value_changed"]
[connection signal="value_changed" from="TabContainer/Video/VBoxContainer/Contrast/HSlider" to="TabContainer/Video/VBoxContainer/Contrast/HSlider" method="on_value_changed"]
[connection signal="value_changed" from="TabContainer/Video/VBoxContainer/Saturation/HSlider" to="TabContainer/Video/VBoxContainer/Saturation/HSlider" method="on_value_changed"]

View File

@ -0,0 +1,7 @@
extends CheckButton
func _ready():
set_pressed_no_signal(Global.environment.volumetric_fog_enabled)
func on_toggled(toggled_on: bool):
Global.environment.volumetric_fog_enabled = toggled_on

View File

@ -1,7 +1,5 @@
[gd_resource type="CameraAttributesPractical" format=3 uid="uid://b835orxyqq6w5"]
[resource]
dof_blur_far_enabled = true
dof_blur_far_distance = 25.0
dof_blur_far_transition = 25.0
dof_blur_near_enabled = true

View File

@ -1,20 +1,33 @@
[gd_resource type="Environment" load_steps=3 format=3 uid="uid://dixa0yso2s1u3"]
[ext_resource type="Material" uid="uid://bki5jtbipsnfn" path="res://world/ProceduralSkyMaterial.tres" id="1_68jth"]
[ext_resource type="Material" uid="uid://chtgn5pdoof5e" path="res://world/sky/PanoramaSkyMaterial.tres" id="1_vb3or"]
[sub_resource type="Sky" id="Sky_2vfia"]
sky_material = ExtResource("1_68jth")
sky_material = ExtResource("1_vb3or")
[resource]
background_mode = 2
background_color = Color(0.317647, 0.541176, 0.713726, 1)
sky = SubResource("Sky_2vfia")
ambient_light_source = 3
ambient_light_sky_contribution = 0.9
ambient_light_color = Color(0.5, 0.5, 0.5, 1)
ambient_light_sky_contribution = 0.3
ambient_light_energy = 3.0
reflected_light_source = 2
tonemap_mode = 3
tonemap_mode = 2
tonemap_white = 6.0
ssao_enabled = true
ssil_enabled = true
sdfgi_use_occlusion = true
glow_enabled = true
glow_intensity = 0.1
glow_strength = 1.07
glow_bloom = 0.2
glow_blend_mode = 1
glow_hdr_threshold = 0.7
volumetric_fog_enabled = true
volumetric_fog_density = 0.005
volumetric_fog_emission = Color(0.45098, 0.690196, 1, 1)
adjustment_enabled = true
adjustment_contrast = 1.1
adjustment_saturation = 1.1

View File

@ -6,6 +6,6 @@
render_priority = 0
shader = ExtResource("1_7qi6v")
shader_parameter/color_bottom = Color(0.0156863, 0.654902, 0.501961, 1)
shader_parameter/color_top = Color(0.592157, 0.917647, 0.368627, 1)
shader_parameter/color_top = Color(0.513726, 0.811765, 0.301961, 1)
shader_parameter/wind = Vector3(0.1, 0, 0.1)
shader_parameter/wind_speed = Vector3(1, 0, 1)

View File

@ -1,5 +1,10 @@
shader_type spatial;
render_mode shadows_disabled, cull_disabled;
render_mode cull_disabled;
render_mode diffuse_lambert_wrap;
//render_mode diffuse_lambert;
//render_mode diffuse_burley;
//render_mode diffuse_toon;
//render_mode unshaded;
uniform vec3 color_bottom : source_color;
uniform vec3 color_top : source_color;
@ -21,8 +26,11 @@ void vertex() {
void fragment() {
ALBEDO = mix(color_top, color_bottom, UV.y);
NORMAL = vec3(0.0, 1.0, 0.0);
if (!FRONT_FACING) {
NORMAL = -NORMAL;
}
//if (!FRONT_FACING) {
//NORMAL = -NORMAL;
//}
//ALPHA = 1.0 - UV.y * UV.y;
}

View File

@ -0,0 +1,6 @@
[gd_resource type="PanoramaSkyMaterial" load_steps=2 format=3 uid="uid://chtgn5pdoof5e"]
[ext_resource type="Texture2D" uid="uid://4l38jbamupdd" path="res://assets/skybox/anime-skybox.png" id="1_xt1kt"]
[resource]
panorama = ExtResource("1_xt1kt")