diff --git a/Demon_v0.19/apparatus_motion.gd b/Demon_v0.19/apparatus_motion.gd index 1484a51..af2ef90 100644 --- a/Demon_v0.19/apparatus_motion.gd +++ b/Demon_v0.19/apparatus_motion.gd @@ -45,8 +45,10 @@ func setup(game,development): for c in n.get_children():queue.append(c) if n is MeshInstance3D and n!=d.flame: if d.device.get_meta("apparatus_model","")=="iron_maiden_v01": - var glow=ShaderMaterial.new();glow.shader=preload("res://maiden_heat.gdshader") - n.material_overlay=glow;heat_materials.append(glow) + for surface in range(n.mesh.get_surface_count()): + var original=n.get_active_material(surface) + var glow=preload("res://maiden_material.gd").make(original,d.device.global_position.y) + n.set_surface_override_material(surface,glow);heat_materials.append(glow) continue var mat=ShaderMaterial.new();mat.shader=preload("res://forged.gdshader") if n.material_override is StandardMaterial3D:mat.set_shader_parameter("tint",n.material_override.albedo_color) @@ -87,4 +89,7 @@ func update(dt,active): if d.release_clock>0:target=heat heat=move_toward(heat,target,dt*(1.5 if target>heat else 0.3)) for mat in heat_materials:mat.set_shader_parameter("heat",heat) - heat_light.light_energy=heat*0.9 + if d.device.get_meta("apparatus_model","")=="iron_maiden_v01": + heat_light.light_color=Color("ff2510").lerp(Color("ffad48"),smoothstep(.55,1.0,heat)) + heat_light.light_energy=pow(heat,1.5)*3.2 + else:heat_light.light_energy=heat*0.9 diff --git a/Demon_v0.19/iron_maiden.gd b/Demon_v0.19/iron_maiden.gd index 544e874..8634858 100644 --- a/Demon_v0.19/iron_maiden.gd +++ b/Demon_v0.19/iron_maiden.gd @@ -8,6 +8,7 @@ func build(g,d): d.door=model.find_child("LeftDoor",true,false) d.second_door=model.find_child("RightDoor",true,false) assert(d.door!=null and d.second_door!=null,"Iron maiden requires two independent hinge nodes") + preload("res://maiden_interior.gd").new().build(g,model,d.door,d.second_door) d.door.rotation.y=-1.8;d.second_door.rotation.y=1.8 d.flame=g.ball(root,Vector3(0,.20,0),Vector3(1.15,.25,.85),Color("ff8735")) d.flame.material_override=g.mat(Color("ff8735"),true);d.flame.hide() diff --git a/Demon_v0.19/iron_maiden_tests.gd b/Demon_v0.19/iron_maiden_tests.gd index 46f44c7..2118e94 100644 --- a/Demon_v0.19/iron_maiden_tests.gd +++ b/Demon_v0.19/iron_maiden_tests.gd @@ -16,6 +16,8 @@ func run(g): check(d.device.get_meta("apparatus_model","")=="iron_maiden_v01","Meshy model selected") check(d.door!=d.second_door and d.door.get_child_count()>0 and d.second_door.get_child_count()>0,"independent populated doors") check(d.door.position.x<0 and d.second_door.position.x>0,"opposite side hinges") + check(d.door.find_child("InnerLeftDetail",true,false)!=null and d.second_door.find_child("InnerRightDetail",true,false)!=null,"interior trim follows both moving doors") + check(d.device.find_child("InnerBackDetail",true,false)!=null and d.device.find_child("InnerGrate",true,false)!=null,"reinforced back and solid grated floor") var surfaces=d.device.find_children("*","MeshInstance3D",true,false) var textured=0 for mesh in surfaces: @@ -24,8 +26,13 @@ func run(g): var mat=mesh.mesh.surface_get_material(i) if mat is StandardMaterial3D and mat.albedo_texture!=null:textured+=1 check(mesh.material_override==null,"original surface material preserved") - check(mesh.material_overlay is ShaderMaterial,"independent heat overlay") + for i in range(mesh.mesh.get_surface_count()): + check(mesh.get_surface_override_material(i) is ShaderMaterial,"PBR-preserving incandescence material") check(textured>0,"Meshy textures present") + var outer=d.device.find_child("Body",true,false).get_active_material(0) + var inner=d.device.find_child("BodyLining",true,false).get_active_material(0) + for map_name in ["color_map","metal_map","rough_map","normal_map"]: + check(outer.get_shader_parameter(map_name)==inner.get_shader_parameter(map_name),"inner and outer share original PBR "+map_name) g.camera.position=Vector3(5.8,3.5,3);g.camera.look_at(d.device.position+Vector3(0,1.5,0));g.camera.size=4.5 await shot(g,"open") for k in range(19): @@ -37,9 +44,12 @@ func run(g): # Exercise the actual station state machine and heat without replacing PBR. w.unlock=3;g.uid=0;w.spawn();var s=g.souls.back();s.required=[3];s.entering=false;s.entry_time=1 g.set_soul_reveal(s.visual,1);w.attach(s,0);w.step_station(d,.9,false) - for k in range(35):w.step_station(d,.1,true) + for k in range(16):w.step_station(d,.1,true) + check(d.motion.heat>.3 and d.motion.heat<.6,"progressive red stage") + await shot(g,"warming") + for k in range(19):w.step_station(d,.1,true) check(d.stage==1,"station advances through closure into heat") - check(d.motion.heat>0,"heat advances") + check(d.motion.heat>.94 and d.motion.heat_light.light_energy>2.8,"full incandescence with reflected light") await shot(g,"heated") for k in range(100): w.step_station(d,.1,true) @@ -47,5 +57,8 @@ func run(g): check(d.soul<0 and g.done==1,"completion releases soul and rewards once") for k in range(40):w.step_station(d,.1,false) check(is_equal_approx(d.door.rotation.y,-1.8) and is_equal_approx(d.second_door.rotation.y,1.8),"doors reopen after cooldown") + for k in range(25):w.step_station(d,.1,false) + check(d.motion.heat<.01 and d.motion.heat_light.light_energy<.01,"incandescence cools back to original metal") + await shot(g,"cooled") print("IRON MAIDEN QA ","PASSED" if failures==0 else "FAILED",": textured model, hinges, sweep, close/heat/reward/reopen") g.get_tree().quit(1 if failures else 0) diff --git a/Demon_v0.19/maiden_heat.gdshader b/Demon_v0.19/maiden_heat.gdshader index 5dcc4ce..8f0cf6f 100644 --- a/Demon_v0.19/maiden_heat.gdshader +++ b/Demon_v0.19/maiden_heat.gdshader @@ -1,10 +1,40 @@ shader_type spatial; -render_mode blend_add, depth_draw_never, unshaded, shadows_disabled; +render_mode cull_disabled; uniform float heat=0.0; +uniform float base_height=0.0; +uniform vec4 base_color:source_color=vec4(1.0); +uniform sampler2D color_map:source_color,hint_default_white,filter_linear_mipmap_anisotropic; +uniform sampler2D metal_map:hint_default_white,filter_linear_mipmap_anisotropic; +uniform sampler2D rough_map:hint_default_white,filter_linear_mipmap_anisotropic; +uniform sampler2D normal_map:hint_normal,filter_linear_mipmap_anisotropic; +uniform float metal_value=1.0; +uniform float rough_value=1.0; +uniform float normal_strength=1.0; +uniform bool use_normal=false; +uniform int metal_channel=2; +uniform int rough_channel=1; +uniform vec2 uv_scale=vec2(1.0); +uniform vec2 uv_offset=vec2(0.0); +uniform bool tile_region=false; +uniform vec2 atlas_origin=vec2(0.0); +uniform vec2 atlas_size=vec2(1.0); varying float model_height; -void vertex(){ model_height=VERTEX.y; } -void fragment(){ - float warmth=heat*(.35+.65*(1.0-smoothstep(0.0,2.8,model_height))); - ALBEDO=vec3(1.0,.07,.003)*warmth*warmth*.22; - ALPHA=heat*.45; +void vertex(){ model_height=(MODEL_MATRIX*vec4(VERTEX,1.0)).y-base_height; } +float channel_value(vec4 color,int channel){ + if(channel==4){return dot(color.rgb,vec3(.333333));} + return color[channel]; +} +void fragment(){ + vec2 uv=UV*uv_scale+uv_offset; + if(tile_region){uv=atlas_origin+fract(uv*vec2(4.0,7.0))*atlas_size;} + vec3 original=base_color.rgb*texture(color_map,uv).rgb; + float warmth=clamp(heat*1.10-smoothstep(.2,3.1,model_height)*.08,0.0,1.0)*smoothstep(.18,.35,model_height); + vec3 hot=mix(vec3(.75,.002,.001),vec3(1.0,.10,.003),smoothstep(.25,.80,warmth)); + hot=mix(hot,vec3(1.0,.44,.045),smoothstep(.82,1.0,warmth)*.65); + ALBEDO=mix(original,hot*.35,smoothstep(.35,1.0,warmth)*.45); + METALLIC=metal_value*channel_value(texture(metal_map,uv),metal_channel); + ROUGHNESS=clamp(rough_value*channel_value(texture(rough_map,uv),rough_channel),.1,1.0); + if(use_normal){NORMAL_MAP=texture(normal_map,uv).rgb;NORMAL_MAP_DEPTH=normal_strength;} + float texture_relief=.45+.55*clamp(dot(original,vec3(.333333))*3.5,0.0,1.0); + EMISSION=hot*pow(warmth,1.8)*1.4*texture_relief; } diff --git a/Demon_v0.19/maiden_interior.gd b/Demon_v0.19/maiden_interior.gd new file mode 100644 index 0000000..a8336e5 --- /dev/null +++ b/Demon_v0.19/maiden_interior.gd @@ -0,0 +1,96 @@ +extends RefCounted +# Local construction follows the existing lining; each door's details share its hinge. +const PROFILE=[Vector3(.25,.73,.54),Vector3(.5,.75,.56),Vector3(1,.75,.56),Vector3(1.7,.75,.56),Vector3(2.15,.72,.54),Vector3(2.35,.55,.40),Vector3(2.43,.35,.25)] +const IRON=Color("34343a") +const BRASS=Color("8b6842") +const DARK=Color("14171c") +var g +var outer_metal +# Regions of the existing Meshy atlas: bare iron and aged brass, with matching PBR maps. +const IRON_REGION=Vector4(.41015625,.1875,.0234375,.0234375) +const BRASS_REGION=Vector4(.6796875,.5859375,.0234375,.0234375) +func metal(brass=false): + var material=outer_metal.duplicate() + material.set_meta("atlas_region",BRASS_REGION if brass else IRON_REGION) + material.albedo_color=Color.WHITE + return material +func line_lining(model): + for node in model.find_children("*Lining","MeshInstance3D",true,false): + var mesh=ArrayMesh.new();var transform=model.global_transform.affine_inverse()*node.global_transform + for surface in range(node.mesh.get_surface_count()): + var arrays=node.mesh.surface_get_arrays(surface);var uv=PackedVector2Array() + for vertex in arrays[Mesh.ARRAY_VERTEX]: + var p=transform*vertex + uv.append(Vector2(fposmod(atan2(-p.z,p.x),TAU)/TAU,p.y/2.4)) + arrays[Mesh.ARRAY_TEX_UV]=uv + mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES,arrays) + mesh.surface_set_material(surface,metal()) + node.mesh=mesh +func point(height,angle,inset=.012): + var shape=PROFILE[0] + for j in range(PROFILE.size()-1): + if height<=PROFILE[j+1].x: + shape=PROFILE[j].lerp(PROFILE[j+1],inverse_lerp(PROFILE[j].x,PROFILE[j+1].x,height));break + return Vector3(cos(angle)*(shape.y*.86-inset),height,-sin(angle)*(shape.z*.70-inset)) +func arc(root,height,a,b,radius,color,inset=.012): + for k in range(20):g.line(root,point(height,lerpf(a,b,float(k)/20),inset),point(height,lerpf(a,b,float(k+1)/20),inset),radius,color) +func section(parent,origin,a,b,title): + var root=Node3D.new();parent.add_child(root);root.name=title;root.position=-origin + # Raised steel perimeter, inset brass seams and small round rivets. + for h in [.31,.76,1.28,1.80,2.16]: + arc(root,h,a+.035,b-.035,.013,IRON) + arc(root,h+.027,a+.06,b-.06,.006,BRASS,.018) + for k in range(7):g.ball(root,point(h,lerpf(a+.08,b-.08,float(k)/6),.027),Vector3.ONE*.035,BRASS) + for k in range(1,5): + var angle=lerpf(a,b,float(k)/5) + for j in range(12): + var h=.32+j*.151 + g.line(root,point(h,angle,.025),point(h+.151,angle,.025),.010,IRON) + # Shallow embossed diamonds on each panel; decoration stays close to the lining. + for h in [1.02,1.55,2.00]: + var angle=(a+b)*.5;var spread=(b-a)*.13 + var corners=[point(h+.11,angle,.035),point(h,angle+spread,.035),point(h-.11,angle,.035),point(h,angle-spread,.035)] + for k in range(4):g.line(root,corners[k],corners[(k+1)%4],.008,BRASS) + g.ball(root,point(h,angle,.039),Vector3.ONE*.043,BRASS) + for side in [-1,1]: + for k in range(24): + var u=float(k)/24;var v=float(k+1)/24 + var t=u*TAU*1.25;var next=v*TAU*1.25 + var radius=.115*(1-u)+.018;var next_radius=.115*(1-v)+.018 + var p=point(h+sin(t)*radius,angle+side*(spread*.62+cos(t)*radius*spread/.13),.045) + var q=point(h+sin(next)*next_radius,angle+side*(spread*.62+cos(next)*next_radius*spread/.13),.045) + g.line(root,p,q,.007,BRASS) + merge(root) + return root +func merge(root): + # Batch fixed decorations by metal, separately for the body and each moving leaf. + var batches={} + for node in root.get_children(): + if not node is MeshInstance3D:continue + var key=node.material_override.albedo_color.to_html() + if not batches.has(key): + var tool=SurfaceTool.new();tool.begin(Mesh.PRIMITIVE_TRIANGLES) + batches[key]={"tool":tool,"color":node.material_override.albedo_color} + batches[key].tool.append_from(node.mesh,0,node.transform) + node.free() + for key in batches: + var mesh=batches[key].tool.commit();var mat=metal(batches[key].color==BRASS) + mesh.surface_set_material(0,mat) + var node=MeshInstance3D.new();node.mesh=mesh;root.add_child(node) +func build(game,model,left,right): + g=game + outer_metal=model.find_child("Body",true,false).mesh.surface_get_material(0) + line_lining(model) + section(model,Vector3.ZERO,0,PI,"InnerBackDetail") + section(left,left.position,PI,PI*1.5,"InnerLeftDetail") + section(right,right.position,PI*1.5,TAU,"InnerRightDetail") + var floor_root=Node3D.new();model.add_child(floor_root);floor_root.name="InnerGrate" + var plate=g.cylinder(floor_root,Vector3(0,.24,0),.61,.035,DARK);plate.scale.z=.61 + for j in range(-7,8): + var x=j*.072;var reach=sqrt(maxf(0,1-pow(x/.58,2)))*.34 + g.box(floor_root,Vector3(x,.268,0),Vector3(.026,.027,reach*2),IRON) + for z in [-.23,0,.23]:g.box(floor_root,Vector3(0,.259,z),Vector3(1.02,.018,.022),BRASS) + merge(floor_root) + var bounce=OmniLight3D.new();model.add_child(bounce);bounce.name="InteriorBounce" + bounce.position=Vector3(0,1.35,.06);bounce.omni_range=1.65;bounce.light_color=Color("d7ae7d");bounce.light_energy=.32 + model.set_meta("interior_detail",true) diff --git a/Demon_v0.19/maiden_material.gd b/Demon_v0.19/maiden_material.gd new file mode 100644 index 0000000..517eacf --- /dev/null +++ b/Demon_v0.19/maiden_material.gd @@ -0,0 +1,24 @@ +extends RefCounted +static func make(original,base_height): + var material=ShaderMaterial.new();material.shader=preload("res://maiden_heat.gdshader") + material.set_shader_parameter("base_height",base_height) + if original is StandardMaterial3D: + material.set_shader_parameter("base_color",original.albedo_color) + material.set_shader_parameter("metal_value",original.metallic) + material.set_shader_parameter("rough_value",original.roughness) + material.set_shader_parameter("metal_channel",original.metallic_texture_channel) + material.set_shader_parameter("rough_channel",original.roughness_texture_channel) + material.set_shader_parameter("uv_scale",Vector2(original.uv1_scale.x,original.uv1_scale.y)) + material.set_shader_parameter("uv_offset",Vector2(original.uv1_offset.x,original.uv1_offset.y)) + if original.has_meta("atlas_region"): + var region=original.get_meta("atlas_region") + material.set_shader_parameter("atlas_origin",Vector2(region.x,region.y)) + material.set_shader_parameter("atlas_size",Vector2(region.z,region.w)) + material.set_shader_parameter("tile_region",true) + for pair in [["color_map",original.albedo_texture],["metal_map",original.metallic_texture],["rough_map",original.roughness_texture]]: + if pair[1]!=null:material.set_shader_parameter(pair[0],pair[1]) + if original.normal_enabled and original.normal_texture: + material.set_shader_parameter("normal_map",original.normal_texture) + material.set_shader_parameter("normal_strength",original.normal_scale) + material.set_shader_parameter("use_normal",true) + return material diff --git a/Demon_v0.19/reviews/iron_maiden_v02/.gdignore b/Demon_v0.19/reviews/iron_maiden_v02/.gdignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Demon_v0.19/reviews/iron_maiden_v02/.gdignore @@ -0,0 +1 @@ + diff --git a/Demon_v0.19/reviews/iron_maiden_v02/README.md b/Demon_v0.19/reviews/iron_maiden_v02/README.md new file mode 100644 index 0000000..9df10c2 --- /dev/null +++ b/Demon_v0.19/reviews/iron_maiden_v02/README.md @@ -0,0 +1,16 @@ +# Iron maiden: interior and incandescence + +Actual Godot 4.3 captures, 2026-10-28: open interior, intermediate red heat, +and maximum incandescence. `preview.png` combines those three stages. + +Interior geometry is built by `maiden_interior.gd` on the existing Meshy prop. +Its plates and scrollwork reuse the exterior's original color, normal, +metallic and roughness maps. Only the sampled atlas regions and UVs differ. +The moving decorations are children of their corresponding door hinge. + +`maiden_material.gd` transfers PBR inputs into `maiden_heat.gdshader`, where +heat adds emission and slightly tints the albedo, then cools to the original +material. The stone plinth is masked from incandescence. No new Meshy request. + +Validation: `--test-iron-maiden` and `--test-single-punishment` pass. +These captures show the source project; the previous Windows EXE predates them. diff --git a/Demon_v0.19/reviews/iron_maiden_v02/heated.png b/Demon_v0.19/reviews/iron_maiden_v02/heated.png new file mode 100644 index 0000000..faa9d74 Binary files /dev/null and b/Demon_v0.19/reviews/iron_maiden_v02/heated.png differ diff --git a/Demon_v0.19/reviews/iron_maiden_v02/open.png b/Demon_v0.19/reviews/iron_maiden_v02/open.png new file mode 100644 index 0000000..9a6c175 Binary files /dev/null and b/Demon_v0.19/reviews/iron_maiden_v02/open.png differ diff --git a/Demon_v0.19/reviews/iron_maiden_v02/preview.png b/Demon_v0.19/reviews/iron_maiden_v02/preview.png new file mode 100644 index 0000000..871fe51 Binary files /dev/null and b/Demon_v0.19/reviews/iron_maiden_v02/preview.png differ diff --git a/Demon_v0.19/reviews/iron_maiden_v02/warming.png b/Demon_v0.19/reviews/iron_maiden_v02/warming.png new file mode 100644 index 0000000..606f51d Binary files /dev/null and b/Demon_v0.19/reviews/iron_maiden_v02/warming.png differ diff --git a/HANDOFF.md b/HANDOFF.md index 1c872c3..656fe1c 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -15,6 +15,26 @@ ## Последние выполненные задачи +- **Внутренняя отделка и накал девы (2026-10-28):** `maiden_interior.gd` + добавляет усилительные рёбра, клёпаные пояса, парные завитки/вензеля, + медальоны и решётчатый пол. Декор створок привязан к существующим петлям; + неподвижные детали объединены по металлу отдельно для каждой части. + Внутренние панели и декор используют исходные PBR-карты Meshy снаружи: + цвет, normal, metallic и roughness, с UV на участки железа/латуни атласа. + Добавлена мягкая внутренняя подсветка, чтобы отделка читалась в цехе. +- `maiden_material.gd` сохраняет исходные карты и параметры металла в + едином PBR-шейдере `maiden_heat.gdshader`. Накал усиливается от красного + до яркого оранжево-жёлтого, с сохранением рельефа, отражённым светом и + плавным остыванием. Высота считается в мировых координатах относительно + станции: локальные оси импортированной GLB отличаются от осей Godot. + Новый шейдер заменяет прежний слабо видимый material_overlay. +- Проверки: импорт Godot 4.3 PASS; `--test-iron-maiden` PASS (общие PBR-карты + внутри/снаружи, привязка декора к обеим створкам, красная стадия, полный + накал, свет, закрытие/награда/открытие/остывание). `--test-single-punishment` + PASS для шести устройств и двух полов душ. Просмотрены открытый вид и + стадии нагрева; кадры сохранены в `reviews/iron_maiden_v02/`. + Эти правки в исходниках; новый EXE в этой задаче не заказывался и не собран. + - **Windows-билд для просмотра новой девы (2026-10-28):** собран из общего актуального checkout, включая Meshy-суккубу и исправленную железную деву. EXE: `Demon_v0.19_Windows_maiden_20261028/Demon.exe` (локальный артефакт).