18dec16  Description: Tux the penguin avatar.

This shader-based avatar encapsulates most of the details of avatar shape, color, and movement within vertex and fragment shaders.  A related texture object, avatarobj.adb, defines a crude initial geometry and a mapping of a texture image onto the texture object.

This example implementation is minimal, yet instructive.  The hardcoded data defining shape and color, and the uniforms and functions defining behavior can ultimately be as detailed and refined as desired.

The inputs include uniforms for time, position, and attitude.  The shaders then offload the computational burden of the avatar representation onto the graphics processor.

Avatar-specific hardcoded data resides mostly in the shaders and partly in the texture object:  avatarobj.adb.  The hardcoded data defines geometry and the mapping of the texture object to various parts of the avatar.  In this case, the texture object is a cube with radius one that is defined in 3 parts.  The upper half maps to the avatar's main body.  The lower half is divided into left and right rectangles that are mapped to feet.  The image used for the texture also has 3 parts that map to the appropriate piece of the texture object.

The result is a portable avatar.  One needs only:
.) texture object body, avatarobj.adb
.) texture object spec, avatarobj.ads
.) vertex shader, avatarobj.vs
.) fragment shader, avatarobj.fs
.) texture image, blkpng.png

Interfacing code with the above elements is very simple.  Essentially you need only pass the required uniform values prior to drawing.

Of course one still needs a decent camera positioning and pointing policy within the game code in order to fully appreciate the avatar.  But that is beyond the scope of this description.

