|
group2 0.1.0
CSE 125 Group 2
|
Per-frame instance entry — one per visible animated character. More...
#include <RendererTypes.hpp>
Public Attributes | |
| glm::mat4 | worldTransform {1.0f} |
| Rig-local → world. Composed CPU-side as T * R * S. | |
| uint32_t | paletteBase = 0 |
| First joint slot in the palette = instanceIndex * numJoints. | |
| uint32_t | materialId = 0 |
| Reserved; ignore for now (will index a material table later). | |
| uint32_t | _pad0 = 0 |
| uint32_t | _pad1 = 0 |
| glm::vec4 | tint {1.0f, 1.0f, 1.0f, 0.0f} |
| rgb = per-player color, a = blend factor (0 = no tint). | |
Per-frame instance entry — one per visible animated character.
Game.cpp appends one of these to a std::vector<SkinnedInstance> every frame for each visible character, sets paletteBase to slot * numJoints, and passes the vector to setSkinnedFrame(). The renderer uploads it as an SSBO; the shader reads it as instances[gl_InstanceIndex].
Layout (96 bytes) — keep std140-friendly. Pads added so total is a multiple of 16 and tint lands at byte offset 80.
| uint32_t SkinnedInstance::_pad0 = 0 |
| uint32_t SkinnedInstance::_pad1 = 0 |
| uint32_t SkinnedInstance::materialId = 0 |
Reserved; ignore for now (will index a material table later).
| uint32_t SkinnedInstance::paletteBase = 0 |
First joint slot in the palette = instanceIndex * numJoints.
| glm::vec4 SkinnedInstance::tint {1.0f, 1.0f, 1.0f, 0.0f} |
rgb = per-player color, a = blend factor (0 = no tint).
| glm::mat4 SkinnedInstance::worldTransform {1.0f} |
Rig-local → world. Composed CPU-side as T * R * S.