Integrate hand gateway and spatial force rendering

This commit is contained in:
lenn
2026-06-29 18:55:42 +08:00
parent f30ebcf20b
commit d4f160af75
14 changed files with 1041 additions and 98 deletions

View File

@@ -497,13 +497,13 @@ fn fs_hand_dot(in: DotVertexOutput) -> @location(0) vec4f {
// Use a compact bead so the response feels like it lives on the membrane mesh.
let core = circle_alpha(in.local, 0.48, 0.07);
let halo = circle_alpha(in.local, 0.74, 0.14) * 0.12;
let halo = circle_alpha(in.local, 0.74, 0.14) * (0.10 + intensity * 0.26);
// Keep the fingertip matrix visually close to JE-Skin's cyan model dots,
// while still letting pressure brighten the bead a little.
let cyan = vec3f(0.34, 0.86, 1.0);
let hot = sample_range_color(intensity);
let color = mix(cyan, hot, 0.22) * mix(0.82, 1.16, intensity);
// Match Finger mode's pressure gradient so each hand region remains readable.
let idle = vec3f(0.060, 0.250, 0.320);
let gradient = sample_range_color(intensity);
let color = mix(idle, gradient, smoothstep(0.0, 0.18, intensity))
* mix(0.78, 1.18, intensity);
return output_color(color, max(core, halo));
}
@@ -590,13 +590,13 @@ fn vs_hand_palm_dot(vertex: DotVertexInput, instance: DotInstanceInput) -> DotVe
fn fs_hand_palm_dot(in: DotVertexOutput) -> @location(0) vec4f {
let intensity = saturate(in.intensity);
let pixel = chip_pixel_alpha(in.local, 0.52, 0.070);
let glow = circle_alpha(in.local, 0.95, 0.22) * intensity * 0.30;
let glow = circle_alpha(in.local, 0.95, 0.22) * intensity * 0.36;
let cold = vec3f(0.070, 0.340, 0.360);
let active_color = mix(vec3f(0.110, 0.620, 0.420), vec3f(0.460, 1.000, 0.210), smoothstep(0.08, 1.0, intensity));
let color = mix(cold, active_color, smoothstep(0.02, 0.72, intensity))
* (0.54 + intensity * 1.10)
+ vec3f(0.28, 1.0, 0.36) * glow * 0.90;
let gradient = sample_range_color(intensity);
let color = mix(cold, gradient, smoothstep(0.0, 0.20, intensity))
* (0.58 + intensity * 1.04)
+ gradient * glow * 0.72;
let alpha = max(pixel * (0.20 + intensity * 0.76), glow);
return output_color(color, alpha);