Fill the room with dense animated knee-high fog
This commit is contained in:
@@ -47,7 +47,7 @@ func run(g):
|
||||
var angle=s.visual.rotation.y
|
||||
w.sentences.follow_carrier(s,Vector3(2,0,2),Vector3.RIGHT,.02)
|
||||
check(absf(angle_difference(s.visual.rotation.y,angle))>.001 and absf(angle_difference(s.visual.rotation.y,angle))<.25,"turn toward carrier is gradual")
|
||||
check(is_equal_approx(g.architecture.growth.smog.material.density,.010),"smog increased by 25 percent")
|
||||
check(is_equal_approx(g.architecture.growth.smog.material.get_shader_parameter("surface_height"),.78),"dense floor fog stays at knee height")
|
||||
w.attach(s,0);var effect=d.transfer
|
||||
# A dissolved snapshot must hide even zero-valued dither pixels.
|
||||
w.step_station(d,.22,false);check(not effect.snapshot.visible,"dissolved source hidden")
|
||||
|
||||
@@ -128,6 +128,9 @@ func flush():
|
||||
node.cast_shadow=GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
|
||||
|
||||
func update(camera):
|
||||
if is_instance_valid(growth.smog):
|
||||
growth.smog.material.set_shader_parameter("player_position",g.player.position)
|
||||
growth.smog.material.set_shader_parameter("fog_time",g.time)
|
||||
# Cut away near-side upper walls, so 360-degree orbit cannot hide the work bay.
|
||||
for n in walls:
|
||||
if not is_instance_valid(n):continue
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
shader_type fog;
|
||||
|
||||
uniform float density = 1.3;
|
||||
uniform float surface_height = 0.78;
|
||||
uniform vec3 player_position = vec3(0.0);
|
||||
uniform float fog_time = 0.0;
|
||||
|
||||
float hash(vec2 p) {
|
||||
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
||||
}
|
||||
|
||||
float noise(vec2 p) {
|
||||
vec2 cell = floor(p);
|
||||
vec2 f = fract(p);
|
||||
f = f * f * (3.0 - 2.0 * f);
|
||||
return mix(mix(hash(cell), hash(cell + vec2(1.0, 0.0)), f.x),
|
||||
mix(hash(cell + vec2(0.0, 1.0)), hash(cell + vec2(1.0)), f.x), f.y);
|
||||
}
|
||||
|
||||
void fog() {
|
||||
vec2 p = WORLD_POSITION.xz;
|
||||
float billow = noise(p * 0.9 + vec2(fog_time * 0.12, -fog_time * 0.08));
|
||||
float detail = noise(p * 2.1 + vec2(-fog_time * 0.09, fog_time * 0.15));
|
||||
float top = surface_height + (billow - 0.5) * 0.22;
|
||||
float layer = 1.0 - smoothstep(top - 0.23, top + 0.10, WORLD_POSITION.y);
|
||||
vec2 edge_distance = (vec2(0.5) - abs(UVW.xz - vec2(0.5))) * SIZE.xz;
|
||||
float border = smoothstep(0.0, 0.5, min(edge_distance.x, edge_distance.y));
|
||||
// A small moving opening makes the heroine's legs part the low clouds.
|
||||
float wake = smoothstep(0.2, 0.75, distance(p, player_position.xz));
|
||||
DENSITY = density * layer * border * mix(0.6, 1.25, billow * 0.7 + detail * 0.3)
|
||||
* mix(0.45, 1.0, wake);
|
||||
ALBEDO = vec3(0.66, 0.70, 0.69);
|
||||
EMISSION = vec3(0.045, 0.052, 0.051) * layer;
|
||||
}
|
||||
@@ -12,7 +12,7 @@ static func neighbour_x(gx):return gx*22.0+(NEIGHBOUR_SHIFT if gx>0 else 0.0)
|
||||
func setup(game):
|
||||
g=game
|
||||
smog=FogVolume.new();smog.name="LightHellSmog";smog.shape=RenderingServer.FOG_VOLUME_SHAPE_BOX;g.add_child(smog)
|
||||
var fog=FogMaterial.new();fog.density=.018;fog.albedo=Color("989d99");fog.height_falloff=.35;fog.edge_fade=.3;smog.material=fog
|
||||
var fog=ShaderMaterial.new();fog.shader=preload("res://knee_fog.gdshader");smog.material=fog
|
||||
for node in g.get_children():
|
||||
if node.has_meta("right_wall_dressing"):wall_dressing.append(node)
|
||||
set_level(0)
|
||||
@@ -23,7 +23,7 @@ func set_level(rank):
|
||||
for node in wall_dressing:
|
||||
for record in node.get_meta("right_wall_dressing"):
|
||||
var tr=record.transform;tr.origin.x+=delta;node.multimesh.set_instance_transform(record.index,tr)
|
||||
smog.position=Vector3((BASE_RIGHT+delta-8.05)/2,1.45,0);smog.size=Vector3(BASE_RIGHT+delta+8.3,3.4,13.3)
|
||||
smog.position=Vector3((BASE_RIGHT+delta-8.05)/2,.45,0);smog.size=Vector3(BASE_RIGHT+delta+8.3,1.3,13.3)
|
||||
if is_instance_valid(extension):extension.free()
|
||||
extension=Node3D.new();extension.name="PurchasedRoomExtension";g.add_child(extension)
|
||||
if delta>0:
|
||||
|
||||
@@ -56,7 +56,7 @@ func run(g):
|
||||
else:check(w.purchase_expansion(),"buy expansion %d"%i)
|
||||
check(is_equal_approx(w.build_area().x,width*1.2),"each purchase adds twenty percent of current area");width=w.build_area().x
|
||||
check(g.coins==0 and w.expansion_level==3 and not w.purchase_expansion(),"three purchases cost 1500, fourth rejected")
|
||||
check(g.architecture.growth.smog.size.x>28 and g.architecture.growth.smog.material.density<.015,"light smog covers entire expanded room")
|
||||
check(g.architecture.growth.smog.size.x>28 and g.architecture.growth.smog.size.y<1.5,"knee-high fog covers entire expanded room")
|
||||
check(w.valid_position(Vector3(16,0,0),0),"construction allowed in new right-hand area")
|
||||
check(preload("res://room_growth.gd").neighbour_x(1)-7.9-g.architecture.growth.right_edge()>4,"full growth leaves over four metres clear of neighbouring floor")
|
||||
d=w.add_station(0,Vector3(16,0,0));w.rebuild_nav();check(w.accessible(),"helper navigation reaches expanded area")
|
||||
|
||||
Reference in New Issue
Block a user