diff --git a/JotunnModStub/Dvergar/DvergarConfig.cs b/JotunnModStub/Dvergar/DvergarConfig.cs index 6078c2d..0498cd9 100644 --- a/JotunnModStub/Dvergar/DvergarConfig.cs +++ b/JotunnModStub/Dvergar/DvergarConfig.cs @@ -95,9 +95,13 @@ namespace RacesOfValheim // reference and is not: it is where the camera goes, half a metre above the head bone, // and starting from it put the eyes in the treetops. That was measured, not guessed - // the trace is in the commit history. + // These are pre-scale numbers: a Dvergar renders at 0.78, so 0.140 forward lands about + // 0.109m out. The bone is at the base of the skull, and a face is further forward than it + // looks - at 0.095 the eyes were correctly placed and entirely inside the head, which the + // depth-tested shader then hid completely. public static readonly float EyeSeparation = 0.032f; // half the distance between them - public static readonly float EyeForward = 0.095f; - public static readonly float EyeHeight = 0.070f; + public static readonly float EyeForward = 0.140f; + public static readonly float EyeHeight = 0.100f; public static readonly float EyeSize = 0.020f; // Base glow, before any star. The tiers replace it with the emissive colours the game diff --git a/JotunnModStub/Dvergar/DvergarVisuals.cs b/JotunnModStub/Dvergar/DvergarVisuals.cs index ffdac13..befdaef 100644 --- a/JotunnModStub/Dvergar/DvergarVisuals.cs +++ b/JotunnModStub/Dvergar/DvergarVisuals.cs @@ -281,11 +281,18 @@ namespace RacesOfValheim if (eye != null) { + // Which side of the head it came out on. Positive means the face; negative would + // mean the offsets are pushing into the back of the skull, which no amount of + // increasing them would ever fix. + Vector3 offset = eye.position - headBone.position; + Vector3 flat = new Vector3(offset.x, 0f, offset.z); + float towardFace = Vector3.Dot(flat.normalized, player.transform.forward); + Jotunn.Logger.LogInfo( $"[Dvergar] eye parent='{(eye.parent != null ? eye.parent.name : "none")}' " + $"localPos={eye.localPosition} localScale={eye.localScale} world={eye.position} " + - $"distFromHead={Vector3.Distance(eye.position, headBone.position):F3}m " + - $"worldSize={eye.lossyScale.x:F3}m"); + $"distFromHead={offset.magnitude:F3}m up={offset.y:F3}m " + + $"towardFace={towardFace:F2} worldSize={eye.lossyScale.x:F3}m"); } }