Add gathering, unified inventory, and real-time world

This commit is contained in:
Alexander Sellite 2026-08-18 18:19:36 -04:00
parent 173371e6fc
commit fa57edca83
113 changed files with 6700 additions and 1307 deletions

View file

@ -26,6 +26,65 @@ uniform float moon_edge_softness : hint_range(0.001, 0.03) = 0.003;
uniform float moon_halo_radius : hint_range(0.02, 0.35) = 0.11;
uniform float moon_halo_strength : hint_range(0.0, 1.0) = 0.12;
uniform vec4 star_color : source_color = vec4(0.72, 0.82, 0.96, 1.0);
uniform float star_visibility : hint_range(0.0, 1.0) = 0.0;
uniform float star_strength : hint_range(0.0, 1.0) = 0.72;
float star_hash(vec2 point) {
vec3 value = fract(vec3(point.xyx) * vec3(0.1031, 0.1030, 0.0973));
value += dot(value, value.yzx + 33.33);
return fract((value.x + value.y) * value.z);
}
vec2 star_hash2(vec2 point) {
return vec2(
star_hash(point),
star_hash(point + vec2(19.19, 7.73))
);
}
float procedural_star_field(vec3 view_direction) {
// Map the upper hemisphere to one stable world-direction diamond. This
// avoids a longitude seam and keeps the stars fixed as the camera moves.
float direction_sum = max(
abs(view_direction.x)
+ abs(view_direction.y)
+ abs(view_direction.z),
0.0001
);
vec2 star_uv = view_direction.xz / direction_sum * 0.5 + 0.5;
vec2 star_point = star_uv * 190.0;
vec2 cell = floor(star_point);
vec2 local_point = fract(star_point);
float spawn_roll = star_hash(cell + vec2(3.17, 11.83));
vec2 point_center = mix(
vec2(0.18),
vec2(0.82),
star_hash2(cell + vec2(41.0, 73.0))
);
float point_radius = mix(
0.065,
0.13,
star_hash(cell + vec2(89.0, 17.0))
);
float point_shape = 1.0 - smoothstep(
point_radius,
point_radius + 0.045,
distance(local_point, point_center)
);
float point_exists = step(0.965, spawn_roll);
float point_brightness = mix(
0.42,
1.0,
smoothstep(0.965, 1.0, spawn_roll)
);
float upper_sky_fade = smoothstep(0.055, 0.22, view_direction.y);
return point_shape * point_exists * point_brightness * upper_sky_fade;
}
void sky() {
vec3 view_direction = normalize(EYEDIR);
@ -50,6 +109,12 @@ void sky() {
view_direction.y
)
);
float stars = procedural_star_field(view_direction);
base_color = mix(
base_color,
star_color.rgb,
stars * star_visibility * star_strength
);
float alignment = dot(view_direction, normalize(sun_direction));
float disc_outer = cos(sun_radius + sun_edge_softness);

View file

@ -31,6 +31,9 @@ shader_parameter/moon_radius = 0.045
shader_parameter/moon_edge_softness = 0.003
shader_parameter/moon_halo_radius = 0.11
shader_parameter/moon_halo_strength = 0.12
shader_parameter/star_color = Color(0.72, 0.82, 0.96, 1)
shader_parameter/star_visibility = 0.0
shader_parameter/star_strength = 0.72
[resource]
sky_material = SubResource("ShaderMaterial_netfishing")