feat(dvergar): give the eyes a glow, and take the colour from the stars
A player's eyes are painted into the skin texture, and Custom/Player has no emission channel to light them with - the shader survey in the last commit is what established that. So a Dvergar wears two small emissive quads over them instead. There was no working example to copy: the Aswid's red eyes were never built, only cleaned up, which is why they never glowed. Colour comes from the same LevelSetup list the skin tint does. One star is RGBA(0, 4, 3.3), two stars RGBA(12, 0, 8.8) - both far past 1, which is what makes them bloom rather than merely look bright. Only the base tier's colour is ours to choose. The quads hang off Character.m_eye, which already sits at eye height and already faces the look direction, so the offsets are plain metres in an obvious frame: no working out which way a rig bone points, and no fighting the 100x scale the player armature is authored at. Everything about the placement is a named constant, since none of it can be judged without seeing it. Applied from the UpdateColors postfix rather than UpdateVisuals so that the refresh DvergarRace already forces when a boss falls recolours the eyes in the same frame it recolours the skin. It runs before the race check so it also takes them off again. The glow shader is resolved from a list and the winner is logged, because Unity strips shaders nothing references and assuming one would be a silent failure.
This commit is contained in:
parent
0b6a61a852
commit
9dc072f0a5
3 changed files with 160 additions and 1 deletions
|
|
@ -81,6 +81,27 @@ namespace RacesOfValheim
|
|||
// B for a colder one. Keeping R below B is what holds the flesh tone down.
|
||||
public static readonly Color TwoStarSkinColor = new Color(0.34f, 0.37f, 0.44f, 1f);
|
||||
|
||||
// ─── Glowing eyes ────────────────────────────────────────────────────
|
||||
// A player's eyes are painted into the skin texture, and Custom/Player has no emission
|
||||
// channel to light them with - so a Dvergar wears two small emissive quads over them
|
||||
// instead. Nothing else in the mod does this, so there was no working example to copy;
|
||||
// the Aswid's red eyes were never built at all, only cleaned up.
|
||||
//
|
||||
// Offsets are in metres from Character.m_eye, which already sits at eye height and faces
|
||||
// wherever the player is looking, so no bone axes have to be guessed at. EyeForward is
|
||||
// the one to tune first: too little and the quads sink into the face, too much and they
|
||||
// float in front of it.
|
||||
public static readonly float EyeSeparation = 0.035f; // half the distance between them
|
||||
public static readonly float EyeForward = 0.075f;
|
||||
public static readonly float EyeHeight = -0.010f;
|
||||
public static readonly float EyeSize = 0.022f;
|
||||
|
||||
// Base glow, before any star. The tiers replace it with the emissive colours the game
|
||||
// itself gives a starred dverger - RGBA(0, 4, 3.3) at one star and RGBA(12, 0, 8.8) at
|
||||
// two, both far past 1, which is exactly what makes them bloom rather than just look
|
||||
// bright.
|
||||
public static readonly Color BaseEyeColor = new Color(0f, 2.2f, 1.8f, 1f);
|
||||
|
||||
// ─── Cosmetic hood ───────────────────────────────────────────────────
|
||||
// The helmet slot itself stays free — whatever the player equips keeps all of its stats,
|
||||
// only the mesh is swapped.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue