M2.5: ShaderMaterial + texture resolution + fog; multi-skeleton verified
- m2_material: Metin2-style ShaderMaterial. blend_mix shader (opaque /
alpha-blend / alpha-test-cutout via `mode` uniform) + blend_add shader
(additive glow). modulate(tex, COORD) * COLOR, diffuse_lambert.
- Metin2Model: material_mode prop ("metin2" ShaderMaterial | "standard");
_resolve_texture does filename-convention + case-insensitive dir scan of
*.dds (face/hair keyword slots, stem match, fallback); set_surface_texture
override; guess_blend heuristic (hair->cutout, cape->alpha, effect->add).
Texture cache. Fixed opaque path to NOT alpha-discard (was hiding bodies).
- harness: AABB-based camera framing, engine depth fog (MTGODOT_FOG=1),
MTGODOT_ANIM_T fixed-pose capture (needs explicit anim reload first),
MTGODOT_AUTOSHOT batch screenshot.
Verified: warrior 5/5 surfaces textured under the shader (t=9 dance pose,
lit, fogged). assassin 17/17 textured via dir scan. shaman_lord (gr2 v7)
renders. Screenshots test/golden/m25-*.png, m2c-t*.png.
Gap (M2.5 gate not closed): libgr2 POD API exposes no material/texture-name/
blend data, so multi-slot -> texture/blend mapping is heuristic only. Needs
a libgr2 material API (gr2_material.cpp walking the type tree) — same gap as
xrender-poc M1 T5. Documented in docs/GODOT-POC-PLAN.md §M2.5 T2.5.6.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ
This commit is contained in:
+16
-5
@@ -56,6 +56,15 @@ func _build_environment() -> void:
|
||||
env.ambient_light_source = Environment.AMBIENT_SOURCE_SKY
|
||||
env.ambient_light_energy = 0.6
|
||||
env.tonemap_mode = Environment.TONE_MAPPER_FILMIC
|
||||
# T2.5.4 — distance fog via the engine (not per-shader).
|
||||
if OS.get_environment("MTGODOT_FOG") == "1":
|
||||
env.fog_enabled = true
|
||||
env.fog_mode = Environment.FOG_MODE_DEPTH
|
||||
env.fog_light_color = Color(0.55, 0.55, 0.62)
|
||||
env.fog_sun_scatter = 0.1
|
||||
env.fog_density = 0.0
|
||||
env.fog_depth_begin = 3.0
|
||||
env.fog_depth_end = 12.0
|
||||
we.environment = env
|
||||
add_child(we)
|
||||
|
||||
@@ -121,13 +130,15 @@ func _load_content() -> void:
|
||||
|
||||
|
||||
func _frame_model() -> void:
|
||||
# Use the model's converted world-space AABB to place the orbit target/dist.
|
||||
# Place the orbit target/dist from the model's converted world-space AABB.
|
||||
var mi := _model.get_node_or_null("MeshInstance3D") if _model else null
|
||||
if mi and mi is VisualInstance3D:
|
||||
var aabb: AABB = (mi as VisualInstance3D).get_aabb()
|
||||
aabb = _model.transform * aabb
|
||||
_target = aabb.get_center()
|
||||
_dist = maxf(1.0, aabb.get_longest_axis_size() * 1.8)
|
||||
var aabb: AABB = _model.transform * (mi as VisualInstance3D).get_aabb()
|
||||
var h := maxf(aabb.size.y, 0.5)
|
||||
_target = Vector3(aabb.get_center().x, aabb.position.y + h * 0.5, aabb.get_center().z)
|
||||
_dist = h * 3.2
|
||||
_pitch = 0.12
|
||||
print("[mtgodot] frame: aabb=", aabb, " target=", _target, " dist=", _dist)
|
||||
_update_camera()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user