added pipe rifle animation

This commit is contained in:
2026-02-10 02:48:14 +11:00
parent 137a979c5c
commit d8101979b9
113 changed files with 1025 additions and 415 deletions

View File

@@ -20,195 +20,6 @@
[ext_resource type="Texture2D" uid="uid://dqrfgw65d0sq8" path="res://Assets/Textures/bridge_map.png" id="28_6od8s"]
[ext_resource type="PackedScene" uid="uid://ca174636iktc6" path="res://Zones/Moat/mesh_moat.glb" id="30_ttr7n"]
[sub_resource type="Shader" id="Shader_6od8s"]
code = "shader_type sky;
render_mode use_debanding;
uniform vec4 sky_top_color : source_color = vec4(0.385, 0.454, 0.55, 1.0);
uniform vec4 sky_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0);
uniform float sky_curve : hint_range(0, 1) = 0.15;
uniform float sky_energy = 1.0; // In Lux.
uniform sampler2D sky_cover : filter_linear, source_color, hint_default_black;
uniform vec4 sky_cover_modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0);
uniform vec4 ground_bottom_color : source_color = vec4(0.2, 0.169, 0.133, 1.0);
uniform vec4 ground_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0);
uniform float ground_curve : hint_range(0, 1) = 0.02;
uniform float ground_energy = 1.0;
uniform float sun_angle_max = 30.0;
uniform float sun_curve : hint_range(0, 1) = 0.15;
uniform float exposure : hint_range(0, 128) = 1.0;
// Wind offset direction (x and y only)
uniform vec2 wind_offset_direction = vec2(0.5, 0.1); // Control direction of offset (x, y)
uniform float wind_speed : hint_range(0.0, 25.0) = 1.0; // Speed of the noise movement over time
// Cloud change settings
uniform bool clouds_change = true; // Whether to change the cloud layer or not
uniform float cloud_change_rate : hint_range(0.0, 5.0) = .40; // Rate at which the cloud effect changes
// Pole blending parameters
uniform float pole_blend_shape : hint_range(0.0, 2.0) = 0.05; // How much the noise affects the blend shape
uniform float pole_blend_strength : hint_range(0, 1) = 0.05; // Control blending intensity at poles
uniform float pole_blend_brightness : hint_range(0.0, 1.0) = .3;
// Horizon blending parameters - similar to pole blending
uniform float horizon_blend_shape : hint_range(0.0, 2.0) = 0.05; // How much the noise affects the horizon blend shape
uniform float horizon_blend_strength : hint_range(0, 1) = 0.05; // Control blending intensity at horizon
uniform float horizon_blend_brightness : hint_range(0.0, 1.0) = .3;
uniform float horizon_blend_width : hint_range(0.0, 0.5) = 0.1; // Width of the horizon blend region
void sky() {
float v_angle = acos(clamp(EYEDIR.y, -1.0, 1.0));
float c = (1.0 - v_angle / (PI * 0.5));
vec3 sky = mix(sky_horizon_color.rgb, sky_top_color.rgb, clamp(1.0 - pow(1.0 - c, 1.0 / sky_curve), 0.0, 1.0));
sky *= sky_energy;
if (LIGHT0_ENABLED) {
float sun_angle = acos(dot(LIGHT0_DIRECTION, EYEDIR));
if (sun_angle < LIGHT0_SIZE) {
sky = LIGHT0_COLOR * LIGHT0_ENERGY;
} else if (sun_angle < sun_angle_max) {
float c2 = (sun_angle - LIGHT0_SIZE) / (sun_angle_max - LIGHT0_SIZE);
sky = mix(LIGHT0_COLOR * LIGHT0_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
}
}
if (LIGHT1_ENABLED) {
float sun_angle = acos(dot(LIGHT1_DIRECTION, EYEDIR));
if (sun_angle < LIGHT1_SIZE) {
sky = LIGHT1_COLOR * LIGHT1_ENERGY;
} else if (sun_angle < sun_angle_max) {
float c2 = (sun_angle - LIGHT1_SIZE) / (sun_angle_max - LIGHT1_SIZE);
sky = mix(LIGHT1_COLOR * LIGHT1_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
}
}
if (LIGHT2_ENABLED) {
float sun_angle = acos(dot(LIGHT2_DIRECTION, EYEDIR));
if (sun_angle < LIGHT2_SIZE) {
sky = LIGHT2_COLOR * LIGHT2_ENERGY;
} else if (sun_angle < sun_angle_max) {
float c2 = (sun_angle - LIGHT2_SIZE) / (sun_angle_max - LIGHT2_SIZE);
sky = mix(LIGHT2_COLOR * LIGHT2_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
}
}
if (LIGHT3_ENABLED) {
float sun_angle = acos(dot(LIGHT3_DIRECTION, EYEDIR));
if (sun_angle < LIGHT3_SIZE) {
sky = LIGHT3_COLOR * LIGHT3_ENERGY;
} else if (sun_angle < sun_angle_max) {
float c2 = (sun_angle - LIGHT3_SIZE) / (sun_angle_max - LIGHT3_SIZE);
sky = mix(LIGHT3_COLOR * LIGHT3_ENERGY, sky, clamp(1.0 - pow(1.0 - c2, 1.0 / sun_curve), 0.0, 1.0));
}
}
// Sample the sky cover texture with dynamic offset (only x and y direction)
vec2 noise_coords = SKY_COORDS.xy + wind_offset_direction * wind_speed * TIME * 0.01;
// Wrap UVs to keep tiling seamless
noise_coords = mod(noise_coords, 1.0);
// Sample the original noise texture
vec4 sky_cover_texture = texture(sky_cover, noise_coords);
// Sample flipped noise for Z-offset effect
vec4 flipped_noise = texture(sky_cover, vec2(noise_coords.x, 1.0 - noise_coords.y));
// Z blending (cloud change) logic
float cloud_blend_factor = 0.0;
if (clouds_change) {
// Use a sine wave to blend clouds smoothly over time based on the cloud_change_rate
cloud_blend_factor = 0.5 + 0.5 * sin(TIME * cloud_change_rate);
}
// Blend between the original and flipped noise using cloud_blend_factor
vec4 blended_noise_texture = mix(sky_cover_texture, flipped_noise, cloud_blend_factor);
// Pole blending
float base_pole_blend_factor = abs(EYEDIR.y); // Original blend factor (circular)
float noise_pole_blend = blended_noise_texture.r * pole_blend_shape;
float pole_blend_factor = smoothstep(1.0 - pole_blend_strength, 1.0, base_pole_blend_factor + noise_pole_blend);
// Horizon blending - detect when we're near the horizon
float horizon_distance = abs(EYEDIR.y); // This will be close to 0 near the horizon
float horizon_factor = 1.0 - smoothstep(0.0, horizon_blend_width, horizon_distance);
float noise_horizon_blend = blended_noise_texture.g * horizon_blend_shape;
float horizon_blend_factor = smoothstep(1.0 - horizon_blend_strength, 1.0, horizon_factor + noise_horizon_blend);
// Combine both blend factors (poles and horizon)
float combined_blend_factor = max(pole_blend_factor, horizon_blend_factor);
// Blend noise with brightness value based on the combined factor
vec3 blended_noise = mix(blended_noise_texture.rgb, vec3(pole_blend_brightness), pole_blend_factor);
blended_noise = mix(blended_noise, vec3(horizon_blend_brightness), horizon_blend_factor);
sky += (blended_noise * sky_cover_modulate.rgb) * blended_noise_texture.a * sky_cover_modulate.a * sky_energy;
// Ground blending
c = (v_angle - (PI * 0.5)) / (PI * 0.5);
vec3 ground = mix(ground_horizon_color.rgb, ground_bottom_color.rgb, clamp(1.0 - pow(1.0 - c, 1.0 / ground_curve), 0.0, 1.0));
ground *= ground_energy;
COLOR = mix(ground, sky, step(0.0, EYEDIR.y)) * exposure;
}"
[sub_resource type="Gradient" id="Gradient_dj4cy"]
offsets = PackedFloat32Array(0.151786, 0.5625, 1)
colors = PackedColorArray(0, 0, 0, 1, 0.565217, 0.565217, 0.565217, 1, 1, 1, 1, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_ttr7n"]
noise_type = 3
domain_warp_enabled = true
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_r4es0"]
width = 1024
height = 1024
noise = SubResource("FastNoiseLite_ttr7n")
color_ramp = SubResource("Gradient_dj4cy")
seamless = true
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4gdda"]
shader = SubResource("Shader_6od8s")
shader_parameter/sky_top_color = Color(0.25262, 0.408375, 0.692798, 1)
shader_parameter/sky_horizon_color = Color(0.48476, 0.638261, 0.884351, 1)
shader_parameter/sky_curve = 0.0349887
shader_parameter/sky_energy = 1.0
shader_parameter/sky_cover = SubResource("NoiseTexture2D_r4es0")
shader_parameter/sky_cover_modulate = Color(1, 1, 1, 1)
shader_parameter/ground_bottom_color = Color(0.121409, 0.203944, 0.437026, 1)
shader_parameter/ground_horizon_color = Color(0.486275, 0.639216, 0.882353, 1)
shader_parameter/ground_curve = 0.02
shader_parameter/ground_energy = 1.0
shader_parameter/sun_angle_max = 0.523599
shader_parameter/sun_curve = 0.15
shader_parameter/exposure = 1.0
shader_parameter/wind_offset_direction = Vector2(0.5, 0.1)
shader_parameter/wind_speed = 0.0
shader_parameter/clouds_change = true
shader_parameter/cloud_change_rate = 0.4
shader_parameter/pole_blend_shape = 0.05
shader_parameter/pole_blend_strength = 0.05
shader_parameter/pole_blend_brightness = 0.3
shader_parameter/horizon_blend_shape = 0.05
shader_parameter/horizon_blend_strength = 0.05
shader_parameter/horizon_blend_brightness = 0.3
shader_parameter/horizon_blend_width = 0.1
[sub_resource type="Sky" id="Sky_t42h5"]
sky_material = SubResource("ShaderMaterial_4gdda")
[sub_resource type="Environment" id="Environment_l41d0"]
background_mode = 2
sky = SubResource("Sky_t42h5")
tonemap_mode = 4
ssao_detail = 0.0
fog_enabled = true
fog_mode = 1
fog_density = 1.0
fog_depth_begin = 50.0
fog_depth_end = 200.0
[sub_resource type="BoxShape3D" id="BoxShape3D_awjk1"]
size = Vector3(3.6270146, 6.87512, 10)
@@ -229,9 +40,6 @@ obstacles = Array[PackedScene]([ExtResource("7_6tcu8")])
metadata/_custom_type_script = "uid://cvejbo3srx8py"
metadata/_editor_floor_ = Vector3(4, -10, 8)
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1448536340]
environment = SubResource("Environment_l41d0")
[node name="EnemyGoal" type="Node3D" parent="." unique_id=1521533989 node_paths=PackedStringArray("audio_player")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40.123978, 0.5, 0)
script = ExtResource("9_s3rd7")
@@ -294,7 +102,7 @@ type = 2
dest = NodePath("../EnemyGoal")
enemy_path = NodePath("../Enemies")
[node name="CardPrinter" parent="." unique_id=99304729 instance=ExtResource("9_r25gu")]
[node name="CardPrinter" parent="." unique_id=459800869 instance=ExtResource("9_r25gu")]
transform = Transform3D(-0.999501, 0, 0.0315681, 0, 1, 0, -0.0315681, 0, -0.999501, 33.0068, 0.499996, 17.3317)
[node name="PlayerSpawnLocations" type="Node3D" parent="." unique_id=1727305710]