Improves scene lighting and tree collision
Moves light direction to global shader parameter, enabling dynamic light updates. Adjusts tree collision shape for better player interaction. Updates default season to summer.
This commit is contained in:
parent
f98773237e
commit
a4f409f877
7 changed files with 28 additions and 16 deletions
|
|
@ -13,7 +13,7 @@ uniform float darken_amount : hint_range(0, 1, 0.01) = 0.3;
|
|||
uniform float lighten_amount : hint_range(0, 10, 0.01) = 1.5;
|
||||
|
||||
uniform vec3 normal_edge_bias = vec3(1, 1, 1);
|
||||
uniform vec3 light_direction = vec3(-0.96, -0.18, 0.2);
|
||||
global uniform vec3 light_direction;
|
||||
|
||||
float get_depth(vec2 screen_uv, mat4 inv_projection_matrix) {
|
||||
float depth = texture(depth_texture, screen_uv).r;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ height = 0.5
|
|||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_702jv"]
|
||||
radius = 0.6
|
||||
height = 2.5
|
||||
|
||||
[node name="Tree" type="Node3D"]
|
||||
script = ExtResource("1_702jv")
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ var seasons: Array = [
|
|||
"winter"
|
||||
]
|
||||
|
||||
@export var current: String = "autumn"
|
||||
@export var current: String = "summer"
|
||||
|
|
@ -2,7 +2,7 @@ shader_type spatial;
|
|||
render_mode cull_front, unshaded;
|
||||
|
||||
uniform vec3 color : source_color = vec3(0,0,0);
|
||||
uniform float thickness : hint_range(0.0, 1.0, 0.01) = 0.03;
|
||||
uniform float thickness : hint_range(0.0, 1.0, 0.01) = 0.01;
|
||||
|
||||
void vertex() {
|
||||
VERTEX += thickness*NORMAL;
|
||||
|
|
|
|||
|
|
@ -94,3 +94,7 @@ player_position={
|
|||
"type": "vec3",
|
||||
"value": Vector3(0, 0, 0)
|
||||
}
|
||||
light_direction={
|
||||
"type": "vec3",
|
||||
"value": Vector3(0, 0, 0)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,16 @@
|
|||
[sub_resource type="GDScript" id="GDScript_0yf11"]
|
||||
script/source = "extends Node3D
|
||||
|
||||
@onready var player = %Player
|
||||
@onready var directional_light = $DirectionalLight3D # Adjust path to your light
|
||||
@export var shader_parameter_name: String = \"light_direction\"
|
||||
|
||||
func _process(delta):
|
||||
rotate_y(0.5 * delta)
|
||||
|
||||
if player and directional_light:
|
||||
var light_forward = -directional_light.global_transform.basis.z
|
||||
RenderingServer.global_shader_parameter_set(shader_parameter_name, light_forward)
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_h3wmm"]
|
||||
|
|
@ -363,7 +370,6 @@ shader_parameter/normal_threshold = 0.6
|
|||
shader_parameter/darken_amount = 0.3
|
||||
shader_parameter/lighten_amount = 1.5
|
||||
shader_parameter/normal_edge_bias = Vector3(-1, -1, -1)
|
||||
shader_parameter/light_direction = Vector3(-0.0338118, -0.78043, 0.624328)
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_tfa5t"]
|
||||
lightmap_size_hint = Vector2i(102, 102)
|
||||
|
|
@ -463,6 +469,7 @@ script = SubResource("GDScript_0yf11")
|
|||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment/Node3D"]
|
||||
transform = Transform3D(-0.936623, -0.348704, 0.0338123, -0.193211, 0.594641, 0.78043, -0.292245, 0.724436, -0.624328, 0, 0, 0)
|
||||
shadow_enabled = true
|
||||
shadow_blur = 1.598
|
||||
script = SubResource("GDScript_h3wmm")
|
||||
|
||||
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
|
||||
|
|
@ -805,6 +812,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0053246, 0, 0.0117908)
|
|||
|
||||
[node name="Fire" type="GPUParticles3D" parent="SubViewportContainer/SubViewport/Camp/Objects/Camp/Campfire"]
|
||||
transform = Transform3D(1.42857, 0, 0, 0, 1.42857, 0, 0, 0, 1.42857, 0, 0, 0)
|
||||
layers = 2
|
||||
amount = 50
|
||||
lifetime = 0.4
|
||||
speed_scale = 0.4
|
||||
|
|
@ -814,7 +822,7 @@ draw_pass_1 = SubResource("QuadMesh_hvb1l")
|
|||
[node name="OmniLight3D" type="OmniLight3D" parent="SubViewportContainer/SubViewport/Camp/Objects/Camp/Campfire/Fire"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.000509977, 0.121094, -0.00151992)
|
||||
light_color = Color(0.89, 0.461613, 0.2136, 1)
|
||||
light_energy = 0.923321
|
||||
light_energy = 0.823082
|
||||
light_indirect_energy = 1.084
|
||||
light_volumetric_fog_energy = 3.764
|
||||
light_size = 0.105
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lg8b7"]
|
||||
sky_horizon_color = Color(0.67451, 0.682353, 0.698039, 1)
|
||||
sky_curve = 0.0175
|
||||
ground_bottom_color = Color(1, 1, 1, 1)
|
||||
ground_curve = 0.171484
|
||||
|
||||
|
|
@ -9,19 +10,17 @@ ground_curve = 0.171484
|
|||
sky_material = SubResource("ProceduralSkyMaterial_lg8b7")
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_color = Color(1, 1, 0.603922, 1)
|
||||
background_mode = 1
|
||||
background_color = Color(0.752941, 0.776471, 0.827451, 1)
|
||||
sky = SubResource("Sky_7bk1c")
|
||||
ambient_light_source = 3
|
||||
ambient_light_color = Color(0.800491, 0.800491, 0.800491, 1)
|
||||
reflected_light_source = 2
|
||||
tonemap_mode = 2
|
||||
ssil_enabled = true
|
||||
sdfgi_use_occlusion = true
|
||||
ambient_light_color = Color(0.662745, 0.694118, 0.772549, 1)
|
||||
ambient_light_energy = 1.15
|
||||
tonemap_mode = 3
|
||||
ssao_enabled = true
|
||||
ssao_radius = 0.3
|
||||
ssao_intensity = 0.5
|
||||
ssao_power = 15.0
|
||||
glow_levels/2 = 0.6
|
||||
glow_levels/3 = 0.6
|
||||
glow_levels/5 = 0.0
|
||||
glow_intensity = 2.0
|
||||
fog_density = 0.0635
|
||||
volumetric_fog_emission = Color(0.821925, 0.333878, 0.419207, 1)
|
||||
volumetric_fog_ambient_inject = 16.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue