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
|
|
@ -339,7 +339,15 @@ namespace RacesOfValheim
|
|||
if (__instance == null || !__instance.m_isPlayer) return;
|
||||
|
||||
Player player = __instance.GetComponent<Player>();
|
||||
if (player == null || !DvergarVisuals.IsDvergarPlayer(player)) return;
|
||||
if (player == null) return;
|
||||
|
||||
// Before the race check, because it takes the eyes off anyone who has stopped
|
||||
// being a Dvergar as well as putting them on anyone who is one. Here rather than
|
||||
// in the UpdateVisuals postfix so that the tier refresh DvergarRace forces on a
|
||||
// boss kill recolours them at the same moment it recolours the skin.
|
||||
DvergarVisuals.ApplyEyes(player);
|
||||
|
||||
if (!DvergarVisuals.IsDvergarPlayer(player)) return;
|
||||
|
||||
if (__instance.m_bodyModel != null && __instance.m_bodyModel.material != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue