-
Notifications
You must be signed in to change notification settings - Fork 162
Renderer Modules
A renderer module provides components and prefabs for drawing items and cursors (and sometimes, entire interface modules) with a particular visual style.
All renderer modules are contained within the /Assets/Hover/RendererModules
folder.
The module's components are responsible for controlling any custom meshes, colors, transitions, animations, or other effects. These components typically customize the standard renderer-related graphics, but may also implement entirely new visuals or behaviors.
Each renderer module also provides various prefabs. Each prefab represents a complete "renderer unit" for a particular element, pre-configured with all the components and structures needed for visualizing that element.
Renderer module prefab names use the format: Hover{Module}{Element}{Shape}Renderer-{Style}. For example, the "Alpha" module's prefab for an arc-shaped button, in its default style, would use the name "HoverAlphaButtonArcRenderer-Default". The available element types are Button, Slider, Tick (for Sliders), Cursor, and Idle. Most renderer modules provide only a default style, but the developer can create new prefabs with their own style variations.
The item and cursor "updater" components provide properties for specifying these prefabs, and the "updater" immediately instantiates the prefab (maintaining the prefab reference) into the scene. Once the prefab is placed into the scene, it can be modified individually (for example, a particular button may need a red background).
Renderer modules typically apply vertex-colored materials to the renderer's mesh components. This allows all meshes to use the same material, while still allowing meshes to be colored independently. By sharing the same material, Unity can draw these meshes together, in a single draw-call, via dynamic batching.
The "Alpha" renderer module provides support for transparent materials. This is useful for certain visual effects (for example, a slightly see-through menu interface) and for transition animations (for example, a menu panel fades into view).
This module contains components that control a renderer's alpha values, its sorting layer, and its sorting order. Components for this module are located in the Hover.RendererModules.Alpha
namespace.
Transparent materials can cause rendering issues in various scenarios (notably, when there are depth-sorting conflicts with other transparent materials). For this reason, support for transparency is present in the "Alpha" renderer module, rather than being included with the core renderer components. The module's "sorting" properties allow total control over the rendering order; see this video for details.
The "Opaque" renderer module provides support for applying non-transparent vertex colors to a renderer's mesh components. This module is much simpler than the "Alpha" module, since opaque materials do not need special control over alpha values or the depth-sorting order.
Components for this module are located in the Hover.RendererModules.Opaque
namespace.
General
Features
Modules
Other