The idea is this. A sphere is created around the character's head, which encompasses the entire head. A billboard shader is applied to this sphere, with an emotion.
- The emotion is always on top of the head.
- Trees (objects in the foreground) overlap the emotion.


shader_type spatial;
uniform sampler2D texture2D;
varying vec2 tex_position;
void vertex() {
mat4 emotion;
// GetBillboardMatrix:2
{
mat4 __mvm = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
__mvm = __mvm * mat4(vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0), vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), vec4(0.0, 0.0, 0.0, 1.0));
emotion = __mvm;
}
// Output:0
MODELVIEW_MATRIX = emotion;
}
void fragment() {
tex_position = VERTEX.xy * 3.0 - 0.05;
ALBEDO = texture(texture2D, tex_position).xyz;
ALPHA = 1.0 - texture(texture2D, tex_position).z;
}